/*
 * layout.css
 * Header, footer, and page shell layout.
 * Phase 2: Full styles added here.
 * Phase 1: Stub — enough to render without errors.
 */

/* ─── SITE HEADER ────────────────────────────────────────────────*/
#shopify-section-header {
  position: sticky;
  top: 0;
  z-index: var(--theme-z-sticky);
}

.site-header {
  background-color: var(--theme-color-header-bg);
  border-bottom: var(--theme-border-width) solid var(--theme-color-header-border);
}

/* Top row: logo, phone, search, cart */
.site-header__top {
  display: flex;
  align-items: center;
  height: var(--theme-header-height-desktop);
}

.site-header__left {
  flex: 1;
  display: flex;
  align-items: center;
}

.site-header__bottom.page-wrapper {
  display: flex;
  justify-content: center;
  background-color: var(--theme-color-nav-bg);
  padding: var(--theme-space-2xs) var(--theme-gutter-desktop);
  max-width: 1800px;
}

.site-header__bottom .site-header__nav-link {
  color: var(--theme-color-nav-text);
}

.site-header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header__logo-img {
  max-height: 48px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.site-header__logo-text {
  font-family: var(--theme-font-heading);
  font-size: var(--theme-text-xl);
  font-weight: var(--theme-weight-bold);
  color: var(--theme-color-white);
  letter-spacing: var(--theme-tracking-wide);
  text-transform: uppercase;
}

.site-header__nav {
  display: flex;
  justify-content: center;
  width: 100%;
}

.site-header__nav-list {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  width: 100%;
}

.site-header__nav-link {
  display: flex;
  align-items: center;
  gap: var(--theme-space-3xs);
  padding: var(--theme-space-2xs) var(--theme-space-xs);
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-base);
  font-weight: var(--theme-weight-semibold);
  letter-spacing: var(--theme-tracking-wide);
  text-transform: uppercase;
  color: var(--theme-color-header-text);
  text-decoration: none;
  border-radius: var(--theme-radius-md);
  transition: color var(--theme-duration-fast) var(--theme-ease-out);
  white-space: nowrap;
}

.site-header__nav-link:hover,
.site-header__nav-link--active {
  color: var(--theme-color-nav-hover);
  text-decoration: none;
}

.site-header__nav-item:hover > .site-header__nav-link,
.site-header__nav-item--open > .site-header__nav-link {
  text-decoration: underline;
  text-underline-offset: var(--theme-space-3xs);
}

/* Nav item — static so mega menu positions relative to header */
.site-header__nav-item {
  position: static;
}

/* ─── MEGA MENU ─────────────────────────────────────────────────*/
.mega-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background-color: var(--theme-color-white);
  border-top: var(--theme-border-width) solid var(--theme-color-border);
  box-shadow: var(--theme-shadow-md);
  z-index: var(--theme-z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity var(--theme-duration-base) var(--theme-ease-out),
    transform var(--theme-duration-base) var(--theme-ease-out),
    visibility var(--theme-duration-base);
}

.mega-menu--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu__inner {
  padding: var(--theme-space-lg) var(--theme-gutter-desktop);
}

.mega-menu__content {
  display: flex;
  gap: var(--theme-space-xl);
}

/* ── Link columns (left side) ── */
.mega-menu__columns {
  display: flex;
  gap: var(--theme-space-xl);
  flex-shrink: 0;
}

.mega-menu__column {
  min-width: 170px;
}


.mega-menu__heading {
  display: block;
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-md);
  font-weight: var(--theme-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--theme-tracking-widest);
  color: var(--theme-color-text-primary);
  margin-bottom: var(--theme-space-sm);
}

.mega-menu__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mega-menu__link {
  display: block;
  font-family: var(--theme-font-body);
  font-size: var(--theme-text-base);
  font-weight: var(--theme-weight-medium);
  color: var(--theme-color-text-primary);
  text-decoration: none;
  padding: var(--theme-space-3xs) 0;
  transition: color var(--theme-duration-fast) var(--theme-ease-out);
}

.mega-menu__link:hover {
  color: var(--theme-color-brand-gold);
  text-decoration: underline;
}

.mega-menu__link--standalone {
  font-weight: var(--theme-weight-bold);
  color: var(--theme-color-brand-gold);
  padding: var(--theme-space-3xs) 0;
  margin-top: var(--theme-space-2xs);
  text-decoration: underline;
}

.mega-menu__link--standalone:hover {
  color: var(--theme-color-brand-gold-dark);
}

/* ── Product cards (right side — "Best Of") ── */
.mega-menu__products {
  flex: 1;
  min-width: 0;
}

.mega-menu__products-heading {
  display: block;
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-md);
  font-weight: var(--theme-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--theme-tracking-widest);
  color: var(--theme-color-text-primary);
  margin-bottom: var(--theme-space-sm);
}

.mega-menu__products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--theme-space-sm);
}

.mega-menu__product-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--theme-space-3xs);
  transition: opacity var(--theme-duration-fast) var(--theme-ease-out);
}

.mega-menu__product-card:hover {
  opacity: 0.85;
}

.mega-menu__product-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--theme-radius-md);
}

.mega-menu__product-name {
  font-family: var(--theme-font-body);
  font-size: var(--theme-text-md);
  font-weight: var(--theme-weight-semibold);
  color: var(--theme-color-text-primary);
}

.mega-menu__product-price {
  font-family: var(--theme-font-body);
  font-size: var(--theme-text-md);
  font-weight: var(--theme-weight-bold);
  color: var(--theme-color-text-primary);
}

/* ── Clearance nav link (gold highlight) ── */
.site-header__nav-link--clearance {
  color: var(--theme-color-brand-gold);
}

.site-header__nav-link--clearance:hover {
  color: var(--theme-color-brand-gold-light);
}

/* Utility icons (right side) */
.site-header__utils {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--theme-space-2xs);
}

.site-header__phone {
  display: flex;
  align-items: center;
  gap: var(--theme-space-2xs);
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-sm);
  font-weight: var(--theme-weight-semibold);
  color: var(--theme-color-header-text);
  text-decoration: none;
  padding: 0 var(--theme-space-xs);
}

.site-header__phone:hover {
  color: var(--theme-color-brand-gold);
  text-decoration: none;
}

.site-header__util-btn {
  color: var(--theme-color-header-text);
  position: relative;
}

.site-header__util-btn:hover {
  color: var(--theme-color-brand-gold);
}

/* Cart count badge */
.site-header__cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background-color: var(--theme-color-brand-gold);
  color: var(--theme-color-white);
  font-family: var(--theme-font-ui);
  font-size: 11px;
  font-weight: var(--theme-weight-bold);
  line-height: 18px;
  text-align: center;
  border-radius: var(--theme-radius-full);
  pointer-events: none;
  transition: opacity var(--theme-duration-fast) var(--theme-ease-out);
}

.site-header__cart-count--hidden {
  opacity: 0;
}

.site-header__cart-count--pulse {
  animation: cart-badge-pulse var(--theme-duration-slow) var(--theme-ease-spring);
}

@keyframes cart-badge-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Hamburger: hidden on desktop */
.site-header__hamburger {
  display: none;
  color: var(--theme-color-header-text);
  margin-right: var(--theme-space-sm);
}

/* Overlay backdrop */
.site-header__overlay {
  position: fixed;
  inset: 0;
  background-color: var(--theme-color-bg-overlay);
  z-index: var(--theme-z-overlay);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--theme-duration-slow) var(--theme-ease-out),
    visibility var(--theme-duration-slow);
}

.site-header__overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* Mobile nav drawer */
.site-header__mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 90vw;
  max-width: 400px;
  height: 100vh;
  height: 100dvh;
  background-color: var(--theme-color-white);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: var(--theme-space-xl) var(--theme-space-md);
  z-index: var(--theme-z-modal);
  transform: translateX(-100%);
  transition: transform var(--theme-duration-slow) var(--theme-ease-out);
}

.site-header__mobile-nav--open {
  transform: translateX(0);
}

/* Close button */
.site-header__mobile-close {
  position: absolute;
  top: var(--theme-space-sm);
  right: var(--theme-space-sm);
  color: var(--theme-color-text-muted);
  z-index: var(--theme-z-raised);
}

.site-header__mobile-close:hover {
  color: var(--theme-color-text-primary);
}

/* Nav list */
.site-header__mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: var(--theme-space-lg);
}

/* Nav row: link + accordion toggle side by side */
.site-header__mobile-nav-row {
  display: flex;
  align-items: center;
  border-bottom: var(--theme-border-width) solid var(--theme-color-border);
}

.site-header__mobile-nav-link {
  display: block;
  flex: 1;
  padding: var(--theme-space-sm) 0;
  font-family: var(--theme-font-heading);
  font-size: var(--theme-text-md);
  font-weight: var(--theme-weight-semibold);
  color: var(--theme-color-text-primary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: var(--theme-tracking-wide);
}

.site-header__mobile-nav-link:hover {
  color: var(--theme-color-brand-gold);
}

/* Accordion toggle */
.site-header__mobile-nav-toggle {
  color: var(--theme-color-text-muted);
  padding: var(--theme-space-xs);
  transition: transform var(--theme-duration-fast) var(--theme-ease-out);
}

.site-header__mobile-nav-toggle[aria-expanded="true"] {
  transform: rotate(180deg);
}

.site-header__mobile-nav-toggle:hover {
  color: var(--theme-color-text-primary);
}

/* Sub-navigation (accordion) */
.site-header__mobile-subnav {
  padding: 0 0 var(--theme-space-sm) var(--theme-space-sm);
  overflow: hidden;
}

.site-header__mobile-subnav[hidden] {
  display: none;
}

.site-header__mobile-subnav-link {
  display: block;
  padding: var(--theme-space-2xs) 0;
  font-family: var(--theme-font-body);
  font-size: var(--theme-text-md);
  font-weight: var(--theme-weight-medium);
  color: var(--theme-color-text-secondary);
  text-decoration: none;
  transition: color var(--theme-duration-fast) var(--theme-ease-out);
}

.site-header__mobile-subnav-link:hover {
  color: var(--theme-color-brand-gold);
}

/* Sub-sub-navigation row (3rd level toggle) */
.site-header__mobile-subnav-row {
  display: flex;
  align-items: center;
}

.site-header__mobile-subnav-row > .site-header__mobile-subnav-link {
  flex: 1;
}

/* Sub-sub-navigation (3rd level accordion) */
.site-header__mobile-subsubnav {
  padding: 0 0 var(--theme-space-2xs) var(--theme-space-md);
  overflow: hidden;
}

.site-header__mobile-subsubnav[hidden] {
  display: none;
}

.site-header__mobile-subsubnav-link {
  display: block;
  padding: var(--theme-space-3xs) 0;
  font-family: var(--theme-font-body);
  font-size: var(--theme-text-sm);
  color: var(--theme-color-text-muted);
  text-decoration: none;
  transition: color var(--theme-duration-fast) var(--theme-ease-out);
}

.site-header__mobile-subsubnav-link:hover {
  color: var(--theme-color-brand-gold);
}

/* Scroll lock — defined in base.css (body.scroll-locked) */

/* Medium screens — tighten nav spacing (1200–1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .site-header__nav-list {
    gap: var(--theme-space-2xs);
  }

  .site-header__nav-link {
    font-size: var(--theme-text-base);
    padding: var(--theme-space-2xs) var(--theme-space-2xs);
    letter-spacing: var(--theme-tracking-normal);
  }

  .site-header__phone span {
    display: none;
  }

  .mega-menu__content {
    flex-wrap: wrap;
  }

  .mega-menu__inner {
    padding: var(--theme-space-md) var(--theme-gutter);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .site-header__mobile-nav,
  .site-header__overlay,
  .site-header__mobile-nav-toggle,
  .mega-menu {
    transition: none;
  }
}

/* Compact desktop (large tablets landscape + small laptops, 1024–1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
  .site-header__nav-list {
    gap: 0;
  }

  .site-header__nav-link {
    font-size: var(--theme-text-sm);
    padding: var(--theme-space-2xs) var(--theme-space-3xs);
    letter-spacing: var(--theme-tracking-normal);
  }

  .site-header__phone span {
    display: none;
  }

  .mega-menu__inner {
    padding: var(--theme-space-sm) var(--theme-gutter);
  }

  .mega-menu__content {
    flex-wrap: wrap;
    gap: var(--theme-space-md);
  }

  .mega-menu__columns {
    gap: var(--theme-space-md);
  }

  .mega-menu__column {
    min-width: 140px;
  }

  .mega-menu__products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Responsive */
@media (max-width: 1023px) {
  .site-header__nav {
    display: none;
  }

  .site-header__bottom.page-wrapper {
    display: none;
  }

  .site-header__left {
    display: none;
  }

  .site-header__phone {
    display: none;
  }

  .site-header__hamburger {
    display: flex;
  }

  .site-header__mobile-nav {
    display: block; /* visible but off-screen via transform */
  }

  .site-header__overlay {
    display: block;
  }

  .mega-menu {
    display: none;
  }
}

/* ─── SITE FOOTER ────────────────────────────────────────────────*/
/* ─── FOOTER ──────────────────────────────────────────────────────*/

.site-footer {
  background-color: var(--theme-color-footer-bg);
  color: var(--theme-color-footer-text);
  padding: var(--theme-space-3xl) 0 var(--theme-space-lg);
  margin-top: var(--theme-space-3xl);
}

/* ── Row 1: columns + social ── */

.site-footer__top {
  display: flex;
  gap: var(--theme-space-2xl);
}

.site-footer__columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--theme-space-2xl);
  flex: 1;
  min-width: 0;
}

/* ── Column headings ── */

.site-footer__col-heading {
  font-family: var(--theme-font-heading);
  font-size: var(--theme-text-md);
  font-weight: var(--theme-weight-semibold);
  color: var(--theme-color-footer-text);
  margin-bottom: var(--theme-space-lg);
}

/* ── Nav link lists ── */

.site-footer__nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--theme-space-xs);
}

.site-footer__nav-link {
  font-family: var(--theme-font-body);
  font-size: var(--theme-text-sm);
  color: var(--theme-color-footer-text-muted);
  text-decoration: none;
  transition: color var(--theme-duration-fast) var(--theme-ease-out);
}

.site-footer__nav-link:hover {
  color: var(--theme-color-footer-text);
  text-decoration: underline;
}

/* ── Social icons (right-aligned) ── */

.site-footer__social {
  flex-shrink: 0;
  text-align: right;
}

.site-footer__social .site-footer__col-heading {
  text-align: right;
}

.site-footer__social-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--theme-space-md);
  justify-content: flex-end;
}

.site-footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-color-footer-text-muted);
  text-decoration: none;
  transition: color var(--theme-duration-fast) var(--theme-ease-out);
}

.site-footer__social-link:hover {
  color: var(--theme-color-footer-text);
}

/* ── Newsletter row ── */

.site-footer__newsletter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--theme-space-2xl);
  margin-top: var(--theme-space-3xl);
}

.site-footer__newsletter-form {
  flex: 1;
  max-width: 480px;
}

.site-footer__newsletter-input-group {
  display: flex;
  border: var(--theme-border-width) solid var(--theme-color-footer-border);
  border-radius: var(--theme-radius-full);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.site-footer__newsletter-input {
  flex: 1;
  height: var(--theme-input-height);
  padding: 0 var(--theme-space-md);
  border: none;
  background: transparent;
  font-family: var(--theme-font-body);
  font-size: var(--theme-text-sm);
  color: var(--theme-color-footer-text);
  outline: none;
}

.site-footer__newsletter-input::placeholder {
  color: var(--theme-color-footer-text-muted);
}

.site-footer__newsletter-btn {
  border-radius: 0 var(--theme-radius-full) var(--theme-radius-full) 0;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: var(--theme-tracking-widest);
}

.site-footer__newsletter-success {
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-sm);
  color: var(--theme-color-success);
  margin-top: var(--theme-space-xs);
}

.site-footer__newsletter-error {
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-sm);
  color: var(--theme-color-error);
  margin-top: var(--theme-space-xs);
}

.site-footer__newsletter-logo {
  flex-shrink: 0;
}

.site-footer__logo-img {
  max-height: 64px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.5;
}

.site-footer__logo-text {
  font-family: var(--theme-font-heading);
  font-size: var(--theme-text-4xl);
  font-weight: var(--theme-weight-bold);
  color: var(--theme-color-footer-text);
  letter-spacing: var(--theme-tracking-wide);
  text-transform: uppercase;
  opacity: 0.4;
}

/* ── Bottom bar ── */

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--theme-space-md);
  margin-top: var(--theme-space-xl);
  padding-top: var(--theme-space-md);
  border-top: var(--theme-border-width) solid var(--theme-color-footer-border);
}

.site-footer__bottom-left {
  display: flex;
  align-items: center;
  gap: var(--theme-space-sm);
}

.site-footer__bottom-center {
  text-align: center;
}

.site-footer__bottom-right {
  flex-shrink: 0;
}

.site-footer__fsc-logo {
  width: 40px;
  height: auto;
  flex-shrink: 0;
}

.site-footer__round-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--theme-radius-full);
}

.site-footer__policy-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--theme-space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.site-footer__policy-links a {
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-xs);
  color: var(--theme-color-header-text-muted);
  text-decoration: underline;
  text-underline-offset: var(--theme-space-3xs);
  transition: color var(--theme-duration-fast) var(--theme-ease-out);
}

.site-footer__policy-links a:hover {
  color: var(--theme-color-white);
}

.site-footer__policy-links li + li::before {
  content: '|';
  color: var(--theme-color-header-text-muted);
  margin-right: var(--theme-space-sm);
}

.site-footer__copyright {
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-sm);
  color: var(--theme-color-header-text-muted);
  margin: 0;
}

.site-footer__credit {
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-sm);
  color: var(--theme-color-header-text-muted);
  margin: var(--theme-space-3xs) 0 0;
}

/* ── Footer responsive ── */

@media (max-width: 1023px) {
  .site-footer__top {
    flex-direction: column;
    gap: var(--theme-space-xl);
  }

  .site-footer__columns {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--theme-space-xl);
  }

  .site-footer__social {
    text-align: left;
  }

  .site-footer__social .site-footer__col-heading {
    text-align: left;
  }

  .site-footer__social-list {
    justify-content: flex-start;
  }

  .site-footer__newsletter {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--theme-space-lg);
  }

  .site-footer__newsletter-form {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 767px) {
  .site-footer__columns {
    grid-template-columns: 1fr;
    gap: var(--theme-space-lg);
  }
}
