/* ──────────────────────────────────────────
   HEADER / NAV
────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,12,16,.85);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

nav {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 66px;
}

.logo {
  font-family: var(--ff-head);
  font-size: 1.9rem;
  letter-spacing: .08em;
  color: var(--accent);
  flex-shrink: 0;
}

.logo span {
  color: var(--text);
}

nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin-left: auto;
}

nav ul a {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s;
}

nav ul a:hover,
nav ul a.active {
  color: var(--accent);
}

nav a.btn {
  max-width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 24px;
}

.nav-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--surface2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s;
  position: relative;
}

.nav-icon:hover {
  background: var(--surface);
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--text);
  fill: none;
  stroke-width: 1.8;
}

/* ──────────────────────────────────────────
   USER AVATAR BUTTON & DROPDOWN (desktop)
────────────────────────────────────────── */
.nav-user {
  position: relative;
  flex-shrink: 0;
}
 
/* The circular avatar trigger button */
.nav-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--surface2);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
  flex-shrink: 0;
}
 
.nav-avatar-btn:hover,
.nav-user.is-open .nav-avatar-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,255,71,.15);
}
 
.nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
 
/* Initials fallback (no Gravatar) */
.nav-avatar-initials {
  font-family: var(--ff-head);
  font-size: .85rem;
  color: #000;
  background: linear-gradient(135deg, var(--accent3), #0a7f6e);
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  letter-spacing: .04em;
}
 
/* Dropdown panel */
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 220;
 
  /* hidden by default */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  pointer-events: none;
}
 
.nav-user.is-open .nav-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
 
/* Identity row at the top of the dropdown */
.nud-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
}
 
.nud-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent3), #0a7f6e);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--ff-head);
  font-size: 1rem;
  color: #000;
  overflow: hidden;
}
 
.nud-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
 
.nud-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
 
.nud-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
.nud-email {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
.nud-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}
 
/* Dropdown menu items */
.nud-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s, background .2s;
}
 
.nud-item:hover {
  color: var(--text);
  background: var(--surface2);
}
 
.nud-item svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}
 
.nud-item-logout { color: var(--accent2); }
.nud-item-logout:hover { color: var(--accent2); background: rgba(255,92,53,.06); }
 


*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #0a0c10;
  --surface:   #12151c;
  --surface2:  #1a1e28;
  --border:    rgba(255,255,255,.07);
  --accent:    #e8ff47;
  --accent2:   #ff5c35;
  --accent3:   #29d6b5;
  --text:      #e8eaf0;
  --muted:     #7a8099;
  --ff-head:   'Bebas Neue Vietnamese', 'Bebas Neue', sans-serif;
  --ff-body:   'Nunito', sans-serif;
  --radius:    14px;
  --shadow:    0 8px 40px rgba(0,0,0,.55);
}

/* ── Cart badge ── */
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent2);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: grid;
  place-items: center;
  pointer-events: none;
  line-height: 1;
}
 
/* hide badge when count is 0 */
.cart-badge:empty,
.cart-badge[data-count="0"] {
  display: none;
}
 
/* ──────────────────────────────────────────
   SEARCH BOX (slides below header)
────────────────────────────────────────── */
.nav-search-box {
  overflow: hidden;
  transition: display .3s ease, border-color .3s;
  border-bottom: 1px solid transparent;
  background: var(--surface);
	padding: 10px 20px;
    display: none;
	/* transform: translateY(-100%);
  transition-property: transform, display; 
  transition-duration: 0.3s; */
}
 
.nav-search-box.active {
  border-bottom-color: var(--border);
 	display: block; 
  /* transform: translateY(0); */
}
 
.nav-search-input::placeholder {
  color: var(--muted);
}

.search-container {
    position: relative;
	display: flex;
	align-items: center;
	border: 1px solid #ccc;
	border-radius: 25px;
	padding: 5px 10px;
  }

  .nav-search-box input[type="search"] {
    width: 100%;
    padding: 10px 40px 10px 15px;
    outline: none;
	  border: none;
    font-size: 16px;
    transition: 0.3s;
    background: none;
    color: var(--text);
  }

  .nav-search-box input:focus {
    border-color: #007BFF;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
  }

  .nav-search-box .icon {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #888;
    cursor: pointer;
	  border: none;
	  background: none;
  }

  .nav-search-box .icon:hover {
    color: #007BFF;
  }

/* ──────────────────────────────────────────
   HAMBURGER BUTTON
────────────────────────────────────────── */
.hamburger {
  display: none;           /* shown only at breakpoint below */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background-color: var(--surface2);
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background .2s;
}
 
.hamburger:hover {
  background: var(--surface);
}
 
.hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .3s ease, opacity .2s ease, width .3s ease;
  transform-origin: center;
}
 
/* Animate bars → X when open */
.hamburger.is-open .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.is-open .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ──────────────────────────────────────────
   SEARCH BOX
────────────────────────────────────────── */

.search-box {
    
  }

.search-box.active {
	
}

  
 
/* ──────────────────────────────────────────
   MOBILE DRAWER
────────────────────────────────────────── */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100dvh;          /* full viewport height */
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
 
  /* slide-in transition */
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
  visibility: hidden;
}
 
.mobile-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}
 
/* ── Drawer header ── */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 66px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
 
.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface2);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s;
}
.drawer-close:hover { background: var(--surface); }
.drawer-close svg {
  width: 16px;
  height: 16px;
  stroke: var(--text);
  fill: none;
  stroke-width: 2;
}
 
/* ── Drawer search ── */
.drawer-search {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
 
.drawer-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  transition: border-color .2s;
}
.drawer-search-inner:focus-within {
  border-color: var(--accent3);
}
 
.drawer-search-inner svg {
  width: 15px;
  height: 15px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}
 
.drawer-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--ff-body);
  font-size: 14px;
  color: var(--text);
  min-width: 0;
}
.drawer-search-input::placeholder { color: var(--muted); }

/* ── Drawer navigation menu ── */
.drawer-menu {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  flex: 1;
}
 
.drawer-menu li {
  border-bottom: 1px solid var(--border);
}
 
.drawer-menu li:last-child {
  border-bottom: none;
}
 
.drawer-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s, background .2s;
}
 
.drawer-menu a:hover,
.drawer-menu .current-menu-item > a,
.drawer-menu .current-page-ancestor > a {
  color: var(--accent);
  background: rgba(232,255,71,.04);
}
 
/* Sub-menu in drawer */
.drawer-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  background: rgba(255,255,255,.02);
}
 
.drawer-menu ul li {
  border-top: 1px solid var(--border);
  border-bottom: none;
}
 
.drawer-menu ul a {
  padding-left: 36px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: none;
}
 
/* ── Drawer footer ── */
.drawer-footer {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
 
.drawer-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s, color .2s;
  position: relative;
}
.drawer-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.drawer-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}
 
.cart-badge-drawer {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  border-radius: 99px;
  background: var(--accent2);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

/* ──────────────────────────────────────────
   DRAWER USER ROW (mobile, logged in)
────────────────────────────────────────── */
.drawer-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s;
}
.drawer-user-row:hover { border-color: var(--accent3); }
 
.drawer-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent3), #0a7f6e);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--ff-head);
  font-size: 1rem;
  color: #000;
  overflow: hidden;
}
.drawer-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
 
.drawer-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
 
.drawer-user-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
.drawer-user-sub {
  font-size: 11px;
  color: var(--muted);
}
 
.drawer-action-logout {
  color: var(--accent2);
  border-color: rgba(255,92,53,.2);
}
.drawer-action-logout:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

/* ──────────────────────────────────────────
   OVERLAY (backdrop)
────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
 
.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ──────────────────────────────────────────
   RESPONSIVE BREAKPOINTS
────────────────────────────────────────── */
 
/* Tablet: hide login button but keep icons + hamburger */
@media (max-width: 986px) {
  /* Hide the desktop nav list */
  nav > .nav-menu {
    display: none;
  }
	
	.nav-icon.search {
		display: none;
	}
 
  /* Reveal the hamburger button */
  .hamburger {
    display: flex;
  }
 
  /* Tighten the right-side gap */
  .nav-actions {
    gap: 8px;
    margin-left: auto;
  }
 
  /* Keep search + cart icons visible, hide login btn */
  nav ul, 
  .nav-actions .btn {
    display: none;
  }
 
  /* Slightly smaller logo on very narrow screens */
  .logo {
    font-size: 1.6rem;
  }

/*   .drawer-overlay {
    display: none !important;
  } */
}

@media (max-width: 400px) {
  /* Hide search icon too on very small screens (it's inside the drawer) */
  .nav-search-toggle {
    display: none;
  }
}