/* ==========================================================================
   UNIVERSAL RESPONSIVE HEADER, MOBILE DRAWER & CUSTOMER AUTH STYLES
   ========================================================================== */
/* ===== Day/Night theme tokens (self-contained defaults; canonical values shared site-wide) ===== */
:root {
  --cream: #fffaf4;
  --card-bg: #ffffff;
  --border-subtle: #ebd9c5;
  --text-main: #3a2a24;
  --text-muted: #7a5b4a;
  --dark: #2b1a16;
  --ink: #2b1a16;
  --accent-red: #8a1f1f;
  --forest-dark: #1b3024;
  --forest: #2f4a3a;
  --green-text: #1b6b35;
}

[data-theme="dark"] {
  --cream: #150d09;
  --card-bg: #20130d;
  --border-subtle: #3d2a1d;
  --text-main: #efe3d4;
  --text-muted: #b5a091;
  --dark: #f0e4d5;
  --ink: #2b1a16;
  --accent-red: #e0766b;
  --forest-dark: #2c4a38;
  --forest: #4c7a5f;
  --green-text: #4cc38a;
}

/* Universal Account Button */
.nav-account-btn {
  background: linear-gradient(135deg, #fef6e4, #fdedc9);
  color: #5c3b00 !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  padding: 0.38rem 0.85rem !important;
  border-radius: 999px !important;
  border: 1.5px solid #d9a441 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(217, 164, 65, 0.2);
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.nav-account-btn:hover {
  background: linear-gradient(135deg, #d9a441, #c9932d);
  color: #fff !important;
  transform: translateY(-1px);
}

.nav-account-btn.logged-in {
  background: linear-gradient(135deg, #1b3024, #2c4c39);
  color: #ffd363 !important;
  border-color: #d9a441 !important;
}

/* Universal Track Order Button */
.nav-track-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #ffd363 !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  padding: 0.38rem 0.85rem !important;
  border-radius: 999px !important;
  border: 1.5px solid rgba(217, 164, 65, 0.4) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s ease;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.nav-track-btn:hover {
  background: rgba(217, 164, 65, 0.2);
  border-color: #d9a441 !important;
  color: #fff !important;
}

/* Direct One-Click Sign Out Button */
.nav-logout-btn {
  background: #ffeded !important;
  color: #c0392b !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  padding: 0.36rem 0.75rem !important;
  border-radius: 999px !important;
  border: 1.2px solid #ffcccc !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.25s ease;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.nav-logout-btn:hover {
  background: #c0392b !important;
  color: #fff !important;
  border-color: #c0392b !important;
}

/* Universal Cart / Bag Button Styling */
.nav-cart-btn {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
}

/* Mobile Nav Toggle Hamburger Button */
.nav-mobile-toggle {
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1000000 !important;
  flex-shrink: 0;
  pointer-events: auto !important;
}

.nav-mobile-toggle span {
  width: 100%;
  height: 3px;
  background: #3a2a24;
  border-radius: 4px;
  transition: all 0.3s ease;
  pointer-events: none !important;
  display: block;
}

.nav-mobile-toggle.active span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
  background: #8a1f1f;
}

.nav-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-mobile-toggle.active span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
  background: #8a1f1f;
}

/* Mobile Slide-Out Navigation Drawer & Backdrop */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 14, 10, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999998 !important;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.active {
  display: block !important;
  opacity: 1 !important;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 360px;
  height: 100vh;
  background: var(--cream);
  box-shadow: -6px 0 35px rgba(0,0,0,0.35);
  z-index: 999999 !important;
  display: flex !important;
  flex-direction: column;
  padding: 1.5rem 1.25rem 2rem;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  border-left: 2px solid #ebd9c5;
}

.mobile-nav-drawer.active {
  right: 0 !important;
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ebd9c5;
  margin-bottom: 1.25rem;
}

.mobile-drawer-header img {
  height: 42px;
  width: auto;
}

.mobile-drawer-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-drawer-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid #f0e6da;
  transition: all 0.2s;
}

.mobile-drawer-links a:hover,
.mobile-drawer-links a.active {
  background: #fdf5ea;
  color: var(--accent-red);
  border-color: #d9a441;
}

.mobile-drawer-vip-card {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #1b3024, #122018);
  border: 1px solid #d9a441;
  border-radius: 14px;
  padding: 1rem;
  color: #fff;
  text-align: center;
}

/* Mobile Media Queries & Responsive Layout Controls */
@media (max-width: 991px) {
  .site-nav .nav-links {
    display: none !important;
  }
  .nav-mobile-toggle {
    display: flex !important;
  }
  .nav-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 768px) {
  /* On mobile screens, hide secondary header actions that are available in the Mobile Drawer to prevent overflow */
  .site-nav .nav-track-btn,
  .nav-header-actions .nav-track-btn,
  .site-nav .nav-logout-btn,
  .nav-header-actions .nav-logout-btn {
    display: none !important;
  }

  .nav-account-btn {
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
  }

  .nav-cart-btn {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
  }
}

@media (max-width: 540px) {
  .nav-inner {
    padding: 0 0.5rem !important;
    gap: 0.3rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .nav-logo img {
    height: 34px !important;
    max-height: 34px !important;
    max-width: 110px !important;
  }
  .nav-header-actions {
    gap: 4px !important;
    flex-shrink: 1 !important;
  }
  .nav-account-btn {
    max-width: 95px !important;
    padding: 0.3rem 0.5rem !important;
    font-size: 0.7rem !important;
    gap: 2px !important;
  }
  .nav-cart-btn {
    padding: 0.3rem 0.55rem !important;
    font-size: 0.7rem !important;
    gap: 2px !important;
  }
  .nav-mobile-toggle {
    width: 22px !important;
    height: 16px !important;
    margin-left: 2px !important;
  }
}

/* Global Mobile Overflow Prevention */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

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

/* Customer Auth Modals (Shared) */
.cust-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 14, 10, 0.78);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeInModal 0.25s ease-out;
}

.cust-modal-overlay.active {
  display: flex !important;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.cust-modal-card {
  background: var(--card-bg);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  border: 1.5px solid #ebd9c5;
  position: relative;
  padding: 2rem 1.75rem 1.75rem;
}

.cust-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.cust-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  color: var(--dark);
  margin: 0;
}

.cust-modal-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cust-modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 50%;
}

/* Tabs */
.cust-auth-tabs {
  display: flex;
  background: #f5ede6;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  gap: 4px;
}

.cust-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 9px;
  cursor: pointer;
}

.cust-tab-btn.active {
  background: var(--card-bg);
  color: var(--accent-red);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cust-form-group {
  margin-bottom: 1rem;
}

.cust-form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cust-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cust-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  border: 1.5px solid #ebd9c5;
  border-radius: 10px;
  background: var(--cream);
  color: var(--dark);
  outline: none;
}

.cust-input:focus {
  border-color: #d9a441;
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.15);
}

.cust-eye-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  color: var(--text-muted);
}

.cust-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #8a1f1f, #5e1414);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 0.75rem;
  box-shadow: 0 4px 15px rgba(138, 31, 31, 0.25);
}

.cust-btn-primary:hover {
  background: linear-gradient(135deg, #a82424, #731818);
}

.cust-vip-promo-box {
  background: linear-gradient(135deg, #fff8e8, #fdf1d5);
  border: 1px dashed #d9a441;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cust-vip-promo-box .icon {
  font-size: 1.6rem;
}

.cust-vip-promo-box p {
  margin: 0;
  font-size: 0.8rem;
  color: #5c3b00;
  line-height: 1.35;
}

.cust-profile-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1b3024, #122018);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  margin-bottom: 1.25rem;
  border: 1px solid #d9a441;
}

.cust-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #d9a441;
  color: var(--forest-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
}

.cust-orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1rem;
}

.cust-order-card {
  border: 1px solid #ebd9c5;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--cream);
}

.cust-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.cust-order-id {
  font-weight: 800;
  color: var(--dark);
  font-size: 0.88rem;
}

.cust-order-status {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e8f8ed;
  color: var(--green-text);
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
}

.cust-order-status.cancelled {
  background: #381414 !important;
  color: #ff6b6b !important;
  border: 1px solid rgba(255,107,107,0.4) !important;
}

@media (max-width: 480px) {
  .cust-modal-overlay {
    padding: 0.6rem !important;
  }
  .cust-modal-card {
    padding: 1.25rem 1rem 1rem !important;
    border-radius: 16px !important;
    max-height: 94vh !important;
  }
  .cust-profile-badge-row {
    padding: 0.75rem 0.85rem !important;
    gap: 8px !important;
  }
  .cust-profile-badge-row .cust-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 1rem !important;
  }
  .cust-order-card {
    padding: 10px 12px !important;
  }
}
