/**
 * AbayaFemme global storefront footer.
 */

.af-site-footer {
  margin-top: 0;
  color: var(--af-text-inverse);
  /* Charcoal, sampled from the mockup (#292928). The footer is a different plane from
   * the promotional bar and the newsletter card, which both sit on mid olive; painting
   * all three with olive-900 collapsed that depth into one flat slab. */
  background: var(--af-surface-footer);
}

/* The footer is the storefront's broadest plane. Keep a real maximum width for
 * very large monitors, but only a slim breathing edge on ordinary screens. */
.af-site-footer .af-container {
  width: min(calc(100% - clamp(1rem, 2vw, 2rem)), 105rem);
  max-width: 105rem;
  margin-inline: auto;
  padding-inline: clamp(0.25rem, 0.65vw, 0.75rem);
}

.af-support-fab {
  position: fixed;
  z-index: 390;
  right: max(1.15rem, env(safe-area-inset-right));
  bottom: max(1.15rem, env(safe-area-inset-bottom));
  display: inline-flex;
  min-height: 3.6rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.9rem 0.55rem 0.65rem;
  color: var(--af-text-inverse);
  background: var(--af-color-olive-800);
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: var(--af-radius-pill);
  box-shadow: var(--af-shadow-lg);
  font-family: var(--af-font-ui);
  text-decoration: none;
}

.af-support-fab:hover {
  color: var(--af-text-inverse);
  transform: translateY(-2px);
}

.af-support-fab__icon {
  display: block;
  width: 2.7rem;
  height: 2.7rem;
  object-fit: contain;
}

.af-support-fab span {
  display: grid;
  line-height: 1.05;
}

.af-support-fab small {
  font-size: 0.58rem;
  letter-spacing: 0.04em;
}

.af-support-fab strong {
  margin-top: 0.18rem;
  font-size: 0.76rem;
}

@media (max-width: 640px) {
  .af-support-fab {
    right: max(0.8rem, env(safe-area-inset-right));
    bottom: max(0.8rem, env(safe-area-inset-bottom));
    min-height: 3.25rem;
    padding: 0.45rem;
  }

  .af-support-fab span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .af-support-fab__icon {
    width: 2.65rem;
    height: 2.65rem;
  }

  body.single-product .af-support-fab {
    bottom: max(5.4rem, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .af-support-fab {
    transition: none;
  }
}

.af-footer-trust {
  color: var(--af-text-default);
  background: var(--af-surface-sunken);
  border-block: 1px solid var(--af-border-default);
}

.af-footer-trust__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin-block: 0;
  padding-block: var(--af-space-4);
  list-style: none;
}

.af-footer-trust__list li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--af-space-3);
  min-height: 2.5rem;
  padding-inline: clamp(0.5rem, 1.25vw, 1.25rem);
  font-size: var(--af-text-sm);
  font-weight: 600;
  text-align: center;
}

.af-footer-trust__list li + li {
  border-inline-start: 1px solid var(--af-border-strong);
}

.af-footer-trust__list svg {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  color: var(--af-color-taupe);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Newsletter ----------------------------------------------------------
 * One compact conversion band: couture icon, useful copy and one clear action. */
.af-footer-newsletter {
  --af-newsletter-accent: var(--af-color-olive-800);
  --af-newsletter-action: oklch(0.91 0.026 77);
  padding-block: clamp(0.8rem, 1.4vw, 1.25rem);
  background: var(--af-surface-page);
}

.af-footer-newsletter__inner {
  display: grid;
  grid-template-columns: clamp(5.25rem, 7vw, 6.75rem) minmax(17rem, 0.85fr) minmax(31rem, 1.4fr);
  width: min(calc(100% - clamp(1rem, 2vw, 2rem)), 105rem);
  max-width: 105rem;
  min-height: 10.75rem;
  align-items: center;
  gap: clamp(1.25rem, 2.8vw, 3rem);
  margin-inline: auto;
  padding: clamp(1.1rem, 1.7vw, 1.6rem) clamp(1rem, 1.8vw, 1.75rem);
  overflow: hidden;
  color: var(--af-color-ivory);
  background: var(--af-newsletter-accent);
  border-radius: 0.2rem;
  box-shadow: 0 0.85rem 2.5rem color-mix(in srgb, var(--af-color-ink) 7%, transparent);
}

.af-footer-newsletter__icon {
  display: grid;
  min-width: 0;
  place-items: center;
}

.af-footer-newsletter__icon img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.af-footer-newsletter__copy {
  min-width: 0;
  max-width: 32rem;
}

.af-footer-newsletter__copy .af-eyebrow {
  margin: 0 0 0.45rem;
  color: color-mix(in srgb, var(--af-color-ivory) 78%, transparent);
  font-size: 0.7rem;
}

.af-footer-newsletter__copy h2 {
  max-width: 22ch;
  margin: 0;
  color: inherit;
  font-size: clamp(1.6rem, 2.15vw, 2.25rem);
  font-weight: 480;
  letter-spacing: -0.035em;
  line-height: 1.03;
  text-wrap: balance;
}

.af-footer-newsletter__copy > p:last-child {
  max-width: 46ch;
  margin: 0.55rem 0 0;
  color: color-mix(in srgb, var(--af-color-ivory) 76%, transparent);
  font-family: var(--af-font-ui);
  font-size: 0.86rem;
  line-height: 1.5;
}

.af-footer-newsletter__form {
  min-width: 0;
  color: var(--af-color-ivory);
}

.af-footer-newsletter__form .sesm-form {
  --sesm-accent: var(--af-newsletter-action) !important;
  --sesm-accent-text: var(--af-newsletter-accent) !important;
  --sesm-fg: var(--af-color-ivory) !important;
  --sesm-border: transparent !important;
  --sesm-field-bg: oklch(0.975 0.008 77) !important;
  --sesm-radius: 2px !important;
  width: 100%;
  max-width: none;
}

.af-footer-newsletter__form .sesm-form__head {
  display: none;
}

.af-footer-newsletter__form .sesm-form__input {
  min-height: 3.35rem;
  margin: 0;
  padding-inline: 1.15rem;
  background: oklch(0.975 0.008 77);
  color: var(--af-text-default);
  -webkit-text-fill-color: var(--af-text-default);
  border-color: transparent;
  font-family: var(--af-font-ui);
  font-size: 0.95rem;
}

.af-footer-newsletter__form .sesm-form__input:-webkit-autofill {
  -webkit-text-fill-color: var(--af-text-default);
  box-shadow: inset 0 0 0 100px oklch(0.975 0.008 77);
}

.af-footer-newsletter__form .sesm-form__input::placeholder {
  color: var(--af-text-muted);
  opacity: 1;
}

.af-footer-newsletter__form .sesm-form__btn {
  min-height: 3.35rem;
  margin: 0;
  padding-inline: clamp(1.25rem, 2.2vw, 2rem);
  color: var(--af-newsletter-accent);
  background: var(--af-newsletter-action);
  border-color: var(--af-newsletter-action);
  font-size: 0.75rem;
  transition: background-color 180ms var(--af-ease), color 180ms var(--af-ease), transform 180ms var(--af-ease);
}

.af-footer-newsletter__form .sesm-form__btn:hover,
.af-footer-newsletter__form .sesm-form__btn:focus-visible {
  color: var(--af-color-ivory);
  background: transparent;
  opacity: 1;
}

.af-footer-newsletter__form .sesm-form__input:focus {
  outline-color: var(--af-newsletter-action);
  outline-offset: 2px;
}

.af-footer-newsletter__form .sesm-form__msg {
  min-height: 0;
  margin: 0.5rem 0 0;
  font-family: var(--af-font-ui);
  font-size: 0.82rem;
  font-weight: 600;
}

.af-footer-newsletter__form .sesm-form__msg:empty {
  display: none;
}

.af-footer-newsletter__form .sesm-form__msg.is-ok {
  color: oklch(0.87 0.075 145);
}

.af-footer-newsletter__form .sesm-form__msg.is-err {
  color: oklch(0.88 0.08 55);
}

.af-footer-newsletter__assurances {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.15rem;
  margin: 0.65rem 0 0;
  padding: 0;
  color: color-mix(in srgb, var(--af-color-ivory) 76%, transparent);
  font-family: var(--af-font-ui);
  font-size: 0.8rem;
  list-style: none;
}

.af-footer-newsletter__assurances li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.af-footer-newsletter__assurances svg {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
  color: var(--af-newsletter-action);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.af-footer-main {
  padding-block: clamp(var(--af-space-7), 5vw, var(--af-space-8)) var(--af-space-6);
}

/* Brand, three link columns and accepted payments — the mockup's five tracks. The
 * sixth column existed only because the footer used to carry an account menu. */
.af-footer-main__grid {
  display: grid;
  grid-template-columns: minmax(14rem, 1.35fr) repeat(3, minmax(8rem, 1fr)) minmax(11rem, 1fr);
  gap: clamp(var(--af-space-5), 3vw, var(--af-space-7));
}

.af-footer-brand {
  max-width: 25rem;
}

.af-footer-brand__wordmark {
  display: inline-block;
  color: var(--af-text-inverse);
  font-family: var(--af-font-display);
  /* ~28px in the mockup. At 43px it competed with the header wordmark and pushed the
   * whole brand column out of proportion with the three link columns. */
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
  text-decoration: none;
}

.af-footer-brand > p {
  margin: var(--af-space-4) 0;
  color: color-mix(in srgb, var(--af-color-white) 70%, transparent);
  font-size: 1rem;
  line-height: 1.55;
}

.af-footer-nav h2 {
  margin: 0 0 var(--af-space-4);
  color: var(--af-text-inverse);
  font-family: var(--af-font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The shared focus ring is a blue tuned for the light storefront; on the olive footer
 * ground it reads as a dark box on dark. Same correction the announcement bar makes. */
.af-site-footer :focus-visible {
  outline-color: var(--af-color-sand);
}

/* Disclosure chrome belongs to phones only (see the max-width: 640px block). Above it
 * the column must read and behave as a plain heading followed by a list, so the marker
 * is removed and the summary loses its pointer affordance. Closing is refused in
 * footer.js rather than here, because CSS cannot stop a keyboard activation. */
.af-footer-nav__summary {
  display: block;
  cursor: default;
  list-style: none;
}

.af-footer-nav__summary::-webkit-details-marker {
  display: none;
}

/* Link rows sit on a ~26px pitch, close to the mockup's 21px.
 *
 * They measured 44px before, because WoodMart's global `:is(ul,ol) li{margin-bottom:10px}`
 * applies to these items and stacked on top of the gap and the anchor padding. Four
 * columns of eight links at nearly double pitch is what made the footer sprawl. */
.af-footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--af-space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.af-footer-links li {
  margin: 0;
}

.af-footer-links a {
  display: inline-block;
  padding-block: 0.1rem;
  color: color-mix(in srgb, var(--af-color-white) 72%, transparent);
  font-size: 1rem;
  line-height: 1.5;
  text-decoration: none;
}

.af-footer-links a:hover,
.af-footer-links a:focus-visible,
.af-footer-brand__support:hover,
.af-footer-brand__support:focus-visible {
  color: var(--af-color-white);
  text-decoration: underline;
}

.af-footer-social {
  margin-top: var(--af-space-5);
}

.af-footer-social .wd-social-icons {
  justify-content: flex-start;
  gap: var(--af-space-2);
}

/* Outlined rounded tiles, as in the mockup, rather than bare glyphs. */
.af-footer-social .wd-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  color: var(--af-text-inverse);
  border: 1px solid color-mix(in srgb, var(--af-color-white) 26%, transparent);
  border-radius: var(--af-radius-sm);
}

.af-footer-social .wd-social-icon:hover {
  border-color: color-mix(in srgb, var(--af-color-white) 55%, transparent);
}

.af-footer-payments {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  flex-wrap: wrap;
  gap: var(--af-space-3);
  margin: 0;
  padding: 0;
  border: 0;
}

.af-footer-payments__label {
  color: var(--af-text-inverse);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Real card marks on light tiles, as in the mockup. Text pills reading "Cartes de
 * Crédit/Débit" were the least premium detail in the footer: a customer scans this
 * column for logos, not for a sentence. */
.af-footer-payments ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--af-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.af-footer-payments li {
  margin: 0;
  line-height: 0;
}

.af-footer-payments svg {
  display: block;
  width: 2.9rem;
  height: auto;
}

.af-footer-bottom {
  border-top: 1px solid color-mix(in srgb, var(--af-color-white) 15%, transparent);
}

/* Centred, as in the mockup. The legal links stay — they are a legal requirement, not a
 * design choice — but they sit under the copyright instead of pulling the eye to the
 * far right corner of the page. */
.af-footer-bottom__inner {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--af-space-2);
  padding-block: var(--af-space-5);
  text-align: center;
}

.af-footer-bottom p {
  margin: 0;
  color: color-mix(in srgb, var(--af-color-white) 58%, transparent);
  font-size: 0.86rem;
}

.af-footer-bottom .af-footer-links {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--af-space-1) var(--af-space-4);
}

.af-footer-bottom .af-footer-links a {
  padding: 0;
  font-size: 0.86rem;
}

@media (max-width: 1050px) {
  .af-footer-newsletter__inner {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    min-height: 0;
  }

  .af-footer-newsletter__form {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {

  .af-footer-main__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .af-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 901px) and (max-width: 1099px) {
  .af-footer-main__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .af-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .af-footer-trust__list {
    grid-template-columns: 1fr;
    padding-block: var(--af-space-2);
  }

  .af-footer-trust__list li {
    justify-content: flex-start;
    padding-block: var(--af-space-2);
    text-align: start;
  }

  .af-footer-trust__list li + li {
    border-block-start: 1px solid var(--af-border-default);
    border-inline-start: 0;
  }

  .af-footer-newsletter__inner {
    grid-template-columns: 4.75rem minmax(0, 1fr);
    width: calc(100% - 1rem);
    min-height: 0;
    gap: 0.9rem 1rem;
    padding: 0.9rem;
  }

  .af-footer-newsletter__icon {
    align-self: start;
  }

  .af-footer-newsletter__copy h2 {
    max-width: 18ch;
    font-size: clamp(1.5rem, 7.5vw, 1.95rem);
  }

  .af-footer-newsletter__copy > p:last-child {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .af-footer-newsletter__form {
    grid-column: 1 / -1;
  }

  .af-footer-newsletter__form .sesm-form__row {
    flex-direction: column;
  }

  .af-footer-newsletter__form :is(.sesm-form__input, .sesm-form__btn) {
    flex: 0 0 auto;
    width: 100%;
    min-height: 3.3rem;
  }

  .af-footer-newsletter__assurances {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.55rem;
    font-size: 0.78rem;
  }

  /* One column of collapsible sections. Two columns of permanently expanded links made
   * the footer 1,575px tall at 390px — 16% of the whole homepage — and pushed the
   * copyright and legal row far below the fold. */
  .af-footer-main__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .af-footer-brand {
    margin-bottom: var(--af-space-6);
  }

  .af-footer-nav {
    border-top: 1px solid color-mix(in srgb, var(--af-color-white) 15%, transparent);
  }

  .af-footer-nav__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--af-space-4);
    /* Comfortable touch target, and the same height whether open or closed. */
    min-height: 3.25rem;
    cursor: pointer;
  }

  .af-footer-nav__summary h2 {
    margin: 0;
  }

  .af-footer-nav__summary::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-right: 1px solid color-mix(in srgb, var(--af-color-white) 60%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--af-color-white) 60%, transparent);
    transform: translateY(-0.15rem) rotate(45deg);
    transition: transform var(--af-duration-fast) var(--af-ease);
  }

  .af-footer-nav__disclosure[open] > .af-footer-nav__summary::after {
    transform: translateY(0.05rem) rotate(-135deg);
  }

  .af-footer-nav__disclosure[open] > .af-footer-links {
    padding-bottom: var(--af-space-5);
  }

  .af-footer-payments {
    padding-top: var(--af-space-6);
    border-top: 1px solid color-mix(in srgb, var(--af-color-white) 15%, transparent);
  }
}
