:root {
  --f2y-account-red: #b3261e;
  --f2y-account-red-dark: #8f1d17;
  --f2y-account-bg: #f5f5f7;
  --f2y-account-card: #fff;
  --f2y-account-border: #d8dadd;
  --f2y-account-text: #29292d;
  --f2y-account-muted: #626269;
}

body.f2y-customer-account-page .woocommerce {
  width: min(1120px, calc(100% - 32px));
  margin: 40px auto;
  padding: clamp(20px, 3vw, 34px);
  color: var(--f2y-account-text);
  background: var(--f2y-account-card);
  border: 1px solid var(--f2y-account-border);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(25, 25, 30, 0.08);
  box-sizing: border-box;
}

body.f2y-customer-account-page .woocommerce::after {
  content: "";
  display: table;
  clear: both;
}

body.f2y-customer-account-page .woocommerce-MyAccount-navigation {
  width: 100%;
  float: none;
  margin: 0 0 28px;
}

body.f2y-customer-account-page .woocommerce-MyAccount-navigation ul {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--f2y-account-border);
  border-radius: 999px;
}

body.f2y-customer-account-page .woocommerce-MyAccount-navigation li {
  margin: 0;
  padding: 0;
  border: 0;
}

body.f2y-customer-account-page .woocommerce-MyAccount-navigation a {
  display: block;
  padding: 10px 17px;
  color: #4e4e54;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

body.f2y-customer-account-page .woocommerce-MyAccount-navigation a:hover,
body.f2y-customer-account-page .woocommerce-MyAccount-navigation .is-active a {
  color: #fff;
  background: var(--f2y-account-red);
}

body.f2y-customer-account-page .woocommerce-MyAccount-content {
  width: 100%;
  float: none;
}

/* A single Woo My Account module owns both areas. On logged-in screens it
   becomes the two-card layout shown in Divi; no duplicate shortcode is needed. */
body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-navigation {
  width: 34%;
  float: left;
  margin: 0;
  padding: clamp(20px, 3vw, 32px);
  background: var(--f2y-account-bg);
  border: 1px solid var(--f2y-account-border);
  border-radius: 18px;
  box-sizing: border-box;
}

body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-navigation ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  border-radius: 18px;
}

body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-content {
  width: 62%;
  float: right;
}

/* Divi's Woo module applies large link typography and spacing of its own.
   Keep the four account choices compact, centred and readable. */
html body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-navigation ul {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 6px !important;
  border-radius: 18px !important;
  box-sizing: border-box !important;
}

html body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-navigation li {
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-navigation a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  padding: 9px 10px !important;
  color: #4e4e54 !important;
  background: transparent !important;
  border-radius: 13px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  white-space: normal !important;
  box-sizing: border-box !important;
}

html body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-navigation a:hover,
html body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-navigation .is-active a {
  color: #fff !important;
  background: var(--f2y-account-red) !important;
}

/* WooCommerce's stock dashboard copy refers to order history and multiple
   addresses. Option 1 deliberately replaces it with the Food2You summary. */
body.f2y-account-dashboard .woocommerce-MyAccount-content > p {
  display: none !important;
}

body.f2y-customer-account-page .f2y-account-welcome,
body.f2y-customer-account-page form.login,
body.f2y-customer-account-page form.register,
body.f2y-customer-account-page form.woocommerce-EditAccountForm,
body.f2y-customer-account-page form.woocommerce-address-fields {
  padding: clamp(20px, 3vw, 32px);
  background: var(--f2y-account-bg);
  border: 1px solid var(--f2y-account-border);
  border-radius: 18px;
  box-sizing: border-box;
}

body.f2y-customer-account-page form.login,
body.f2y-customer-account-page form.register {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

body.f2y-customer-account-page form .form-row input.input-text,
body.f2y-customer-account-page form .form-row select {
  width: 100%;
}

body.f2y-customer-account-page .f2y-account-eyebrow {
  margin: 0 0 5px;
  color: var(--f2y-account-red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body.f2y-customer-account-page h2,
body.f2y-customer-account-page h3 {
  color: var(--f2y-account-text);
}

body.f2y-customer-account-page .f2y-account-welcome h2 {
  margin: 0 0 8px;
}

body.f2y-customer-account-page .f2y-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

body.f2y-customer-account-page button.button,
body.f2y-customer-account-page a.button,
body.f2y-customer-account-page input.button {
  padding: 11px 18px;
  color: #fff;
  background: var(--f2y-account-red);
  border: 1px solid var(--f2y-account-red);
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

body.f2y-customer-account-page button.button:hover,
body.f2y-customer-account-page a.button:hover,
body.f2y-customer-account-page input.button:hover {
  color: #fff;
  background: var(--f2y-account-red-dark);
  border-color: var(--f2y-account-red-dark);
}

body.f2y-customer-account-page a.button.f2y-button-secondary {
  color: var(--f2y-account-red);
  background: #fff;
}

body.f2y-customer-account-page a.button.f2y-button-secondary:hover {
  color: #fff;
  background: var(--f2y-account-red);
}

/* The two dashboard actions deliberately share one consistent button style. */
html body.f2y-customer-account-page .f2y-account-actions a.button {
  padding: 11px 18px !important;
  color: var(--f2y-account-red) !important;
  background: #fff !important;
  border: 1px solid var(--f2y-account-red) !important;
}

html body.f2y-customer-account-page .f2y-account-actions a.button:hover,
html body.f2y-customer-account-page .f2y-account-actions a.button:focus-visible {
  padding: 11px 18px !important;
  color: #fff !important;
  background: var(--f2y-account-red) !important;
  border-color: var(--f2y-account-red) !important;
}

/* Divi can inject an arrow/icon and increase the right padding on hover. */
html body.f2y-customer-account-page .f2y-account-actions a.button::before,
html body.f2y-customer-account-page .f2y-account-actions a.button::after {
  display: none !important;
  content: none !important;
}

body.f2y-customer-account-page input.input-text,
body.f2y-customer-account-page input[type="email"],
body.f2y-customer-account-page input[type="password"],
body.f2y-customer-account-page input[type="tel"],
body.f2y-customer-account-page select {
  min-height: 46px;
  padding: 10px 12px;
  color: var(--f2y-account-text);
  background: #fff;
  border: 1px solid #bfc2c8;
  border-radius: 10px;
  box-sizing: border-box;
}

body.f2y-customer-account-page input:focus,
body.f2y-customer-account-page select:focus {
  border-color: var(--f2y-account-red);
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.13);
  outline: 0;
}

body.f2y-customer-account-page .f2y-marketing-preference {
  margin: 20px 0;
  padding: 15px;
  background: #fff;
  border: 1px solid var(--f2y-account-border);
  border-radius: 12px;
}

body.f2y-customer-account-page .f2y-marketing-preference label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 700;
}

body.f2y-customer-account-page .f2y-marketing-preference input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--f2y-account-red);
}

body.f2y-customer-account-page .f2y-field-help,
body.f2y-customer-account-page .f2y-account-intro,
body.f2y-customer-account-page .f2y-address-check-note {
  display: block;
  color: var(--f2y-account-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

body.f2y-customer-account-page .f2y-field-help {
  margin: 7px 0 0 27px;
}

body.f2y-customer-account-page .f2y-address-check-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: rgba(179, 38, 30, 0.07);
  border-left: 4px solid var(--f2y-account-red);
  border-radius: 8px;
}

/*
 * Divi does not always retain WooCommerce's u-columns/col2-set classes on
 * this wrapper. Target the stable ID and the two direct panels instead.
 */
html body.woocommerce-account:not(.logged-in) #customer_login,
html body.f2y-customer-account-page:not(.logged-in) #customer_login {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body.woocommerce-account:not(.logged-in) #customer_login > *,
html body.f2y-customer-account-page:not(.logged-in) #customer_login > * {
  position: static !important;
  width: auto !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  clear: none !important;
  transform: none !important;
}

html body.woocommerce-account:not(.logged-in) #customer_login > :first-child,
html body.f2y-customer-account-page:not(.logged-in) #customer_login > :first-child {
  grid-column: 1 !important;
  grid-row: 1 !important;
}

html body.woocommerce-account:not(.logged-in) #customer_login > :nth-child(2),
html body.f2y-customer-account-page:not(.logged-in) #customer_login > :nth-child(2) {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

html body.woocommerce-account:not(.logged-in) #customer_login > * > h2,
html body.f2y-customer-account-page:not(.logged-in) #customer_login > * > h2 {
  margin: 0 0 14px !important;
}

html body.woocommerce-account:not(.logged-in) #customer_login form,
html body.f2y-customer-account-page:not(.logged-in) #customer_login form {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.f2y-account-address-status {
  display: none;
  margin: 14px 0 20px;
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1.45;
}

.f2y-account-address-status.is-checking,
.f2y-account-address-status.is-notice,
.f2y-account-address-status.is-valid,
.f2y-account-address-status.is-invalid {
  display: block;
}

.f2y-account-address-status.is-checking,
.f2y-account-address-status.is-notice {
  border-color: #e5c758;
  background: #fff9df;
  color: #5b4a00;
}

.f2y-account-address-status.is-valid {
  border-color: #70aa79;
  background: #eef8ef;
  color: #245d2d;
}

.f2y-account-address-status.is-invalid {
  border-color: #9e1e0c;
  background: #fff1ef;
  color: #9e1e0c;
}

body.f2y-customer-account-page button[name="save_address"][aria-busy="true"] {
  cursor: wait !important;
  opacity: 0.65;
}

body.f2y-customer-account-page .f2y-address-finder-locked-row {
  opacity: 0.66;
}

body.f2y-customer-account-page .f2y-address-finder-locked-row label {
  color: #4f4f4f !important;
}

body.f2y-customer-account-page .f2y-address-finder-locked {
  cursor: not-allowed !important;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255,255,255,0.18) 0,
      rgba(255,255,255,0.18) 8px,
      rgba(0,0,0,0.025) 8px,
      rgba(0,0,0,0.025) 16px
    ),
    #eeeeee !important;
  color: #555555 !important;
  border-color: #e0e0e0 !important;
  box-shadow: none !important;
}

/* Divi collapses its page columns at 980px. Stack the logged-out account
   panels at the same breakpoint so the desktop two-column grid is never
   squeezed inside Divi's tablet/mobile layout. */
@media (max-width: 980px) {
  html body.woocommerce-account:not(.logged-in) #customer_login,
  html body.f2y-customer-account-page:not(.logged-in) #customer_login {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 26px !important;
  }

  html body.woocommerce-account:not(.logged-in) #customer_login > *,
  html body.f2y-customer-account-page:not(.logged-in) #customer_login > * {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  html body.woocommerce-account:not(.logged-in) #customer_login > :first-child,
  html body.f2y-customer-account-page:not(.logged-in) #customer_login > :first-child {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  html body.woocommerce-account:not(.logged-in) #customer_login > :nth-child(2),
  html body.f2y-customer-account-page:not(.logged-in) #customer_login > :nth-child(2) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  html body.woocommerce-account:not(.logged-in) #customer_login form,
  html body.f2y-customer-account-page:not(.logged-in) #customer_login form,
  html body.woocommerce-account:not(.logged-in) #customer_login .form-row,
  html body.f2y-customer-account-page:not(.logged-in) #customer_login .form-row {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    float: none !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 720px) {
  body.f2y-customer-account-page .woocommerce {
    width: min(100% - 20px, 1120px);
    margin: 20px auto;
    padding: 14px;
    border-radius: 17px;
  }

  body.f2y-customer-account-page .woocommerce-MyAccount-navigation ul {
    width: 100%;
    border-radius: 14px;
  }

  body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-navigation,
  body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-content {
    width: 100%;
    float: none;
  }

  body.logged-in.f2y-customer-account-page .woocommerce-MyAccount-navigation {
    margin-bottom: 18px;
    padding: 14px;
  }

  body.f2y-customer-account-page .woocommerce-MyAccount-navigation li {
    flex: 1 1 calc(50% - 5px);
  }

  body.f2y-customer-account-page .woocommerce-MyAccount-navigation a {
    padding: 9px 11px;
    text-align: center;
  }

  html body.woocommerce-account:not(.logged-in) #customer_login,
  html body.f2y-customer-account-page:not(.logged-in) #customer_login {
    grid-template-columns: 1fr !important;
  }

  html body.woocommerce-account:not(.logged-in) #customer_login > *,
  html body.f2y-customer-account-page:not(.logged-in) #customer_login > * {
    grid-column: 1 !important;
  }

  html body.woocommerce-account:not(.logged-in) #customer_login > :first-child,
  html body.f2y-customer-account-page:not(.logged-in) #customer_login > :first-child {
    grid-row: 1 !important;
  }

  html body.woocommerce-account:not(.logged-in) #customer_login > :nth-child(2),
  html body.f2y-customer-account-page:not(.logged-in) #customer_login > :nth-child(2) {
    grid-row: 2 !important;
  }
}
