/* ==============================================
   HEADER.CSS — Site Header & Navigation
   Yến Sào Yến Duyên
   ============================================== */

/* ==============================================
   1. HEADER BASE
   ============================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  background: var(--gradient-brand);
  transition: height var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

/* Wood texture overlay */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='none'/%3E%3Cline x1='0' y1='0' x2='4' y2='4' stroke='%23ffffff' stroke-opacity='0.03' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Gold border bottom */
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--color-gold) 30%, var(--color-gold) 70%, transparent 100%);
  opacity: 0.4;
}

/* Scrolled state — shrink & deepen shadow */
.site-header.scrolled {
  height: calc(var(--header-height) - 16px);
  box-shadow: 0 4px 24px rgba(43, 36, 32, 0.4);
}

.site-header.scrolled::after {
  opacity: 0.6;
}

/* Compensate for fixed header */
body {
  padding-top: var(--header-height);
}


/* ==============================================
   2. HEADER INNER LAYOUT
   ============================================== */

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-24, 24px);
  min-width: 0;
}


/* ==============================================
   3. LOGO
   ============================================== */

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}

.logo:hover {
  opacity: 0.88;
}

.logo:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.logo-main {
  font-family: var(--font-accent);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--color-gold);
  text-transform: uppercase;
}

.logo-sub {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 230, 211, 0.65);
  margin-top: 3px;
}

/* Logo image */
.logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
  transition: filter var(--transition-fast), opacity var(--transition-fast);
}

.logo:hover .logo-img {
  filter: brightness(0) invert(1) sepia(1) saturate(3) hue-rotate(5deg);
  opacity: 0.9;
}

.site-header.scrolled .logo-img {
  height: 44px;
}

/* Footer logo image */
.logo-img--footer {
  height: 64px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Footer logo reuse */
.footer-logo .logo-main {
  font-size: var(--text-xl);
}

.footer-logo .logo-sub {
  color: rgba(245, 230, 211, 0.5);
}


/* ==============================================
   4. MAIN NAVIGATION
   ============================================== */

.main-nav {
  flex: 0 1 auto;
  display: flex;
  justify-content: flex-start;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: var(--space-8) var(--space-12, 12px);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(250, 246, 241, 0.85);
  text-decoration: none;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

/* Underline animation from center */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  right: 50%;
  height: 1px;
  background: var(--color-gold);
  transition: left var(--transition-base), right var(--transition-base);
}

.nav-link:hover {
  color: var(--color-gold);
}

.nav-link:hover::after,
.nav-link.active::after {
  left: var(--space-16);
  right: var(--space-16);
}

.nav-link.active {
  color: var(--color-gold);
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}


/* ==============================================
   5. HEADER ACTIONS (Hotline + Cart + Menu toggle)
   ============================================== */

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-14, 14px);
  flex-shrink: 0;
  margin-left: auto;
}

/* Hotline */
.header-hotline {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-gold);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
}

.header-hotline:hover {
  opacity: 0.8;
}

.header-hotline:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Cart button */
.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: rgba(250, 246, 241, 0.9);
  text-decoration: none;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.cart-btn:hover {
  color: var(--color-gold);
  background: rgba(201, 162, 75, 0.12);
}

.cart-btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform var(--transition-fast);
}

.cart-badge[data-count="0"] {
  display: none;
}

/* Menu toggle (hamburger) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: var(--space-8);
  transition: background var(--transition-fast);
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.menu-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}

.menu-icon span {
  display: block;
  height: 2px;
  background: var(--color-gold);
  border-radius: 2px;
  transition: all var(--transition-base);
  transform-origin: center;
}

/* Hamburger → X animation */
.menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ==============================================
   6. MOBILE NAVIGATION
   ============================================== */

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-brand);
  border-top: 1px solid rgba(201, 162, 75, 0.2);
  box-shadow: 0 8px 32px rgba(43, 36, 32, 0.4);
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow);
}

.mobile-nav[aria-hidden="false"] {
  max-height: 600px;
}

.mobile-nav-list {
  list-style: none;
  padding: var(--space-16) 0 var(--space-24);
}

.mobile-nav-link {
  display: block;
  padding: var(--space-16) var(--container-padding);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(250, 246, 241, 0.85);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--color-gold);
  border-left-color: var(--color-gold);
  background: rgba(201, 162, 75, 0.06);
  padding-left: calc(var(--container-padding) + var(--space-8));
}

.mobile-nav-link:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: -2px;
}

.mobile-nav-cta {
  padding: var(--space-16) var(--container-padding) 0;
  border-top: 1px solid rgba(201, 162, 75, 0.15);
  margin-top: var(--space-8);
}

.mobile-nav-cta .btn {
  width: 100%;
  justify-content: center;
}


/* ==============================================
   7. RESPONSIVE BREAKPOINTS
   ============================================== */

/* Tablet: hide hotline text, keep icon */
@media (max-width: 1180px) {
  .header-hotline span {
    display: none;
  }

  .header-hotline {
    width: 40px;
    height: 40px;
    justify-content: center;
    border-radius: 50%;
  }

  .header-hotline:hover {
    background: rgba(201, 162, 75, 0.12);
    opacity: 1;
  }

  .nav-link {
    padding: var(--space-8) var(--space-12);
    font-size: 0.75rem;
  }
}

/* Hide desktop nav, show hamburger */
@media (max-width: 900px) {
  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .mobile-nav {
    display: block;
  }

  body {
    padding-top: var(--header-height);
  }

  .site-header.scrolled {
    height: var(--header-height-mobile);
  }
}

/* Mobile: smaller header */
@media (max-width: 767px) {
  .site-header {
    height: var(--header-height-mobile);
  }

  body {
    padding-top: var(--header-height-mobile);
  }

  .logo-main {
    font-size: var(--text-lg);
  }

  .logo-sub {
    display: none;
  }

  .header-hotline {
    display: none;
  }

  .header-inner {
    gap: var(--space-16);
  }
}


/* ==============================================
   8. FOOTER STYLES (shares header color tokens)
   ============================================== */

.site-footer {
  background: var(--color-brand);
  color: var(--color-text-on-dark);
}

.footer-divider {
  height: 4px;
  background: linear-gradient(90deg,
    var(--color-brand) 0%,
    var(--color-gold) 25%,
    var(--color-primary) 50%,
    var(--color-gold) 75%,
    var(--color-brand) 100%
  );
}

.footer-main {
  padding: var(--space-80) 0 var(--space-64);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-48);
}

/* Brand column */
.footer-col--brand .footer-logo {
  display: inline-flex;
  flex-direction: column;
  margin-bottom: var(--space-20);
  text-decoration: none;
}

.footer-brand-desc {
  font-size: var(--text-sm);
  color: rgba(250, 246, 241, 0.65);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-24);
}

.footer-social {
  display: flex;
  gap: var(--space-12);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(201, 162, 75, 0.2);
  border-radius: 50%;
  color: rgba(250, 246, 241, 0.7);
  text-decoration: none;
  transition: all var(--transition-base);
}

.social-link:hover {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-brand);
  transform: translateY(-3px);
}

.social-link:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

/* Column titles */
.footer-col-title {
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-24);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(201, 162, 75, 0.2);
}

/* Footer links */
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.footer-links a {
  font-size: var(--text-sm);
  color: rgba(250, 246, 241, 0.65);
  text-decoration: none;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
  display: block;
}

.footer-links a:hover {
  color: var(--color-gold);
  padding-left: var(--space-8);
}

.footer-links a:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Contact list */
.footer-contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}

.footer-contact-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  font-size: var(--text-sm);
  color: rgba(250, 246, 241, 0.65);
}

.footer-contact-list svg {
  flex-shrink: 0;
  color: var(--color-gold);
  margin-top: 2px;
}

.footer-contact-list a {
  color: rgba(250, 246, 241, 0.65);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-contact-list a:hover {
  color: var(--color-gold);
}

.footer-hours {
  font-size: var(--text-sm);
  color: rgba(250, 246, 241, 0.5);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-hours strong {
  color: rgba(250, 246, 241, 0.75);
}

/* Footer bottom bar */
.footer-bottom {
  border-top: 1px solid rgba(201, 162, 75, 0.15);
  padding: var(--space-24) 0;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-24);
  flex-wrap: wrap;
}

.footer-copy {
  font-size: var(--text-sm);
  color: rgba(250, 246, 241, 0.45);
  line-height: 1;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  flex-wrap: wrap;
}

.footer-legal a {
  font-size: var(--text-sm);
  color: rgba(250, 246, 241, 0.5);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-legal a:hover {
  color: var(--color-gold);
}

.footer-legal span {
  color: rgba(250, 246, 241, 0.25);
  font-size: var(--text-xs);
}


/* ==============================================
   9. FOOTER RESPONSIVE
   ============================================== */

@media (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-40);
  }

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

  .footer-col--contact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-32);
  }

  .footer-col--brand {
    grid-column: auto;
  }

  .footer-col--contact {
    grid-column: auto;
  }

  .footer-main {
    padding: var(--space-48) 0 var(--space-40);
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-12);
  }
}
