/* Header & Navbar Styles - Realistic Torn Paper Aesthetic (Matching Reference Graphic) */

:root {
  --torn-paper-color: #ce4c00;
  --torn-paper-gradient: linear-gradient(180deg, #d85300 0%, #ce4c00 60%, #c44400 100%);
  --torn-paper-text: #ffffff;
  --torn-paper-hover: #fedd30;
  --torn-paper-active-bg: rgba(254, 221, 48, 0.22);
}

/* 1. Header Shell: Sticky, in normal document flow above hero image */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  transition: filter 0.25s ease;
}

.site-header.scrolled {
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.22));
}

/* 2. Terracotta Torn Paper Navbar */
.navbar {
  position: relative;
  width: 100%;
  height: clamp(74px, 5.6vw, 84px);
  background: transparent;
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
}

/* Authentic nav_bar paper image background layer */
.navbar-bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(108px, 8.2vw, 122px);
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.navbar-bg-layer picture,
.navbar-bg-img {
  width: 100%;
  height: 100%;
  display: block;
}

.navbar-bg-img {
  object-fit: fill;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1560px;
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 48px);
  position: relative;
  z-index: 10;
}

.navbar-brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  margin-left: clamp(90px, 9.8vw, 165px);
  position: relative;
  top: clamp(2px, 0.3vw, 5px);
  z-index: 10;
  flex-shrink: 0;
}

.navbar-brand-logo:hover,
.navbar-brand-logo:focus,
.navbar-brand-logo:active {
  transform: none;
}

.navbar-logo-img {
  height: clamp(72px, 5.5vw, 88px);
  width: auto;
  max-width: 240px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
}

.nav-center-wrapper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  margin: 0;
  z-index: 10;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

/* Zero-overlap: completely hide nav links when paper search bar tears open */
.navbar.search-active .nav-center-wrapper,
.navbar:has(.paper-ripped-search-wrapper.is-open) .nav-center-wrapper,
.navbar:has(.paper-ripped-search-wrapper.is-closing) .nav-center-wrapper {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate(-50%, -8px) scale(0.96) !important;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s !important;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.4vw, 38px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-family: var(--font-heading, 'Outfit', 'Poppins', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--torn-paper-text);
  position: relative;
  padding: 6px 12px;
  text-decoration: none;
  transition: color 0.2s ease;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  z-index: 2;
  text-shadow: none; /* Glow removed */
}

.nav-link:hover,
.nav-link.active {
  color: var(--torn-paper-hover);
}

/* Clean Accent Underline on Active & Hover - NO GLOW */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 10px;
  right: 10px;
  height: 2.5px;
  background: var(--torn-paper-hover);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
  box-shadow: none; /* Removed neon glow */
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* 5. Header Right Actions (Search, Profile, Cart - Clean Icons, No Boxes) */
.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(16px, 1.8vw, 24px);
  z-index: 10;
  margin-left: auto;
  margin-right: clamp(20px, 3.5vw, 60px);
  flex-shrink: 0;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  position: relative;
  padding: 0;
  box-shadow: none;
}

.header-icon-btn:hover {
  background: transparent;
  color: var(--torn-paper-hover);
  border: none;
  transform: scale(1.12);
  box-shadow: none;
}

.header-icon-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  display: block;
}

.action-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #fedd30;
  color: #782e00;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  border: 1.5px solid #ce4c00;
}

/* User Account Dropdown in Header */
.user-account-dropdown-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.user-avatar-btn {
  position: relative;
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1.5px solid #ffffff;
}

.user-active-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #ffffff;
}

/* ==========================================================================
   User Account Sidebar Drawer (Sliding Full-Height Side Panel)
   ========================================================================== */

.user-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.user-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: #fbf9f4;
  font-family: var(--font-sans, 'Poppins', sans-serif);
  z-index: 2601;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.22);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.user-drawer.open {
  transform: translateX(0);
}

.user-drawer-header {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 14px;
}

.user-drawer-header-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.user-drawer-header-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #522ea8;
  color: #ffffff;
  font-family: var(--font-sans, 'Poppins', sans-serif);
  font-size: 1.45rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

.user-drawer-header-avatar-guest {
  background: #e2e8f0;
  color: #64748b;
}

.user-drawer-header-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 2px;
}

.user-drawer-header-name {
  font-family: var(--font-sans, 'Poppins', sans-serif);
  font-size: 1.12rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.user-drawer-header-email {
  font-family: var(--font-sans, 'Poppins', sans-serif);
  font-size: 0.86rem;
  font-weight: 400;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.user-drawer-header .drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #4b5563;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.user-drawer-header .drawer-close-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.user-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Quick Stats Bar */
.user-drawer-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.drawer-stat-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  cursor: pointer;
}

.drawer-stat-card:hover {
  border-color: #ea580c;
  background: #fffbf5;
  transform: translateY(-2px);
}

.stat-number {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ea580c;
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #78716c);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Section Headings */
.drawer-section-heading {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #78716c);
  margin-bottom: 10px;
}

.drawer-menu-links {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.drawer-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: #231607;
  font-size: 0.92rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.drawer-menu-item:last-child {
  border-bottom: none;
}

.drawer-menu-item:hover {
  background: #fff8eb;
  color: #ea580c;
  padding-left: 18px;
}

.drawer-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ea580c;
  flex-shrink: 0;
}

.drawer-item-icon svg {
  width: 20px;
  height: 20px;
}

.drawer-item-text {
  flex: 1;
}

.drawer-item-badge {
  background: #ea580c;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
}

.drawer-item-tag {
  background: rgba(234, 88, 12, 0.1);
  color: #ea580c;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.drawer-item-arrow {
  color: #a8a29e;
  transition: transform 0.2s ease;
}

.drawer-menu-item:hover .drawer-item-arrow {
  transform: translateX(3px);
  color: #ea580c;
}

/* Perk Card */
.drawer-perk-card {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px dashed #f97316;
  border-radius: 14px;
  padding: 14px 16px;
}

.perk-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.perk-icon {
  font-size: 1.4rem;
}

.perk-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #9a3412;
  margin: 0;
}

.perk-desc {
  font-size: 0.78rem;
  color: #7c2d12;
  display: block;
}

.perk-coupon-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(234, 88, 12, 0.3);
}

.perk-coupon-tag code {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ea580c;
  letter-spacing: 0.05em;
}

.coupon-tag-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: #ffffff;
  background: #ea580c;
  padding: 2px 7px;
  border-radius: 4px;
}

/* Drawer Footer */
.user-drawer-footer {
  padding: 16px 20px;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.user-drawer-logout-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.94rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-drawer-logout-btn:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

/* Guest Drawer Styles */
.user-drawer-guest-banner {
  text-align: center;
  padding: 16px 10px;
}

.guest-banner-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.guest-banner-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #231607;
  margin: 0 0 6px;
}

.guest-banner-desc {
  font-size: 0.86rem;
  color: var(--text-muted, #78716c);
  line-height: 1.45;
  margin: 0;
}

.drawer-social-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  background: #ffffff;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.drawer-social-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.drawer-divider-text {
  display: flex;
  align-items: center;
  text-align: center;
  color: #9ca3af;
  font-size: 0.78rem;
  margin: 16px 0;
}

.drawer-divider-text::before,
.drawer-divider-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}

.drawer-divider-text span {
  padding: 0 10px;
}

.drawer-email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-input-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

.drawer-form-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid #d1d5db;
  font-size: 0.92rem;
  background: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.drawer-form-input:focus {
  outline: none;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

.drawer-primary-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
  margin-top: 4px;
}

.drawer-primary-btn:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.35);
  transform: translateY(-1px);
}

.drawer-auth-links {
  text-align: center;
  margin-top: 10px;
}

.drawer-link-btn {
  background: none;
  border: none;
  color: #ea580c;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

.drawer-guest-perks {
  margin-top: 10px;
  padding: 16px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.guest-perk-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.guest-perk-item:last-child {
  margin-bottom: 0;
}

.perk-check {
  color: #10b981;
  font-weight: 800;
  font-size: 0.95rem;
}

.guest-perk-item strong {
  display: block;
  font-size: 0.84rem;
  color: #1f2937;
}

.guest-perk-item p {
  font-size: 0.78rem;
  color: #6b7280;
  margin: 1px 0 0;
  line-height: 1.35;
}

/* Legacy fallback support if needed */
.navbar-torn-edge {
  display: none;
}

/* 7. Mobile Toggle - Clean Icon, No Box */
.mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 0;
  box-shadow: none;
}

.mobile-toggle:hover {
  background: transparent;
  color: var(--torn-paper-hover);
  transform: scale(1.12);
}

/* 8. Mobile Navigation Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100vh;
  background: #faf4e6;
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--torn-paper-gradient);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.drawer-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-close-btn:hover {
  background: #ffffff;
  color: var(--torn-paper-color);
}

.mobile-drawer-links {
  padding: 24px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mobile-drawer-link {
  font-family: var(--font-heading, 'Outfit', 'Poppins', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #2b1807;
  padding: 8px 0;
  display: block;
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-drawer-link:hover, 
.mobile-drawer-link.active {
  color: var(--torn-paper-color);
}

/* 9. Responsive Breakpoints */
@media (max-width: 900px) {
  .navbar {
    height: 70px;
  }
  .navbar-bg-layer {
    height: 102px;
  }
  .navbar-bg-img {
    object-fit: cover;
    object-position: top center;
  }
  .navbar-container {
    padding: 0 16px;
  }
  .nav-center-wrapper {
    display: none;
  }
  .mobile-toggle {
    display: flex;
  }
  .navbar-brand-logo {
    margin-left: clamp(16px, 4.5vw, 32px);
    top: 2px;
  }
  .navbar-logo-img {
    height: clamp(56px, 14vw, 68px);
    max-width: 160px;
  }
  .header-actions {
    margin-right: 0;
    gap: 12px;
  }
}

/* ===================================================
   10. Physically Unrolling & Tearing Paper Search Bar
   =================================================== */

.header-actions {
  position: relative;
}

/* Hide trigger icon when search is open or closing so close button cleanly takes its place */
.navbar.search-active #search-trigger-btn,
.navbar:has(.paper-ripped-search-wrapper.is-open) #search-trigger-btn,
.navbar:has(.paper-ripped-search-wrapper.is-closing) #search-trigger-btn {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.15s ease;
}

#search-trigger-btn {
  transition: opacity 0.2s ease;
}

/* The Search Stage Container (Anchored at Navbar Search Button) */
.paper-ripped-search-wrapper {
  --search-sheet-width: clamp(340px, 48vw, 540px);
  position: absolute;
  top: 50%;
  right: calc(100% - 38px);
  transform: translateY(-50%);
  width: 0;
  height: 52px;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  z-index: 50;
  perspective: 1400px;
  transform-style: preserve-3d;
}

/* 3D Paper Stage */
.paper-unroll-stage {
  position: absolute;
  right: 0;
  top: 0;
  height: 52px;
  width: var(--search-sheet-width);
  pointer-events: none;
  transform-style: preserve-3d;
}

/* Dynamic moving lift shadow beneath unrolling paper sheet and cylinder */
.paper-lift-shadow {
  position: absolute;
  right: 0;
  top: 8px;
  bottom: -10px;
  width: 0;
  border-radius: 6px;
  background: radial-gradient(ellipse at 15% 50%, rgba(20, 5, 0, 0.75) 0%, rgba(45, 12, 2, 0.4) 45%, transparent 75%);
  filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transform-origin: right center;
  transition: width 0.82s cubic-bezier(0.22, 0.9, 0.28, 1.02), opacity 0.3s ease;
}

.paper-ripped-search-wrapper.is-open .paper-lift-shadow {
  width: 100%;
  opacity: 1;
}

.paper-ripped-search-wrapper.is-closing .paper-lift-shadow {
  width: 0;
  opacity: 0.5;
  transition: width 0.60s cubic-bezier(0.35, 0, 0.2, 1), opacity 0.45s ease;
}

/* The Expanding Paper Track: Controls unroll width from right (0) to left (var(--search-sheet-width)) */
.paper-unroll-track {
  position: absolute;
  right: 0;
  top: 0;
  height: 52px;
  width: 0;
  transform-style: preserve-3d;
  will-change: width;
}

/* Open state: Stage width expands over 820ms */
.paper-ripped-search-wrapper.is-open {
  opacity: 1;
  pointer-events: auto;
  width: var(--search-sheet-width);
}

.paper-ripped-search-wrapper.is-open .paper-unroll-track {
  width: var(--search-sheet-width);
  /* Custom physical paper unrolling curve: brisk initial pull, accelerating roll, natural deceleration, soft settling */
  transition: width 0.82s cubic-bezier(0.22, 0.9, 0.28, 1.02);
}

/* Closing state: Retracts back to 0 width over 600ms */
.paper-ripped-search-wrapper.is-closing {
  opacity: 1;
  pointer-events: none;
  width: var(--search-sheet-width);
}

.paper-ripped-search-wrapper.is-closing .paper-unroll-track {
  width: 0;
  transition: width 0.60s cubic-bezier(0.35, 0, 0.2, 1);
}

/* The Paper Sheet Reveal Window (Pins sheet to the right while unmasking leftward) */
.paper-sheet-reveal-window {
  position: absolute;
  right: 0;
  top: -4px;
  bottom: -4px;
  width: 100%;
  height: calc(100% + 8px);
  overflow: hidden;
  transform-style: preserve-3d;
  pointer-events: none;
}

.paper-ripped-search-wrapper.is-open .paper-sheet-reveal-window {
  pointer-events: auto;
}

/* The Physical Torn Kraft Paper Sheet */
.paper-physical-sheet {
  position: absolute;
  right: 0;
  top: 4px;
  width: var(--search-sheet-width);
  height: 52px;
  transform-origin: right center;
  transform-style: preserve-3d;
  clip-path: url(#torn-paper-silhouette);
  overflow: visible;
  z-index: 5;
  background-color: #f7f1e3;
  box-shadow: 
    inset 0 4px 10px rgba(45, 15, 3, 0.45),
    inset 0 -3px 8px rgba(45, 15, 3, 0.25),
    0 10px 28px rgba(35, 10, 2, 0.4);
}

/* 3D Tension, Tilt & Deformation during Unroll */
.paper-ripped-search-wrapper.is-open .paper-physical-sheet {
  animation: paperSheetUnrollPhysics 0.82s cubic-bezier(0.22, 0.9, 0.28, 1.02) forwards;
}

@keyframes paperSheetUnrollPhysics {
  0% {
    transform: rotateY(-12deg) rotateX(4deg) skewY(-1deg);
  }
  30% {
    /* Lift as paper roll is pulled horizontally */
    transform: rotateY(-8deg) rotateX(2.5deg) skewY(-0.6deg) translateY(-1px);
  }
  65% {
    /* Decelerating toward target width */
    transform: rotateY(-3deg) rotateX(1deg) skewY(-0.2deg) translateY(0.5px);
  }
  88% {
    /* Subtle physical settling */
    transform: rotateY(0.6deg) rotateX(-0.4deg) skewY(0.1deg);
  }
  100% {
    /* Resting flat */
    transform: rotateY(0deg) rotateX(0deg) skewY(0deg) translateY(0);
  }
}

/* 3D Sheet Retract Physics */
.paper-ripped-search-wrapper.is-closing .paper-physical-sheet {
  animation: paperSheetRetractPhysics 0.60s cubic-bezier(0.35, 0, 0.2, 1) forwards;
}

@keyframes paperSheetRetractPhysics {
  0% {
    transform: rotateY(0deg) rotateX(0deg) skewY(0deg);
  }
  35% {
    transform: rotateY(-7deg) rotateX(2.5deg) skewY(-0.5deg) translateY(-1px);
  }
  100% {
    transform: rotateY(-12deg) rotateX(4deg) skewY(-1deg) translateY(0);
  }
}

/* Kraft Paper Background & Texture (Anchored right, moves naturally with sheet) */
.paper-sheet-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.paper-sheet-texture-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

/* Search Content Layer: Controls fade/reveal smoothly AFTER paper has unrolled */
.paper-search-content-layer {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px 0 20px;
  gap: 10px;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 0.22s ease 0.70s, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1) 0.70s;
}

.paper-ripped-search-wrapper.is-open .paper-search-content-layer {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.paper-ripped-search-wrapper.is-closing .paper-search-content-layer {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.12s ease 0s, transform 0.12s ease 0s;
  pointer-events: none;
}

.rip-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8c3b06;
  flex-shrink: 0;
}

.paper-rip-search-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.96rem;
  font-weight: 500;
  color: #2b1c10;
  padding: 0;
  height: 100%;
}

.paper-rip-search-input::placeholder {
  color: #8a735c;
  font-size: 0.90rem;
  font-weight: 400;
}

.paper-rip-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(220, 205, 185, 0.7);
  border: 1px solid rgba(175, 140, 110, 0.5);
  color: #632e08;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.18s ease;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
}

.paper-rip-close-btn:hover {
  background: #c44000;
  border-color: #9c3200;
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.25);
}

/* ===================================================
   3D Leading Curling Edge (Outside reveal window: NEVER clipped!)
   =================================================== */

.paper-leading-curl {
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 72px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform-style: preserve-3d;
  perspective: 600px;
}

/* Open Animation on Leading Curl: Active while unrolling, flattens & fades as sheet settles */
.paper-ripped-search-wrapper.is-open .paper-leading-curl {
  animation: curlLeadTrackOpen 0.82s cubic-bezier(0.22, 0.9, 0.28, 1.02) forwards;
}

@keyframes curlLeadTrackOpen {
  0% {
    opacity: 1;
    transform: translateY(-50%) scale(0.75, 0.88);
  }
  75% {
    opacity: 1;
    transform: translateY(-50%) scale(1.02, 1.0);
  }
  92% {
    opacity: 0.6;
    transform: translateY(-50%) scale(0.65, 1.02);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) scale(0.15, 1.0);
  }
}

/* Close Animation on Leading Curl: Reappears, uncurls from flat, rolls back to search button */
.paper-ripped-search-wrapper.is-closing .paper-leading-curl {
  animation: curlLeadTrackClose 0.60s cubic-bezier(0.35, 0, 0.2, 1) forwards;
}

@keyframes curlLeadTrackClose {
  0% {
    opacity: 0;
    transform: translateY(-50%) scale(0.15, 1.0);
  }
  12% {
    opacity: 1;
    transform: translateY(-50%) scale(1, 1);
  }
  85% {
    opacity: 1;
    transform: translateY(-50%) scale(0.85, 0.92);
  }
  100% {
    opacity: 0.2;
    transform: translateY(-50%) scale(0.60, 0.84);
  }
}

/* Darker Underside Shadow inside the curl */
.curl-underside-shadow {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 52px;
  background: linear-gradient(
    to right,
    rgba(18, 4, 1, 0.95) 0%,
    rgba(58, 17, 3, 0.72) 45%,
    rgba(110, 36, 8, 0.25) 80%,
    transparent 100%
  );
  border-radius: 0 4px 4px 0;
  pointer-events: none;
  z-index: 15;
}

/* Curled Kraft Paper Flap with physical bevel */
.curl-paper-flap {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 50px;
  background: linear-gradient(
    135deg,
    #7a3d16 0%,
    #9e5321 55%,
    #ba6730 100%
  );
  border-radius: 3px 0 0 3px;
  box-shadow: -2px 0 6px rgba(18, 5, 0, 0.6);
  z-index: 16;
}

/* 3D Rolled Kraft Cylinder Assembly */
.curl-cylinder-assembly {
  position: relative;
  width: 28px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 22;
}

.curl-cylinder-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(-8px 5px 12px rgba(18, 5, 1, 0.8));
  display: block;
}

/* Specular Curvature Highlight */
.curl-highlight-rim {
  position: absolute;
  right: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(255, 245, 230, 0.6) 0%,
    rgba(255, 255, 255, 0.92) 50%,
    rgba(255, 245, 230, 0.6) 100%
  );
  box-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
  border-radius: 1px;
}

/* Organic White Fiber Deckle Ends */
.curl-fiber-deckle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.8) 0%, transparent 60%),
              radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.8) 0%, transparent 60%);
}

/* Soft Ground Contact Shadow beneath roll */
.curl-ground-shadow {
  position: absolute;
  left: -8px;
  bottom: -6px;
  width: 36px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(18, 4, 0, 0.8) 0%, rgba(40, 12, 2, 0.4) 50%, transparent 80%);
  filter: blur(5px);
  z-index: 10;
}

/* Roll Rotation during Unroll (Spins 720deg around Y axis) */
.paper-ripped-search-wrapper.is-open .curl-cylinder-assembly {
  animation: curlRollSpinOpen 0.82s cubic-bezier(0.22, 0.9, 0.28, 1.02) forwards;
}

@keyframes curlRollSpinOpen {
  0% {
    transform: scale(0.65, 0.88) rotateY(0deg) rotateZ(5deg);
  }
  25% {
    /* Initial tension and fast unspooling */
    transform: scale(0.78, 0.92) rotateY(-200deg) rotateZ(-3deg) translateY(-1px);
  }
  50% {
    /* Midpoint fast unrolling */
    transform: scale(0.88, 0.96) rotateY(-420deg) rotateZ(-2deg) translateY(1px);
  }
  75% {
    /* Decelerating */
    transform: scale(0.96, 0.99) rotateY(-620deg) rotateZ(-3deg) translateY(-0.6px);
  }
  92% {
    /* Approaching final position */
    transform: scale(1.02, 1.01) rotateY(-710deg) rotateZ(-1deg) translateY(0.2px);
  }
  100% {
    /* Settled */
    transform: scale(1, 1) rotateY(-720deg) rotateZ(0deg) translateY(0);
  }
}

/* Roll Rotation during Retract (Spins reverse clockwise into navbar) */
.paper-ripped-search-wrapper.is-closing .curl-cylinder-assembly {
  animation: curlRollSpinClose 0.60s cubic-bezier(0.35, 0, 0.2, 1) forwards;
}

@keyframes curlRollSpinClose {
  0% {
    transform: scale(1, 1) rotateY(-720deg) rotateZ(0deg);
  }
  40% {
    transform: scale(0.88, 0.95) rotateY(-380deg) rotateZ(4deg) translateY(-1px);
  }
  100% {
    transform: scale(0.62, 0.86) rotateY(0deg) rotateZ(7deg) translateY(0);
  }
}

/* ===================================================
   Live Dropdown Results (Torn Parchment Note)
   =================================================== */

.paper-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: 440px;
  overflow-y: auto;
  background: #fdfbf7;
  background-image: 
    radial-gradient(#eedfc8 0.75px, transparent 0.75px), 
    radial-gradient(#ecdcc2 0.75px, #fdfbf7 0.75px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  border-radius: 8px;
  border: 1px solid #dccbb6;
  box-shadow: 
    0 16px 36px rgba(45, 16, 5, 0.35),
    0 3px 8px rgba(0, 0, 0, 0.1);
  visibility: hidden;
  pointer-events: none;
  z-index: 100;
  padding: 14px 16px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

.paper-search-dropdown.is-active {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 600px) {
  .paper-ripped-search-wrapper {
    --search-sheet-width: min(calc(100vw - 120px), 360px);
  }
}

.dropdown-header-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8c7155;
  margin-bottom: 8px;
  padding-left: 4px;
}

.dropdown-product-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dropdown-product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #ffffff;
  border: 1px solid transparent;
}

.dropdown-product-card:hover {
  background: #fbf5e8;
  border-color: #e5cfad;
  transform: translateX(3px);
}

.dropdown-thumb {
  width: 44px;
  height: 44px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  background: #fdfaf3;
  border: 1px solid #ebd8bd;
}

.dropdown-info {
  flex-grow: 1;
  min-width: 0;
}

.dropdown-name {
  font-family: 'Fraunces', serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #2b1807;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.dropdown-meta {
  font-size: 0.74rem;
  color: #85694a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.dropdown-price {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #d85300;
}

.dropdown-empty {
  padding: 18px 12px;
  text-align: center;
  font-size: 0.88rem;
  color: #7a5e42;
}

.dropdown-tags-wrapper {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e8d9c2;
}

.dropdown-tag-pill {
  display: inline-block;
  padding: 3px 10px;
  margin: 3px;
  border-radius: 4px;
  background: #faebd7;
  border: 1px solid #d9c4aa;
  color: #783808;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropdown-tag-pill:hover {
  background: #d85300;
  color: #ffffff;
  border-color: #b83d00;
}

@media (max-width: 768px) {
  .paper-ripped-search-wrapper.is-open {
    width: calc(100vw - 120px);
    right: 36px;
  }
  .paper-search-dropdown {
    width: calc(100vw - 32px);
    right: -36px;
  }
}

