/*
 * site-footer.css — Hybrid Mirror (variant 1)
 * Mirrors header chrome: navy utility strip + white main + ice legal bar.
 * Brand tokens: #002f66 / #0068b7 / #f4f9ff / Montserrat.
 * Page width overrides kept for content alignment (footer-*).
 */

.bd-footer {
  --ft-navy: #002f66;
  --ft-navy-2: #003a7a;
  --ft-blue: #0068b7;
  --ft-mid: #004f91;
  --ft-ice: #f4f9ff;
  --ft-mist: #dceaf7;
  --ft-ink: #1f2f3d;
  --ft-muted: #56657b;
  --ft-line: rgba(0, 47, 102, 0.12);

  /* Canonical shell fallback (AGENTS §3.2): 1248px, not legacy 1188px. */
  width: min(var(--footer-w, var(--storefront-content-max, 1248px)), 100%);
  margin: 0 auto;
  background: #ffffff;
  color: var(--ft-ink);
  font-family: var(--font-sans);
  box-sizing: border-box;
  border-top: 1px solid var(--ft-line);
}

.bd-footer *,
.bd-footer *::before,
.bd-footer *::after {
  box-sizing: border-box;
}

.bd-footer a {
  text-decoration: none;
  color: inherit;
}

/* ========== Utility strip (like header) ========== */
.bd-footer__utility {
  width: 100%;
  background-color: var(--ft-navy);
  background-image: linear-gradient(180deg, var(--ft-navy-2) 0%, var(--ft-navy) 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bd-footer__utility-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 10px 60px;
  min-height: 42px;
}

.bd-footer__utility-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  min-width: 0;
  justify-content: flex-start;
}

.bd-footer__utility-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 14px;
  margin-left: auto;
  min-width: 0;
}

.bd-footer__utility-phone {
  font-size: var(--text-small);
  font-weight: 600;
  color: #fff !important;
  white-space: nowrap;
}

.bd-footer__utility-phone:hover {
  opacity: 0.92;
  color: #fff !important;
}

.bd-footer__utility-hours {
  font-size: var(--text-caption);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

.bd-footer__utility-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff !important;
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.bd-footer__utility-cta:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff !important;
}

.bd-footer__socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bd-footer__social {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ft-navy);
  background: #fff;
  border: 1px solid var(--ft-mist);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.bd-footer__socials--utility .bd-footer__social {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.bd-footer__social:hover {
  color: var(--ft-blue);
  border-color: var(--ft-blue);
  transform: translateY(-1px);
}

.bd-footer__socials--utility .bd-footer__social:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
}

.bd-footer__social svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ========== Main grid ========== */
.bd-footer__inner {
  max-width: none;
  margin: 0;
  padding: 28px 60px 26px;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr 1.15fr;
  gap: 28px 24px;
  align-items: start;
  background: #fff;
}

.bd-footer__brand {
  padding-right: 16px;
  min-width: 0;
}

.bd-footer__logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  text-decoration: none;
}

.bd-footer__logo-img {
  display: block;
  width: 185px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.bd-footer__logo-text {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ft-navy);
}

.bd-footer__desc {
  max-width: 280px;
  margin: 0;
  font-size: var(--text-small);
  line-height: 1.55;
  color: var(--ft-muted);
}

.bd-footer__col {
  min-height: 0;
  padding-left: 0;
  border-left: 0;
}

.bd-footer__title {
  margin: 0 0 14px;
  font-size: var(--text-caption);
  line-height: 1.2;
  font-weight: var(--fw-title);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ft-navy);
}

.bd-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bd-footer__list li {
  margin-bottom: 9px;
}

.bd-footer__list a,
.bd-footer__contacts a {
  color: #174a9f;
  font-size: var(--text-small);
  line-height: 1.35;
  font-weight: 500;
  transition: color 0.15s ease;
}

.bd-footer__list a:hover,
.bd-footer__contacts a:hover {
  color: var(--ft-blue);
}

.bd-footer__list span {
  color: var(--ft-muted);
  font-size: var(--text-small);
}

.bd-footer__contacts p,
.bd-footer__contact-line {
  margin: 0 0 10px;
  font-size: var(--text-small);
  line-height: 1.5;
  color: var(--ft-muted);
}

.bd-footer__phone {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.bd-footer__phone-number {
  display: block;
  font-size: var(--text-xl);
  line-height: 1.15;
  font-weight: 700;
  color: var(--ft-navy) !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.bd-footer__phone-number:hover {
  color: var(--ft-blue) !important;
}

.bd-footer__phone-note {
  display: block;
  font-size: var(--text-caption);
  color: var(--ft-muted);
}

/* ========== Legal bar ========== */
.bd-footer__bar {
  border-top: 1px solid var(--ft-mist);
  background: var(--ft-ice);
}

.bd-footer__bar-inner {
  padding: 12px 60px 14px;
}

.bd-footer__copy {
  margin: 0;
  font-size: var(--text-caption);
  line-height: 1.4;
  color: var(--ft-muted);
}

/* =========================================================================
 * Page width overrides (content alignment) — keep stable for existing pages
 * ========================================================================= */

.footer-narrow {
  --footer-w: 1030px;
}

.footer-full .bd-footer {
  width: 100%;
}

.footer-full .bd-footer__utility-inner,
.footer-full .bd-footer__inner,
.footer-full .bd-footer__bar-inner {
  padding-inline: var(--x, clamp(20px, 4.75vw, 92px));
}

/* Match .about-company-page shell (PVC surface: 1248 + 32px side room). */
.footer-about .bd-footer {
  width: min(var(--storefront-content-max, 1248px), calc(100% - 32px));
  max-width: var(--storefront-content-max, 1248px);
  margin-inline: auto;
}
.footer-about .bd-footer__utility-inner,
.footer-about .bd-footer__inner,
.footer-about .bd-footer__bar-inner {
  max-width: none;
  margin-inline: 0;
  padding-inline: clamp(16px, 2.5vw, 32px);
}

/* Match /garage-doors/ .gd-shell (PVC surface: 1248 + 32px side room). */
.footer-garage .bd-footer {
  width: min(var(--storefront-content-max, 1248px), calc(100% - 32px));
  max-width: var(--storefront-content-max, 1248px);
  margin-inline: auto;
}
.footer-garage .bd-footer__utility-inner,
.footer-garage .bd-footer__inner,
.footer-garage .bd-footer__bar-inner {
  max-width: none;
  margin-inline: 0;
  padding-inline: clamp(16px, 2.5vw, 32px);
}

.footer-pvc-listing .bd-footer {
  width: min(var(--storefront-content-max, 1248px), calc(100% - 32px));
  max-width: var(--storefront-content-max, 1248px);
  margin-inline: auto;
}
.footer-pvc-listing .bd-footer__utility-inner,
.footer-pvc-listing .bd-footer__inner,
.footer-pvc-listing .bd-footer__bar-inner {
  max-width: none;
  margin-inline: 0;
  padding-inline: clamp(16px, 2.5vw, 32px);
}

/* Match /categories/ .catalog-main shell (PVC surface: 1248 + 32px side room). */
.footer-categories .bd-footer {
  width: min(var(--storefront-content-max, 1248px), calc(100% - 32px));
  max-width: var(--storefront-content-max, 1248px);
  margin-inline: auto;
}
.footer-categories .bd-footer__utility-inner,
.footer-categories .bd-footer__inner,
.footer-categories .bd-footer__bar-inner {
  max-width: none;
  margin-inline: 0;
  padding-inline: clamp(16px, 2.5vw, 32px);
}

/* Match .contacts-page shell (70vw / --storefront-content-max). */
.footer-contacts .bd-footer {
  width: min(var(--contacts-shell-width, 70vw), var(--contacts-shell-max, var(--storefront-content-max, 1248px)));
  margin-inline: auto;
}
.footer-contacts .bd-footer__utility-inner,
.footer-contacts .bd-footer__inner,
.footer-contacts .bd-footer__bar-inner {
  max-width: none;
  margin-inline: 0;
  padding-inline: var(--contacts-section-x, clamp(18px, 3vw, 48px));
}

.footer-install .bd-footer {
  width: min(1440px, 100%);
  margin-inline: auto;
}
.footer-install .bd-footer__utility-inner {
  padding-inline: var(--install-side-gutter, clamp(8px, 1.4vw, 20px));
}
.footer-install .bd-footer__inner {
  max-width: none;
  margin-inline: auto;
  padding: 28px var(--install-side-gutter, clamp(8px, 1.4vw, 20px)) 24px;
}
.footer-install .bd-footer__bar-inner {
  padding-inline: var(--install-side-gutter, clamp(8px, 1.4vw, 20px));
}

.footer-interior-doors .bd-footer {
  width: min(var(--id-footer-w, min(var(--storefront-content-max, 1248px), calc(100% - 32px))), 100%);
  margin-inline: auto;
}
.footer-interior-doors .bd-footer__utility-inner {
  padding-inline: var(--id-side-gutter, 32px);
}
.footer-interior-doors .bd-footer__inner {
  max-width: none;
  margin-inline: auto;
  padding: 28px var(--id-side-gutter, 32px) 24px;
}
.footer-interior-doors .bd-footer__bar-inner {
  padding-inline: var(--id-side-gutter, 32px);
}

.footer-entrance-doors .bd-footer {
  width: min(var(--footer-w, min(calc(100% - 164px), 1320px)), 100%);
  margin-inline: auto;
}

.footer-entrance-doors .bd-footer__utility-inner,
.footer-entrance-doors .bd-footer__inner,
.footer-entrance-doors .bd-footer__bar-inner {
  max-width: none;
  margin: 0;
  padding-inline: 0;
}

.footer-entrance-doors-listing .bd-footer {
  width: 100%;
}

.footer-entrance-doors-listing .bd-footer__utility-inner,
.footer-entrance-doors-listing .bd-footer__inner,
.footer-entrance-doors-listing .bd-footer__bar-inner {
  max-width: min(calc(100% - 80px), var(--storefront-content-max, 1248px));
  margin-inline: auto;
  padding-inline: 0;
}

@media (max-width: 1180px) {
  .footer-entrance-doors-listing .bd-footer__utility-inner,
  .footer-entrance-doors-listing .bd-footer__inner,
  .footer-entrance-doors-listing .bd-footer__bar-inner {
    max-width: min(calc(100% - 36px), 1040px);
  }
}

@media (max-width: 768px) {
  .footer-entrance-doors-listing .bd-footer__utility-inner,
  .footer-entrance-doors-listing .bd-footer__inner,
  .footer-entrance-doors-listing .bd-footer__bar-inner {
    max-width: calc(100% - 24px);
  }
}

.footer-entrance-doors-catalog .bd-footer {
  width: 100%;
}

.footer-entrance-doors-catalog .bd-footer__utility-inner,
.footer-entrance-doors-catalog .bd-footer__inner,
.footer-entrance-doors-catalog .bd-footer__bar-inner {
  max-width: min(1380px, calc(100% - 72px));
  margin-inline: auto;
  padding-inline: 0;
}

@media (max-width: 700px) {
  .footer-entrance-doors-catalog .bd-footer__utility-inner,
  .footer-entrance-doors-catalog .bd-footer__inner,
  .footer-entrance-doors-catalog .bd-footer__bar-inner {
    max-width: min(calc(100% - 30px), 1380px);
  }
}

.footer-our-works .bd-footer {
  width: 100%;
}

.footer-our-works .bd-footer__utility-inner,
.footer-our-works .bd-footer__inner,
.footer-our-works .bd-footer__bar-inner {
  max-width: 1448px;
  margin-inline: auto;
  padding-inline: var(--x, clamp(20px, 4.75vw, 92px));
}

body.metal-doors-apartment-page.footer-metal-apartment {
  --footer-w: var(--md-container);
}

body.metal-doors-apartment-page.footer-metal-apartment .bd-footer {
  width: min(var(--footer-w), 100%);
  margin: 0 auto;
}

body.metal-doors-apartment-page.footer-metal-apartment .bd-footer__utility-inner,
body.metal-doors-apartment-page.footer-metal-apartment .bd-footer__inner {
  max-width: none;
  margin: 0;
  padding-inline: 60px;
}

body.metal-doors-apartment-page.footer-metal-apartment .bd-footer__bar-inner {
  padding-inline: 60px;
}

body.metal-doors-apartment-category.footer-metal-apartment {
  --footer-w: var(--mdc-container);
}

body.metal-doors-apartment-category.footer-metal-apartment .bd-footer {
  width: min(var(--footer-w), 100%);
  margin: 0 auto;
}

body.metal-doors-apartment-category.footer-metal-apartment .bd-footer__utility-inner,
body.metal-doors-apartment-category.footer-metal-apartment .bd-footer__inner {
  max-width: none;
  margin: 0;
  padding-inline: 48px;
}

body.metal-doors-apartment-category.footer-metal-apartment .bd-footer__bar-inner {
  padding-inline: 48px;
}

body.footer-metal-apartment:not(.metal-doors-apartment-page):not(.metal-doors-apartment-category) .bd-footer {
  width: 100%;
}

body.footer-metal-apartment:not(.metal-doors-apartment-page):not(.metal-doors-apartment-category) .bd-footer__utility-inner,
body.footer-metal-apartment:not(.metal-doors-apartment-page):not(.metal-doors-apartment-category) .bd-footer__inner,
body.footer-metal-apartment:not(.metal-doors-apartment-page):not(.metal-doors-apartment-category) .bd-footer__bar-inner {
  max-width: 1383px;
  margin-inline: auto;
  padding-inline: var(--x, clamp(20px, 4.75vw, 92px));
}

.footer-bd-page .bd-footer {
  width: 100%;
}

.footer-bd-page .bd-footer__utility-inner,
.footer-bd-page .bd-footer__inner,
.footer-bd-page .bd-footer__bar-inner {
  max-width: var(--storefront-content-max, 1248px);
  margin-inline: auto;
  padding-inline: 0;
}

.footer-fire-doors {
  /* Match .fd-page PVC shell (AGENTS §3.2). */
  --footer-w: min(var(--storefront-content-max, 1248px), calc(100% - 32px));
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .bd-footer__utility-inner,
  .bd-footer__inner {
    padding-left: 36px;
    padding-right: 36px;
  }

  .bd-footer__bar-inner {
    padding-inline: 36px;
  }

  .bd-footer__inner {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 24px;
  }

  .footer-install .bd-footer__inner {
    padding: 28px var(--install-side-gutter, clamp(8px, 1.4vw, 20px));
  }

  .footer-interior-doors .bd-footer__inner {
    padding: 28px var(--id-side-gutter, 32px);
  }
}

@media (max-width: 900px) {
  .bd-footer__utility-inner {
    padding-inline: 24px;
    gap: 10px 14px;
  }

  .bd-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 24px 18px;
    padding: 26px 24px 24px;
  }

  .bd-footer__bar-inner {
    padding-inline: 24px;
  }

  .bd-footer__brand {
    grid-column: span 2;
    padding-right: 0;
  }

  .bd-footer__desc {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .bd-footer {
    width: 100%;
  }

  /* Utility: two clean rows — phone/hours left strip, CTA + socials right strip */
  .bd-footer__utility-inner {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-height: 0;
  }

  .bd-footer__utility-left {
    width: 100%;
    margin: 0;
    justify-content: space-between;
    align-items: center;
    gap: 8px 12px;
  }

  .bd-footer__utility-right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    align-items: center;
    gap: 10px 12px;
  }

  .bd-footer__utility-phone {
    font-size: var(--text-body);
  }

  .bd-footer__utility-hours {
    font-size: var(--text-caption);
    text-align: right;
  }

  .bd-footer__utility-cta {
    width: auto;
    min-width: 0;
    min-height: 36px;
    padding: 0 14px;
    font-size: var(--text-caption);
    flex: 0 1 auto;
  }

  .bd-footer__socials--utility {
    gap: 10px;
    flex-shrink: 0;
  }

  .bd-footer__socials--utility .bd-footer__social {
    width: 36px;
    height: 36px;
  }

  .bd-footer__socials--utility .bd-footer__social svg {
    width: 16px;
    height: 16px;
  }

  .bd-footer__inner {
    grid-template-columns: 1fr;
    padding: 22px 16px 20px;
    gap: 22px;
  }

  .bd-footer__bar-inner {
    padding: 12px 16px 14px;
  }

  .footer-install .bd-footer__inner {
    padding: 22px var(--install-side-gutter, 10px);
  }

  .footer-interior-doors .bd-footer__inner {
    padding: 22px var(--id-side-gutter, 14px);
  }

  /*
   * Mobile-only: brand/logo last in the footer grid and centered.
   * Desktop/tablet keep DOM order (logo first). Grid `order` is visual only.
   */
  .bd-footer__brand {
    grid-column: auto;
    order: 99;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-right: 0;
    width: 100%;
  }

  .bd-footer__logo {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .bd-footer__logo-img {
    width: 150px;
    max-height: 40px;
    margin-inline: auto;
  }

  .bd-footer__desc {
    max-width: none;
    font-size: var(--text-small);
    text-align: center;
    margin-inline: auto;
  }

  .bd-footer__title {
    margin-bottom: 10px;
  }

  .bd-footer__list li {
    margin-bottom: 8px;
  }

  .bd-footer__list a,
  .bd-footer__contacts a {
    display: inline-block;
    padding: 3px 0;
    min-height: 28px;
  }

  .bd-footer__phone-number {
    font-size: var(--text-lg);
    white-space: normal;
  }

  .bd-footer__copy {
    font-size: var(--text-caption);
  }
}
