/**
 * FancyMeds nofrills — shared site footer.
 * Brand | Explore, then a rule + compact legal link row, then disclaimer.
 * Mobile: tighter padding, Explore 2-col, legal wraps under the rule.
 *
 * Wordmark: brand/fancymeds-logo.svg (Poppins SemiBold outlined paths) — height only, width auto.
 */

body > footer {
  padding: 0 0 1.35rem;
  color: var(--ink-soft, #5c6b80);
  font-size: 0.9rem;
  background: var(--sky, #f2f6fc);
  border-top: 1px solid var(--line, #dce3ee);
}

body > footer > .wrap {
  width: min(var(--max, 1120px), calc(100% - (2 * var(--page-gutter, 1.5rem))));
  margin-inline: auto;
  padding-top: 1.75rem;
}

.footer-trust {
  padding: 1.85rem var(--page-gutter, 1.5rem) 0.15rem;
  text-align: center;
}

.footer-trust-card {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  width: min(38rem, 100%);
  margin-inline: auto;
  padding: 1.05rem 0.35rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
}

.footer-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 5.4rem;
  padding: 0.2rem 0.85rem;
}

.footer-trust-item:not(:last-child) {
  border-right: 1px solid #e4eaf2;
}

.footer-trust-pcab {
  display: block;
  width: min(11.25rem, 100%);
  height: auto;
}

.footer-trust-flag {
  display: block;
  width: 4.55rem;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(11, 18, 32, 0.08);
}

.footer-trust-flag-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.2;
  color: var(--ink, #0b1220);
}

.footer-trust-apc {
  display: block;
  width: min(10.75rem, 100%);
  height: auto;
}

.footer-trust-note {
  margin: 0.85rem 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--ink-soft, #5c6b80);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(12rem, 1.2fr) minmax(10rem, 0.85fr);
  grid-template-areas:
    "brand explore"
    "legal legal";
  align-items: start;
  column-gap: clamp(2rem, 5vw, 4rem);
  row-gap: 0;
}

.footer-brand-block {
  grid-area: brand;
  min-width: 0;
  max-width: 18rem;
}

.footer-col--explore {
  grid-area: explore;
}

.footer-col--legal {
  grid-area: legal;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #c5cedb;
}

.footer-brand-link {
  display: inline-block;
  margin-bottom: 0.55rem;
  text-decoration: none;
  color: inherit;
  line-height: 0;
}

a.footer-brand-link:hover {
  text-decoration: none;
  opacity: 0.9;
}

.footer-brand {
  display: block;
  height: 26px;
  width: auto;
  max-width: none;
  aspect-ratio: 546.4 / 107.92;
  flex-shrink: 0;
  overflow: visible;
}

img.footer-brand {
  object-fit: contain;
  object-position: left center;
  image-rendering: auto;
}

.footer-tagline {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink-soft, #5c6b80);
  max-width: 16rem;
}

.footer-col h3 {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink, #0b1220);
}

/* Legal sits in the bottom bar — heading is redundant (nav has aria-label). */
.footer-col--legal > h3 {
  display: none;
}

.footer-explore {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  column-gap: 1.75rem;
  row-gap: 0.35rem;
}

.footer-col--legal nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 1.15rem;
}

.footer-explore-spacer {
  display: none;
}

.footer-col a {
  color: var(--ink-soft, #5c6b80);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--blue, #2060f0);
}

.footer-col--legal nav a {
  font-size: 0.78rem;
  font-weight: 500;
}

body > footer .legal {
  max-width: 52rem;
  margin-top: 0.7rem;
  font-size: 0.68rem;
  line-height: 1.45;
  color: #8a93a5;
}

@media (max-width: 768px) {
  body > footer {
    padding: 0 0 1.05rem;
  }

  body > footer > .wrap {
    padding-top: 1.2rem;
  }

  .footer-trust {
    padding: 1.35rem 1rem 0.1rem;
  }

  .footer-trust-card {
    padding: 0.8rem 0.1rem;
    border-radius: 0.85rem;
  }

  .footer-trust-item {
    min-height: 4.5rem;
    padding: 0.15rem 0.4rem;
    gap: 0.3rem;
  }

  .footer-trust-pcab {
    width: min(7.6rem, 100%);
  }

  .footer-trust-flag {
    width: 3.35rem;
  }

  .footer-trust-flag-label {
    font-size: 0.6rem;
  }

  .footer-trust-apc {
    width: min(7.4rem, 100%);
  }

  .footer-trust-note {
    margin-top: 0.7rem;
    font-size: 0.74rem;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand brand"
      "explore explore"
      "legal legal";
    row-gap: 0.75rem;
  }

  .footer-brand-block {
    max-width: none;
  }

  .footer-brand {
    height: 22px;
  }

  .footer-brand-link {
    margin-bottom: 0.35rem;
  }

  .footer-tagline {
    max-width: 22rem;
    font-size: 0.82rem;
  }

  .footer-col--explore > h3 {
    display: none;
  }

  .footer-explore {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.85rem;
    width: 100%;
  }

  .footer-explore a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    font-size: 0.82rem;
  }

  .footer-col--legal {
    margin-top: 0.1rem;
    padding-top: 0.65rem;
  }

  .footer-col--legal nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.85rem;
    width: 100%;
  }

  .footer-col--legal nav a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    font-size: 0.72rem;
  }

  body > footer .legal {
    margin-top: 0.55rem;
    font-size: 0.64rem;
    line-height: 1.4;
  }
}
