/* ═══════════════════════════════════════════════════════════════════
   CHIC CHARMS — Global Header Responsive Styles
   Ensures the shared header (from cc-global-header.js) displays
   correctly on all pages, matching the Home Page header pixel-for-pixel.
   
   Desktop (>768px): Full navbar with logo, nav-links, nav-actions
   Mobile (<=768px): Hamburger + Logo + Search/Wishlist/Cart icons
   ═══════════════════════════════════════════════════════════════════ */

/* ── Base navbar (matches styles.css) ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  z-index: 100;
  background: rgba(250, 248, 245, 0.94);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid #EDE6DD;
  transition: box-shadow 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 2px 28px rgba(60, 40, 30, 0.07);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  min-width: 0;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.navbar .logo {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  color: #8e4559;
  text-decoration: none;
  letter-spacing: -0.01em;
  flex: 0 0 auto;
  min-width: 160px;
  z-index: 1;
  text-transform: none;
}

.navbar .logo span {
  color: inherit;
}

.navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.navbar .nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Plus Jakarta Sans', 'Jost', -apple-system, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4E4440;
  line-height: 1;
  transition: color 0.3s ease;
  position: relative;
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
}

.navbar .nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 1px;
  background: #B5657A;
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.navbar .nav-links a:hover {
  color: #1C1917;
}

.navbar .nav-links a:hover::after {
  transform: scaleX(1);
}

.navbar .nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 264px;
  max-width: 340px;
  min-height: 34px;
  overflow: hidden;
  z-index: 1;
}

/* ── Mobile-only elements: hidden by default on desktop ── */
.mobile-commerce-menu,
.mobile-commerce-actions {
  display: none;
}

/* ── Admin return banner ── */
.admin-return-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  background: #1C1917;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
}

.admin-return-banner a {
  color: #D4879C;
  text-decoration: underline;
}

body.admin-return-active .admin-return-banner {
  display: flex;
}

body.admin-return-active .navbar {
  top: var(--admin-return-banner-height, 36px);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet & Mobile (<= 900px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .navbar .nav-links {
    display: none;
  }

  .navbar .nav-actions {
    display: none;
  }

  .mobile-commerce-menu,
  .mobile-commerce-actions {
    display: inline-flex !important;
  }

  /* Hamburger button */
  .mobile-commerce-menu {
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(181, 101, 122, 0.15);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
  }

  .mobile-commerce-menu span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: #1C1917;
    border-radius: 1px;
    transition: all 0.3s ease;
  }

  /* Mobile action icons */
  .mobile-commerce-actions {
    gap: 8px;
    align-items: center;
  }

  .mobile-commerce-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(181, 101, 122, 0.15);
    border-radius: 8px;
    background: #fff;
    color: #534346;
    text-decoration: none;
    position: relative;
    transition: background 0.15s ease;
  }

  .mobile-commerce-icon:active {
    background: #FAF1F4;
  }

  .mobile-commerce-icon svg {
    width: 20px;
    height: 20px;
  }

  /* Cart badge */
  .mobile-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    background: #8e4559;
    color: #fff;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
  }

  .mobile-cart-count:not(:empty) {
    display: flex;
  }

  /* Wishlist badge */
  .wishlist-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 14px;
    height: 14px;
    border: 1.5px solid #fff8f7;
    border-radius: 50%;
    background: #8e4559;
    color: white;
    font-family: sans-serif;
    font-size: 8px;
    font-weight: 700;
    pointer-events: none;
  }

  /* Mobile nav drawer (when menu is open) */
  .navbar .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: rgba(250, 248, 245, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 18px 28px 28px;
    gap: 0;
    border-bottom: 1px solid #EDE6DD;
    box-shadow: 0 12px 40px rgba(60, 40, 30, 0.08);
    align-items: stretch;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    z-index: 99;
  }

  .navbar .nav-links.open a {
    font-size: 0.8rem;
    font-weight: 600;
    width: 100%;
    padding: 16px 0;
    border-bottom: 1px solid #EDE6DD;
    min-height: 52px;
    display: flex;
    align-items: center;
    color: #1C1917;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .navbar .nav-links.open a::after {
    display: none;
  }

  .navbar .nav-links.open a:last-child {
    border-bottom: none;
  }

  .navbar .nav-links.open a:hover {
    color: #B5657A;
  }

  /* Logo centered on mobile */
  .navbar .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    min-width: auto;
    font-size: 1.25rem;
  }
}

/* ══════════════════════════════════════════════════════════
   Small phones (<= 380px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .navbar .logo {
    font-size: 1.1rem;
  }

  .mobile-commerce-menu {
    width: 36px;
    height: 36px;
  }

  .mobile-commerce-icon {
    width: 34px;
    height: 34px;
  }

  .mobile-commerce-icon svg {
    width: 18px;
    height: 18px;
  }
}
