/* ==========================================================================
   AI Footer — layout
   Base styles + 5 preset structures. Colors/typography come from design tokens
   (--aib-*) through the --aif-* hooks; brand identity lives in
   assets/brands/<brand>.css (no separate -styles.css file anymore).
   ========================================================================== */

.ai-footer {
  /* Colors: same contract as the header — the brand layer sets --aif-* and
     every one FALLS BACK to the design tokens (--aib-*), so a user-chosen
     color (palette, injected after tokens.css) always wins:
     option color > brand color > base default. */
  --ai-primary: var(--aif-btn-bg, var(--aib-primary, #111111));
  --ai-bg: var(--aif-bg, var(--aib-surface, #ffffff));
  --ai-bg-alt: var(--aif-bg-alt, var(--aib-surface-alt, #f7f7f7));
  --ai-text: var(--aif-text, var(--aib-text, #111111));
  --ai-text-muted: var(--aif-text-muted, var(--aib-text-muted, #6a6a6a));
  --ai-border: var(--aif-border, var(--aib-border, #dddddd));
  --ai-btn-text: var(--aif-btn-color, var(--aib-on-primary, #ffffff));
  /* Element hooks brands commonly need (all optional, token-based defaults) */
  --ai-logo: var(--aif-logo-color, var(--ai-text));
  --ai-link: var(--aif-link-color, var(--ai-text-muted));
  --ai-link-hover: var(--aif-link-hover-color, var(--ai-text));
  --ai-heading: var(--aif-heading-color, var(--ai-text));
  --ai-cta: var(--aif-btn-bg, var(--aib-primary, #111111));
  --ai-radius: var(--aif-radius, 8px);
  --ai-transition: var(--aib-duration, 0.25s) ease;
  --ai-gap: var(--aif-gap, 32px);
  /* Column title signature (case/tracking/color) */
  --ai-coltitle-transform: var(--aif-coltitle-transform, uppercase);
  --ai-coltitle-tracking: var(--aif-coltitle-tracking, 0.1em);
  --ai-coltitle-color: var(--aif-coltitle-color, var(--ai-text-muted));
  --ai-coltitle-font: var(--aif-coltitle-font, 600 var(--aib-size-eyebrow, 12px)/1.4 inherit);

  position: relative;
  width: 100%;
  background-color: var(--ai-bg);
  color: var(--ai-text);
  font-family: var(--aib-font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.ai-footer *,
.ai-footer *::before,
.ai-footer *::after { box-sizing: border-box; }

.ai-footer ul,
.ai-footer ol { list-style: none; margin: 0; padding: 0; }
.ai-footer a { text-decoration: none; color: inherit; }
.ai-footer button { font-family: inherit; }
.ai-footer h4,
.ai-footer h5 { margin: 0; font-weight: 500; margin-bottom: 15px; }
.ai-footer p { margin: 0; }
.ai-footer hr { border: none; border-top: 1px solid var(--ai-border); margin: 0; }

/* ---------- Layout basics ---------- */
.ai-footer__container {
  width: 100%;
  max-width: var(--aib-container, 1240px);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.ai-footer__inner { padding-top: 64px; padding-bottom: 40px; }
.ai-footer__inner > * + * { margin-top: 0; }

.ai-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--aif-logo-family, var(--aib-font-heading, inherit));
  font-weight: var(--aif-logo-weight, 800);
  font-size: var(--aif-logo-size, 22px);
  text-transform: var(--aif-logo-transform, none);
  letter-spacing: var(--aif-logo-spacing, -0.01em);
  color: var(--ai-logo);
  transition: color var(--ai-transition);
}
.ai-footer__brand:hover { color: var(--ai-cta); }
.ai-footer__logo-img { max-height: 40px; width: auto; display: block; }
.ai-footer__logo-text { display: inline-block; }
.ai-footer__brand--text .ai-footer__logo-img { display: none; }
/* Có ảnh thì chỉ hiện logo (ẩn text) — giống header. */
.ai-footer__brand:not(.ai-footer__brand--text) .ai-footer__logo-text { display: none; }
.ai-footer__brand--lg { font-size: 32px; letter-spacing: -0.02em; }
.ai-footer__brand--center { font-size: 26px; }

/* ---------- Text blocks ---------- */
.ai-footer__about {
  color: var(--ai-text-muted);
  max-width: 360px;
  margin-top: 12px;
  font-size: 14px;
}
.ai-footer__slogan {
  color: var(--ai-text-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 6px;
}
.ai-footer__contact { margin-top: 20px; }
.ai-footer__contact-line {
  color: var(--ai-text-muted);
  font-size: 13.5px;
  margin-top: 4px;
}
.ai-footer__contact-line a {
  color: var(--ai-text);
  transition: color var(--ai-transition);
}
.ai-footer__contact-line a:hover { color: var(--ai-cta); }

/* ---------- Columns ---------- */
.ai-footer__col-title {
  font: var(--ai-coltitle-font);
  text-transform: var(--ai-coltitle-transform);
  letter-spacing: var(--ai-coltitle-tracking);
  margin-bottom: 14px;
  color: var(--ai-coltitle-color);
}
.ai-footer__link-list li + li { margin-top: 8px; }
.ai-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ai-link);
  font-size: 14px;
  transition: color var(--ai-transition), transform var(--ai-transition);
}
.ai-footer__link:hover { color: var(--ai-link-hover); }
.ai-footer__link-icon { opacity: 0.7; flex-shrink: 0; }

/* Numbered links (preset 1) */
.ai-footer__link-list--numbered .ai-footer__link {
  font-size: 15px;
  color: var(--ai-text);
  font-weight: 500;
}
.ai-footer__link-list--numbered li + li { margin-top: 12px; }
.ai-footer__num {
  color: var(--ai-text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ---------- Socials ---------- */
.ai-footer__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.ai-footer__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--ai-text-muted);
  border-radius: var(--ai-radius);
  transition: color var(--ai-transition), background-color var(--ai-transition), transform var(--ai-transition);
}
.ai-footer__social:hover {
  color: var(--ai-link-hover);
  background-color: var(--ai-bg-alt);
  transform: translateY(-1px);
}
.ai-footer__socials--round .ai-footer__social {
  border-radius: 999px;
  width: 40px;
  height: 40px;
}

/* ---------- Legal + Copyright ---------- */
.ai-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.ai-footer__legal-link {
  font-size: 12.5px;
  color: var(--ai-link);
  transition: color var(--ai-transition);
}
.ai-footer__legal-link:hover { color: var(--ai-link-hover); }
.ai-footer__copyright {
  font-size: 12.5px;
  color: var(--ai-text-muted);
}
.ai-footer__copyright--center { text-align: center; }

/* ---------- Bottom rows ---------- */
.ai-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--ai-border);
}
.ai-footer__bottom--p3 { justify-content: space-between; }

/* ============================================================
   Preset 1 — Editorial 4-col numbered
   ============================================================ */
.ai-footer__inner--p1 {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: var(--ai-gap);
  padding-bottom: 48px;
}
.ai-footer__inner--p1 .ai-footer__brand-col { grid-column: 1; }
.ai-footer__inner--p1 .ai-footer__menu-col > * + * { margin-top: 28px; }
.ai-footer__inner--p1 .ai-footer__socials { margin-top: 24px; }

/* ============================================================
   Preset 2 — Feature band + wordmark + 3 cols
   ============================================================ */
.ai-footer__features {
  background-color: var(--ai-bg-alt);
  border-top: 1px solid var(--ai-border);
  border-bottom: 1px solid var(--ai-border);
  padding: 36px 0;
}
.ai-footer__features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.ai-footer__feature { text-align: center; }
.ai-footer__feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--ai-primary);
  margin-bottom: 12px;
}
.ai-footer__feature-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ai-text);
  margin-bottom: 6px;
}
.ai-footer__feature-desc {
  font-size: 13px;
  color: var(--ai-text-muted);
  max-width: 260px;
  margin: 0 auto !important;
}
.ai-footer__main { padding: 56px 0 40px; }
.ai-footer__inner--p2 {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--ai-gap);
  padding: 0;
}

/* ============================================================
   Preset 3 — Two-row (Chobani-like)
   ============================================================ */
.ai-footer__inner--p3 { padding-top: 56px; padding-bottom: 32px; }
.ai-footer__inner--p3 .ai-footer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--ai-border);
}
.ai-footer__inner--p3 .ai-footer__top .ai-footer__newsletter {
  margin-top: 0;
  flex: 0 1 460px;
}
.ai-footer__inner--p3 .ai-footer__mid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ai-gap);
  padding: 32px 0;
}
.ai-footer__social-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-bottom: 1px solid var(--ai-border);
}
.ai-footer__social-row--center { justify-content: center; border-bottom: none; }
.ai-footer__check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  color: var(--ai-text-muted);
  font-size: 13px;
  max-width: 380px;
}
.ai-footer__check-input { position: absolute; opacity: 0; pointer-events: none; }
.ai-footer__check-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--ai-border);
  border-radius: 4px;
  position: relative;
  transition: border-color var(--ai-transition), background-color var(--ai-transition);
}
.ai-footer__check-input:checked + .ai-footer__check-box {
  background-color: var(--ai-primary);
  border-color: var(--ai-primary);
}
.ai-footer__check-input:checked + .ai-footer__check-box::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--ai-btn-text);
  clip-path: polygon(14% 50%, 0 64%, 40% 100%, 100% 22%, 86% 10%, 38% 74%);
}

/* ============================================================
   Preset 4 — Centered (STUDIO-like)
   ============================================================ */
.ai-footer__inner--p4 {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 64px;
  padding-bottom: 48px;
  gap: 28px;
}
.ai-footer__inner--p4 .ai-footer__brand { font-size: 26px; }
.ai-footer__categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 26px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ai-text-muted);
}
.ai-footer__categories li { display: inline-flex; align-items: center; gap: 8px; }
.ai-footer__cat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ai-primary);
  flex-shrink: 0;
}
.ai-footer__cat-link {
  color: inherit;
  transition: color var(--ai-transition);
  font-weight: 600;
}
.ai-footer__cat-link:hover { color: var(--ai-link-hover); }
.ai-footer__inner--p4 .ai-footer__divider { width: 100%; max-width: 720px; }
.ai-footer__center-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
}
.ai-footer__center-link {
  font-size: 14px;
  color: var(--ai-link);
  transition: color var(--ai-transition);
}
.ai-footer__center-link:hover { color: var(--ai-link-hover); }
.ai-footer__legal-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ai-text-muted);
}
.ai-footer__legal-sep { opacity: 0.4; }

/* ============================================================
   Preset 5 — Classic 5-col (Webly-like)
   ============================================================ */
.ai-footer__inner--p5 { padding-top: 56px; padding-bottom: 40px; }
.ai-footer__inner--p5 .ai-footer__top {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: var(--ai-gap);
  padding-bottom: 36px;
}
.ai-footer__inner--p5 .ai-footer__divider { margin: 24px 0; }
.ai-footer__inner--p5 .ai-footer__copyright {
  text-align: center;
  margin-top: 16px;
}

/* ============================================================
   Responsive — mobile < 900px
   ============================================================ */
@media (max-width: 899.98px) {
  .ai-footer__inner { padding-top: 44px; padding-bottom: 32px; }

  .ai-footer__inner--p1,
  .ai-footer__inner--p2,
  .ai-footer__inner--p5 .ai-footer__top {
    grid-template-columns: 1fr 1fr;
  }
  .ai-footer__inner--p1 .ai-footer__brand-col,
  .ai-footer__inner--p2 .ai-footer__brand-col,
  .ai-footer__inner--p5 .ai-footer__brand-col {
    grid-column: 1 / -1;
  }
  .ai-footer__features-grid { grid-template-columns: 1fr; gap: 24px; }

  .ai-footer__inner--p3 .ai-footer__top { flex-direction: column; align-items: stretch; }
  .ai-footer__inner--p3 .ai-footer__mid { grid-template-columns: 1fr; }
}

@media (max-width: 599.98px) {
  .ai-footer__inner--p1,
  .ai-footer__inner--p2,
  .ai-footer__inner--p5 .ai-footer__top {
    grid-template-columns: 1fr;
  }
  .ai-footer__inner--p1 .ai-footer__brand-col,
  .ai-footer__inner--p2 .ai-footer__brand-col,
  .ai-footer__inner--p5 .ai-footer__brand-col {
    grid-column: auto;
  }
  .ai-footer__bottom { flex-direction: column; align-items: flex-start; }
  .ai-footer__newsletter-form { flex-direction: column; }
  .ai-footer__newsletter-btn { justify-content: center; }
  .ai-footer__center-nav { gap: 18px; }
}