/* =====================================================
   MEI BEDDING — header-footer.css
   Header, megamenu, hero slider (listing), mobile primary nav, sale strip, breadcrumb, drawer, footer.
   Extracted from hifi-v2.css sections 7, 7b, 7c, 8, 9, 16, 18.
   ===================================================== */

/* ---------- 7. Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
  transition: box-shadow .3s ease, border-color .3s ease;
  will-change: transform;
}
/* Scroll past 10px: subtle shadow */
.header--scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border-bottom-color: transparent;
}
/* Slide-down animation khi cross threshold (giống v1) */
.header.slide-in { animation: header-slide-down 0.6s var(--ease); }
@keyframes header-slide-down {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-5);
}
.header-logo {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.header-logo img {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
}
@media (max-width: 1023px) {
  .header-logo img { height: 36px; }
}
.header-logo--drawer img { height: 48px; }
/* Reset parent-theme (Blocksy) ul defaults: padding-inline-start + margin-block-end. */
.header-nav,
.mobile-primary-nav,
.drawer-nav,
.footer .footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-inline-start: 0;
}
.header-nav { display: none; }
@media (min-width: 1024px) {
  .header-nav {
    display: flex;
    gap: var(--sp-5);
    justify-content: center;
  }
}
.header-nav > li { position: relative; }
.header-nav > li > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  transition: border-color var(--t-fast) var(--ease);
}
.header-nav > li > a:hover,
.header-nav > li:hover > a { border-bottom-color: var(--ink); }
.header-nav .has-sub > a::after {
  content: "▾";
  font-size: 9px;
  margin-left: 2px;
}
.header-nav .sub {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: none;
  padding: var(--sp-3) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all var(--t-base) var(--ease);
  z-index: 60;
}
.header-nav .has-sub:hover .sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header-nav .sub a {
  display: block;
  padding: 8px 20px;
  font-size: 13px;
  color: var(--ink-soft);
  transition: color var(--t-fast) var(--ease);
}
.header-nav .sub a:hover { color: var(--ink); background: var(--bone-soft); }

.header-icons {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.header-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
  position: relative;
}
.header-icons svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--ink);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
.header-burger svg { width: 22px; height: 16px; stroke: var(--ink); stroke-width: 1.5; fill: none; }
@media (min-width: 1024px) {
  .header-burger { display: none; }
}
@media (max-width: 1023px) {
  .header { height: var(--header-h-mobile); }
  .header-inner { grid-template-columns: 1fr auto 1fr; gap: var(--sp-3); }
  .header-logo { font-size: 18px; justify-self: center; justify-content: center; }
  .header-icons { gap: var(--sp-2); justify-self: end; }
  .header-icons a:nth-child(2) { display: none; } /* hide account icon on mobile (in drawer) */
  .header-inner > nav { display: none; } /* hide entire nav wrapper so icons don't wrap */
}

/* ---------- 7b. Hero slider (top of listing) ---------- */
.hero-slider {
  position: relative;
  overflow: hidden;
  background: var(--bone-soft);
  margin-bottom: var(--sp-5);
}
.hero-slider-track {
  position: relative;
  height: calc((100vh - var(--header-h)) * 0.65);
  min-height: 360px;
}
@media (max-width: 1023px) {
  .hero-slider-track { height: calc((100vh - var(--header-h-mobile)) * 0.52); min-height: 256px; }
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms var(--ease);
  pointer-events: none;
}
.hero-slide.active { opacity: 1; visibility: visible; pointer-events: auto; }
.hero-slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(247,243,236,0.92) 0%, rgba(247,243,236,0.6) 40%, rgba(247,243,236,0.1) 100%);
  z-index: 1;
}
@media (max-width: 768px) {
  .hero-slide::after {
    background: linear-gradient(to bottom, rgba(247,243,236,0.4) 0%, rgba(247,243,236,0.92) 100%);
  }
}
.hero-slide-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-6) var(--sp-7);
}
.hero-slide-content-inner {
  max-width: 560px;
}
@media (max-width: 768px) {
  .hero-slide-content {
    padding: var(--sp-5) var(--sp-4) var(--sp-7);
    justify-content: flex-end;
  }
  .hero-slide-content-inner { max-width: 100%; }
}
.hero-slide-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: var(--sp-3);
}
.hero-slide-heading {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: var(--sp-3);
}
@media (min-width: 768px) { .hero-slide-heading { font-size: 40px; } }
@media (min-width: 1024px) { .hero-slide-heading { font-size: 48px; } }
.hero-slide-sub {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: var(--sp-5);
  max-width: 480px;
}
.hero-slide-cta {
  align-self: flex-start;
}

.hero-indicators {
  position: absolute;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--sp-2);
  z-index: 5;
}
.hero-indicator {
  width: 28px;
  height: 3px;
  background: rgba(26, 26, 26, 0.3);
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.hero-indicator.active { background: var(--ink); }

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 18px;
  z-index: 5;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.hero-arrow:hover { background: var(--white); }
.hero-arrow-prev { left: 16px; }
.hero-arrow-next { right: 16px; }
@media (max-width: 768px) {
  .hero-arrow { display: none; }
}

/* ---------- 7c. Mobile primary nav (sticky strip, mobile only) ---------- */
.mobile-primary-nav {
  display: none;
  position: sticky;
  top: var(--header-h-mobile);
  z-index: 49;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
  will-change: transform;
}
.mobile-primary-nav.slide-in {
  animation: header-slide-down 0.6s var(--ease);
}
.mobile-primary-nav::-webkit-scrollbar { display: none; }
@media (max-width: 1023px) {
  .mobile-primary-nav { display: flex; }
}
.mobile-primary-nav a {
  flex-shrink: 0;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast) var(--ease);
}
.mobile-primary-nav a:hover { color: var(--ink); }
.mobile-primary-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 600;
}

/* ---------- 8. Sale banner strip ---------- */
.sale-strip {
  background: var(--ink);
  color: var(--white);
  padding: 10px 44px 10px var(--gutter);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-align: center;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 768px) {
  .sale-strip { font-size: 11px; padding: 8px 36px 8px var(--gutter); }
}
.sale-strip a { text-decoration: underline; }
.sale-strip-close {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  color: var(--white);
  opacity: 0.7;
  font-size: 18px;
  line-height: 1;
}

/* ---------- 9. Breadcrumb ---------- */
.breadcrumb {
  padding: var(--sp-4) 0;
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { margin: 0 8px; opacity: 0.5; }
.breadcrumb .current { color: var(--ink); }


/* ---------- 16. Drawer (mobile menu) ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-drawer);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease);
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(85vw, 360px);
  background: var(--white);
  z-index: calc(var(--z-drawer) + 1);
  transform: translateX(-100%);
  transition: transform var(--t-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.drawer-close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--ink);
}
.drawer-nav { padding: var(--sp-3) 0; flex: 1; }
.drawer-nav-item {
  border-bottom: 1px solid var(--bone-soft);
}
.drawer-nav-item > a, .drawer-nav-item > button.drawer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px var(--sp-5);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
}
.drawer-toggle::after {
  content: "▸";
  font-size: 10px;
  transition: transform var(--t-fast) var(--ease);
}
.drawer-nav-item.open .drawer-toggle::after { transform: rotate(90deg); }
.drawer-sub {
  display: none;
  background: var(--bone-soft);
}
.drawer-nav-item.open .drawer-sub { display: block; }
.drawer-sub a {
  display: block;
  padding: 10px var(--sp-5) 10px var(--sp-7);
  font-size: 13px;
  color: var(--ink-soft);
}
.drawer-sub a:hover { color: var(--ink); }
.drawer-footer {
  border-top: 1px solid var(--line);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.drawer-footer a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  transition: color var(--t-fast) var(--ease);
}
.drawer-footer a:hover { color: var(--ink); }
.drawer-footer a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}


/* ---------- 18. Footer ---------- */
.footer {
  background: var(--bone);
  padding: var(--sp-7) 0 var(--sp-5);
  margin-top: var(--sp-8);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.footer-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
}
@media (min-width: 768px) {
  .footer-cols { grid-template-columns: repeat(3, 1fr); gap: var(--sp-7); }
}
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--sp-3);
}
.footer-col ul li {
  margin-bottom: var(--sp-2);
  font-size: 13px;
  color: var(--ink-soft);
}
.footer-col ul li a { color: var(--ink-soft); transition: color var(--t-fast) var(--ease); }
.footer-col ul li a:hover { color: var(--ink); }
.footer-col--clickable {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: opacity var(--t-fast) var(--ease);
}
.footer-col--clickable:hover { opacity: 0.7; }
.footer-col--clickable h4 { color: var(--ink); }
.footer-about-text {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: var(--sp-3);
}
.footer-about-link {
  font-size: 13px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-col--clickable:hover .footer-about-link { color: var(--sale); }
.footer-contact {
  list-style: none;
  padding: 0;
}
.footer-contact li {
  margin-bottom: var(--sp-2);
  font-size: 13px;
  color: var(--ink-soft);
}
.footer-contact li a { color: var(--ink-soft); }
.footer-contact li a:hover { color: var(--ink); }
.footer-social {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--white);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.social-btn--ig,
.social-btn--instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.social-btn--fb,
.social-btn--facebook {
  background: #1877f2;
}
.social-btn--zalo {
  background: #0068ff;
}
.social-btn--tiktok { background: #000000; }
.social-btn--youtube { background: #ff0000; }
.social-btn--threads { background: #000000; }
.social-btn--twitter { background: #000000; }
.social-btn--linkedin { background: #0a66c2; }
.social-btn--pinterest { background: #e60023; }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: var(--sp-4);
  margin-top: var(--sp-6);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: var(--sp-3);
}

