/* ============================================================
   PrintCraft — Navigation Stylesheet (Boutique Custom Palette)
   assets/css/navbar.css
   ============================================================ */

/* ─────────────────────────────────────────────────────────────
   OUTER HEADER — warm parchment structural base
   ─────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);           /* #f8f5f0 warm cream */
  border-bottom: 1px solid var(--paper3);
}

/* ─────────────────────────────────────────────────────────────
   ROW 1 — Logo · Search · Account + Cart
   ─────────────────────────────────────────────────────────── */

.nav-top {
  height: var(--nav-top-h);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* ── Logo ── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: border-color 0.15s;
  text-decoration: none;
}
.nav-logo:hover   { border-color: var(--sand); }
.logo-mark        { color: #A78682; font-size: 1.1rem; } /* Rose Quartz icon accent */
.logo-text {
  font-family: 'Colder', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #8F2D56; /* Deep Fig brand text */
  letter-spacing: -0.01em;
}

/* ── Search — pill style, subtle, expands on focus ── */
.nav-search {
  margin-left: auto;         /* push to right of logo */
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--paper3);
  border-radius: 24px;
  padding: 0.28rem 0.35rem 0.28rem 1rem;
  background: white;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s, width 0.3s;
  width: 220px;
}
.nav-search:focus-within {
  border-color: #A78682; /* Rose Quartz focus ring */
  box-shadow: 0 0 0 3px rgba(167, 134, 130, 0.15);
  width: 320px;
}

.nav-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.82rem;
  background: transparent;
  color: #8F2D56; /* Deep Fig text */
  min-width: 0;
}
.nav-search-input::placeholder { color: var(--text3); }

.nav-search-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #8F2D56; /* Deep Fig button background */
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.nav-search-btn:hover { background: #6F5060; } /* Muted Mauve hover */

/* ── Right-side actions cluster ── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* ── Account button (guest) ── */
.nav-account-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  border: 1px solid transparent;
  color: #8F2D56; /* Deep Fig text */
  cursor: pointer;
  background: none;
  transition: border-color 0.15s, background 0.15s;
}
.nav-account-btn:hover         { border-color: var(--sand); background: var(--paper2); }
.nav-account-text              { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.nav-account-hello             { font-size: 0.68rem; color: var(--text3); }
.nav-account-label             { font-size: 0.8rem; font-weight: 700; color: #8F2D56; white-space: nowrap; }

/* Account button SVG icon — muted mauve */
.nav-account-btn svg { color: #6F5060; }

/* ── Cart button ── */
.nav-cart-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  border: 1px solid transparent;
  color: #8F2D56; /* Deep Fig text */
  cursor: pointer;
  position: relative;
  background: none;
  transition: border-color 0.15s, background 0.15s;
}
.nav-cart-btn:hover { border-color: var(--sand); background: var(--paper2); }

.nav-cart-count {
  position: absolute;
  top: 0;
  right: 24px;
  background: #A78682; /* Soft Rose Quartz badge count */
  color: #FFFFFF;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.nav-cart-count[data-count="0"] { display: none; }
.nav-cart-count.bump            { animation: navBump 0.3s ease; }
@keyframes navBump               { 50% { transform: scale(1.45); } }
.nav-cart-label                 { font-size: 0.8rem; font-weight: 700; color: #8F2D56; margin-top: 12px; }

/* Cart SVG icon */
.nav-cart-btn svg { color: #8F2D56; }

/* ── User chip (logged in) ── */
.user-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  border: 1px solid transparent;
  color: #8F2D56; /* Deep Fig text */
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.user-chip:hover         { border-color: var(--sand); background: var(--paper2); }
.user-chip:focus-visible { outline: 2px solid #A78682; outline-offset: 2px; }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8F2D56, #A78682); /* Deep Fig to Rose Quartz blend */
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Colder', serif;
  flex-shrink: 0;
}

.user-chip-text  { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip-hello { font-size: 0.68rem; color: var(--text3); }
.user-chip-label { font-size: 0.8rem; font-weight: 700; color: #8F2D56; white-space: nowrap; }

/* ── User dropdown ── */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--paper3);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 180px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 200;
}
.user-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #6F5060; /* Muted Mauve menu links */
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: background var(--transition);
}
.dropdown-item:hover         { background: var(--paper2); }
.dropdown-item.danger        { color: var(--terracotta); }
.dropdown-item.danger:hover  { background: #fef0ed; }

/* ─────────────────────────────────────────────────────────────
   ROW 2 — Hamburger + Category bar
   ─────────────────────────────────────────────────────────── */

.nav-bottom {
  background: transparent;          /* stays parchment background */
  border-top: 1px solid var(--paper3);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: var(--nav-bot-h);
  gap: 0;
}

/* Hamburger "All" button */
.nav-all-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.85rem 0.25rem 0;
  color: #6F5060; /* Muted Mauve base links */
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  border-right: 1px solid var(--paper3);
  border-radius: 0;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  background: none;
  margin-right: 0.75rem;
  transition: color 0.15s;
}
.nav-all-btn:hover         { color: #8F2D56; }
.nav-all-btn:focus-visible { outline: 2px solid #A78682; outline-offset: 2px; }

/* Scrollable pill strip */
.nav-cats {
  flex: 1;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-left: 0;
  gap: 0;
}
.nav-cats::-webkit-scrollbar { display: none; }

/* Category pills — underline style, not boxed */
.nav-cat {
  flex-shrink: 0;
  padding: 0 0.75rem;
  height: var(--nav-bot-h);
  line-height: var(--nav-bot-h);
  color: #6F5060 !important; /* Elegant Muted Mauve base link */
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  position: relative;
  transition: color 0.15s;
}
.nav-cat::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background: #989788 !important; /* Sage Olive underline marker */
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1);
}
.nav-cat:hover        { color: #8F2D56 !important; }
.nav-cat.active       { color: #989788 !important; font-weight: 700; } /* Selected paths match Sage Olive line */
.nav-cat.active::after{ transform: scaleX(1); }

/* ─────────────────────────────────────────────────────────────
   CURTAIN NAV (left-side drawer)
   ─────────────────────────────────────────────────────────── */

.curtain-overlay {
  position: fixed;
  inset: 0;
  background: rgba(81, 52, 77, 0.35); /* Shifting background scrim overlay to a soft Deep Fig tint */
  z-index: 300;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.curtain-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.curtain-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: white;
  z-index: 310;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 40px rgba(81, 52, 77, 0.12);
  overflow: hidden;
}
.curtain-nav.open { transform: translateX(0); }

/* Curtain header — deep structural ink bar */
.curtain-header {
  background: #8F2D56; /* Deep Fig drawer header row */
  color: white;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.curtain-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.curtain-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.curtain-close:hover         { background: rgba(255,255,255,0.2); }
.curtain-close:focus-visible { outline: 2px solid #A78682; outline-offset: 2px; }

.curtain-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

.curtain-section-title {
  background: #FFF1D0; /* Pale Pistachio structural tag blocks */
  color: #8F2D56;      /* Deep Fig tag headers */
  padding: 0.55rem 1.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--paper3);
}

.curtain-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #6F5060 !important; /* Muted Mauve items links */
  border: none;
  border-bottom: 1px solid var(--paper3);
  cursor: pointer;
  background: white;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
}
.curtain-item:hover               { background: var(--paper2); }
.curtain-item.curtain-top-item    { font-weight: 700; }
.curtain-item.curtain-danger      { color: var(--terracotta); }
.curtain-item.active {
  background: var(--paper2);
  color: #989788 !important; /* Sage Olive Active links */
  font-weight: 700;
}
.curtain-item.active svg { color: #989788; }

.curtain-signin {
  display: block;
  width: calc(100% - 2.5rem);
  margin: 0.75rem 1.25rem;
  padding: 0.65rem;
  background: #8F2D56; /* Deep Fig Sign-in panel background button */
  color: white;
  font-weight: 700;
  font-size: 0.88rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: background 0.15s;
}
.curtain-signin:hover { background: #6F5060; }

.curtain-divider {
  height: 8px;
  background: var(--paper2);
  border-top: 1px solid var(--paper3);
  border-bottom: 1px solid var(--paper3);
}
/* ── Subcategory bar ─────────────────────────────────────────── */
.nav-subcats {
  background: white;
  border-top: 1px solid var(--paper3);
  padding: 0.4rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-subcats::-webkit-scrollbar { display: none; }

.nav-subcats-inner {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  min-width: max-content;
}

.nav-subcat {
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--paper3);
  background: white;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-subcat:hover,
.nav-subcat.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE LAYOUT STABILIZATION BLOCK (UNTOUCHED STRUCTURE)
   ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav-top                          { padding: 0 1rem; gap: 0.6rem; }
  .nav-bottom                       { padding: 0 0.75rem; }
  .nav-search                       { width: 160px; }
  .nav-search:focus-within          { width: 220px; }
  .nav-account-text .nav-account-hello,
  .user-chip-hello                  { display: none; }
  .nav-account-label,
  .user-chip-label                  { font-size: 0.75rem; }
  .nav-cart-label                    { display: none; }
  .nav-cart-count                    { right: -2px; }
}

@media (max-width: 480px) {
  :root { --nav-top-h: 56px; }
  .logo-text       { font-size: 1rem; }
  .nav-search      { width: 120px; padding-left: 0.6rem; }
  .nav-search:focus-within { width: 180px; }
  .psearch-text    { display: none; }
}

/* ── Dropdown divider line ── */
.dropdown-divider {
  height: 1px;
  background: var(--paper3);
  margin: 0.25rem 0;
}

/* ── Dropdown anchor items ── */
a.dropdown-item {
  text-decoration: none;
  display: block;
}
a.dropdown-item:hover { background: var(--paper2); }

/* ─────────────────────────────────────────────────────────────
   ACCOUNT CHIP LAYOUT POSITIONING
   ─────────────────────────────────────────────────────────── */

.user-chip-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.4rem 0.3rem 0.55rem;
  border-radius: 6px 0 0 6px;
  border: 1px solid transparent;
  border-right: none;
  color: #8F2D56; /* Deep Fig */
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.user-chip-link:hover {
  border-color: var(--sand);
  background: var(--paper2);
}

/* Caret button — sits flush against the chip link */
.nav-signout-wrap {
  position: relative;
  display: flex;
}
.nav-caret-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.45rem;
  height: 100%;
  background: none;
  border: 1px solid transparent;
  border-left: 1px solid var(--paper3);
  border-radius: 0 6px 6px 0;
  color: #6F5060; /* Muted Mauve */
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.nav-caret-btn:hover {
  border-color: var(--sand);
  background: var(--paper2);
  color: #8F2D56;
}
.nav-caret-btn:focus-visible { outline: 2px solid #A78682; outline-offset: 2px; }

/* Sign-out dropdown */
.nav-signout-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--paper3);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 180px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 200;
}
.nav-signout-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ─────────────────────────────────────────────────────────────
   SLIDING INTERACTIVE MOBILE SEARCH PANEL BLOCK
   ─────────────────────────────────────────────────────────── */

/* Remove old pill search styles */
.nav-search { display: none !important; }

.nav-search-wrap {
  display: flex;
  align-items: center;
  margin-left: auto;        /* 🌟 Original Flexbox layouts anchor rule intact */
  position: relative;
}

/* The magnifier icon button */
.nav-search-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: none;
  color: #8F2D56; /* Deep Fig */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
  z-index: 2;
}
.nav-search-icon-btn:hover {
  border-color: var(--sand);
  background: var(--paper2);
}
.nav-search-icon-btn:focus-visible {
  outline: 2px solid #A78682;
  outline-offset: 2px;
}

/* The sliding panel */
.nav-search-panel {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: white;
  border: 1.5px solid var(--paper3);
  border-radius: 24px;
  padding: 0.28rem 0.4rem 0.28rem 1rem;
  width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: width 0.28s cubic-bezier(0.4,0,0.2,1),
              opacity 0.2s ease,
              border-color 0.2s;
  white-space: nowrap;
  z-index: 1;
}
.nav-search-panel.open {
  width: 280px;
  opacity: 1;
  pointer-events: auto;
  border-color: #A78682; /* Rose Quartz frame */
}
@media (max-width: 480px) {
  .nav-search-panel.open { width: 200px; }
}

.nav-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.88rem;
  background: transparent;
  color: #8F2D56;
  min-width: 0;
}
.nav-search-input::placeholder { color: var(--text3); }

.nav-search-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--paper2);
  color: var(--text2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-search-close:hover { background: var(--paper3); color: #8F2D56; }

/* ─────────────────────────────────────────────────────────────
   CURTAIN DRAWER LINKS
   ─────────────────────────────────────────────────────────── */
a.curtain-item {
  text-decoration: none;
  color: #8F2D56;
}
a.curtain-item:hover { background: var(--paper2); }

/* Curtain header user link */
a.curtain-user { color: white !important; }

/* ─────────────────────────────────────────────────────────────
   MOBILE VIEWPORTS RESPONSIVE ADJUSTMENTS
   ─────────────────────────────────────────────────────────── */

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {
  .nav-top {
    padding: 0 0.85rem;
    gap: 0.5rem;
  }
  .nav-bottom { padding: 0 0.75rem; }

  /* Hide labels identical to original version */
  .user-chip-text,
  .user-chip-hello,
  .user-chip-label,
  .nav-account-text,
  .nav-account-hello,
  .nav-account-label,
  .nav-cart-label           { display: none !important; }

  /* Tighten positions */
  .nav-cart-count           { right: -4px; top: -2px; }
  .user-chip-link           { padding: 0.25rem; gap: 0; border-radius: 50%; }
  .nav-caret-btn            { border-left: none; padding: 0 0.2rem; border-radius: 6px; }
  .nav-actions              { gap: 0.15rem; }
}

/* ── Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  :root { --nav-top-h: 52px; }
  .nav-top    { padding: 0 0.65rem; gap: 0.35rem; }
  .logo-text  { font-size: 0.95rem; }
  .nav-all-btn { padding-right: 0.5rem; margin-right: 0.4rem; font-size: 0.72rem; }
  .nav-cat     { font-size: 0.75rem; padding: 0 0.55rem; }
}

/* ─────────────────────────────────────────────────────────────
   MOBILE FIXED POSITION DROPDOWN SEARCH OVERRIDE BLOCK
   ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav-search-panel {
    position: fixed;
    top: var(--nav-top-h);
    left: 0;
    right: 0;
    width: 100% !important;
    max-width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 2px solid #A78682; /* Rose Quartz highlight */
    padding: 0.65rem 1rem;
    background: white;
    box-shadow: 0 4px 16px rgba(81, 52, 77, 0.1);
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 150;
    overflow: visible;
  }

  /* Closed state on mobile */
  .nav-search-panel:not(.open) {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
  }

  /* Open state on mobile */
  .nav-search-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    border-color: #A78682;
    width: 100% !important;
  }

  .nav-search-input {
    font-size: 1rem;
    flex: 1;
  }

  .nav-search-close {
    width: 32px;
    height: 32px;
  }

  /* Dim mobile mask overlay backdrops tint */
  .nav-search-panel.open::before {
    content: '';
    position: fixed;
    inset: 0;
    top: calc(var(--nav-top-h) + 52px);
    background: rgba(81, 52, 77, 0.25); /* Deep Fig masked haze screen */
    z-index: -1;
  }
}
.nav-logo-img {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

@media (max-width: 600px) {
  .nav-logo-img {
    height: 32px;
  }
}