@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --cream: #FAF6F0;
  --white: #FFFFFF;
  --midnight: #1A0F14;
  --wine: #660032;
  --wine-dark: #4A0024;
  --border: #EAE3D9;
  --text-secondary: #8A7E85;
  --text-muted: #B5A9AF;
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--midnight); background: var(--cream); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 36px; cursor: pointer; border: none; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; transition: all 0.3s ease; }
.btn-wine { background: var(--wine); color: var(--white); }
.btn-wine:hover { background: var(--wine-dark); }
.btn-wine:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--midnight); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--midnight); }

.section-title { font-family: var(--font-serif); font-size: 2.25rem; color: var(--midnight); letter-spacing: 2px; text-align: center; margin-bottom: 3rem; font-weight: 600; }
.page-title { font-family: var(--font-serif); font-size: 2.5rem; color: var(--midnight); letter-spacing: 2px; font-weight: 600; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; max-width: 1280px; margin: 0 auto; }
.nav-logo { font-family: var(--font-serif); font-size: 1.5rem; color: var(--wine); letter-spacing: 2px; font-weight: 600; }
.nav-search-wrap { position: relative; flex: 1; max-width: 400px; margin: 0 24px; }
.nav-search-wrap input { width: 100%; padding: 8px 14px 8px 34px; border: 1px solid var(--border); font-size: 0.8125rem; outline: none; background: var(--cream); color: var(--midnight); transition: border-color 0.2s; }
.nav-search-wrap input:focus { border-color: var(--wine); background: var(--white); }
.nav-search-wrap input::placeholder { color: var(--text-muted); }
.nav-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* Search suggestions dropdown */
.search-suggestions { position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border: 1px solid var(--border); border-top: none; max-height: 320px; overflow-y: auto; z-index: 200; display: none; box-shadow: 0 8px 24px rgba(26,15,20,0.1); }
.search-suggestions.open { display: block; }
.ss-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; text-decoration: none; color: var(--midnight); transition: background 0.15s; cursor: pointer; }
.ss-item:hover { background: var(--cream); }
.ss-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.ss-name { flex: 1; font-size: 0.8125rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-price { font-family: var(--font-mono); font-size: 0.75rem; color: var(--wine); white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--midnight); }
.nav-actions { display: flex; align-items: center; gap: 20px; }
.nav-cart { position: relative; color: var(--text-secondary); transition: color 0.2s; cursor: pointer; background: none; border: none; padding: 0; display: flex; }
.nav-cart:hover { color: var(--midnight); }
.cart-badge { position: absolute; top: -8px; right: -8px; background: var(--wine); color: var(--white); font-size: 0.625rem; font-weight: 600; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.nav-auth { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wine); font-weight: 500; border-bottom: 1px solid transparent; transition: border-color 0.2s, color 0.2s; padding-bottom: 2px; display: flex; align-items: center; gap: 10px; }
.nav-auth:hover { border-color: var(--wine); }
.nav-auth-divider { width: 1px; height: 14px; background: var(--border); display: inline-block; }
.nav-auth-logout { font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); font-weight: 400; cursor: pointer; transition: color 0.2s; }
.nav-auth-logout:hover { color: var(--wine); }

/* Hero */
.hero { padding: 6rem 24px 5rem; text-align: center; background: var(--cream); }
.hero-title { font-family: var(--font-serif); font-size: 4rem; color: var(--wine); letter-spacing: 2px; font-weight: 600; line-height: 1.2; margin-bottom: 1.25rem; }
.hero-subtitle { font-size: 1.0625rem; color: var(--text-secondary); font-weight: 300; max-width: 520px; margin: 0 auto 2.5rem; line-height: 1.7; }
@media (max-width: 768px) {
  .hero { padding: 4rem 24px 3rem; }
  .hero-title { font-size: 2.5rem; }
  .hero-subtitle { font-size: 0.9375rem; }
}

/* Categories Section */
.categories-section { padding: 5rem 0; background: var(--cream); }
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
@media (min-width: 768px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .category-grid { grid-template-columns: repeat(5, 1fr); } }
.category-card { background: var(--white); padding: 3rem 1.5rem; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: background 0.3s ease; min-height: 160px; }
.category-card:hover { background: var(--cream); }
.category-label { font-size: 0.6875rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-secondary); font-weight: 500; }

/* Featured Section */
.featured-section { padding: 5rem 0; background: var(--white); }
.featured-grid { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
@media (min-width: 640px) { .featured-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .featured-grid { grid-template-columns: repeat(4, 1fr); } }
.product-card { background: var(--white); padding: 1.5rem; display: flex; flex-direction: column; height: 100%; transition: background 0.3s ease; }
.product-card:hover { background: var(--cream); }
.product-card img { width: 100%; height: 280px; object-fit: cover; margin-bottom: 1rem; }
.product-card .cat-tag { font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
.product-card h3 { font-family: var(--font-serif); font-size: 1.0625rem; color: var(--midnight); margin: 0.5rem 0 0.75rem; font-weight: 600; line-height: 1.25; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .price-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.product-card .price { font-size: 1rem; font-weight: 600; color: var(--wine); letter-spacing: 0.02em; }
.product-card .add-btn { padding: 6px 16px; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; background: var(--wine); color: var(--white); border: none; cursor: pointer; font-weight: 500; transition: background 0.2s; }
.product-card .add-btn:hover { background: var(--wine-dark); }
.product-card .sold-out { font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; padding: 6px 0; }

/* Category Page */
.category-page { padding: 3rem 0 5rem; background: var(--cream); }
.category-header { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.category-count { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.5rem; letter-spacing: 0.03em; }
.product-grid-3 { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
@media (min-width: 640px) { .product-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .product-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.cat-prod-card { background: var(--white); padding: 1.5rem; display: flex; flex-direction: column; height: 100%; transition: background 0.3s ease; }
.cat-prod-card:hover { background: var(--cream); }
.cat-prod-card .img-box { width: 100%; height: 280px; background: var(--cream); margin-bottom: 1rem; overflow: hidden; }
.cat-prod-card .img-box img { width: 100%; height: 100%; object-fit: cover; }
.cat-prod-card .cat-tag { font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
.cat-prod-card h3 { font-family: var(--font-serif); font-size: 1.0625rem; color: var(--midnight); margin: 0.5rem 0 0.75rem; font-weight: 600; line-height: 1.25; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-prod-card .price-mono { font-family: var(--font-mono); font-size: 0.9375rem; font-weight: 500; color: var(--wine); letter-spacing: 0.01em; }
.cat-prod-card .price-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.cat-prod-card .add-btn { padding: 6px 16px; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; background: var(--wine); color: var(--white); border: none; cursor: pointer; font-weight: 500; transition: background 0.2s; }
.cat-prod-card .add-btn:hover { background: var(--wine-dark); }
.cat-prod-card .sold-out { font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }

/* Cart Drawer */
.cart-overlay { position: fixed; inset: 0; background: rgba(26,15,20,0.25); z-index: 100; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer { position: fixed; top: 0; right: 0; width: 420px; max-width: 100vw; height: 100vh; background: var(--white); border-left: 1px solid var(--border); z-index: 101; transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; }
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cart-drawer-header h3 { font-family: var(--font-serif); font-size: 1.25rem; letter-spacing: 1px; font-weight: 600; color: var(--midnight); }
.cart-drawer-close { background: none; border: none; font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; padding: 4px; line-height: 1; transition: color 0.2s; }
.cart-drawer-close:hover { color: var(--midnight); }
.cart-drawer-items { flex: 1; overflow-y: auto; padding: 16px 28px; }
.cart-drawer-empty { text-align: center; padding: 3rem 0; color: var(--text-muted); font-size: 0.875rem; letter-spacing: 0.03em; }
.drawer-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.drawer-item:last-child { border-bottom: none; }
.drawer-item img { width: 64px; height: 64px; object-fit: cover; flex-shrink: 0; }
.drawer-item-info { flex: 1; min-width: 0; }
.drawer-item-info h4 { font-size: 0.875rem; font-weight: 500; color: var(--midnight); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-item-info .drawer-price { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; color: var(--wine); }
.drawer-item-qty { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.drawer-item-qty button { width: 28px; height: 28px; border: 1px solid var(--border); background: none; cursor: pointer; font-size: 0.875rem; display: flex; align-items: center; justify-content: center; transition: background 0.2s; color: var(--midnight); }
.drawer-item-qty button:hover { background: var(--cream); }
.drawer-item-qty span { font-size: 0.8125rem; min-width: 20px; text-align: center; }
.drawer-item-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.6875rem; letter-spacing: 0.05em; padding: 0; margin-top: 4px; transition: color 0.2s; }
.drawer-item-remove:hover { color: var(--wine); }
.cart-drawer-footer { border-top: 1px solid var(--border); padding: 20px 28px 28px; flex-shrink: 0; }
.cart-drawer-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.cart-drawer-total span:first-child { font-size: 0.8125rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.cart-drawer-total .drawer-total-amount { font-family: var(--font-mono); font-size: 1.125rem; font-weight: 600; color: var(--midnight); }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 3rem 24px 2rem; text-align: center; background: var(--white); }
.footer-logo { font-family: var(--font-serif); font-size: 1.125rem; color: var(--wine); letter-spacing: 2px; font-weight: 600; margin-bottom: 0.75rem; }
.footer p { font-size: 0.8125rem; color: var(--text-secondary); }
.footer a { color: var(--text-secondary); transition: color 0.2s; }
.footer a:hover { color: var(--midnight); }
.footer-divider { width: 24px; height: 1px; background: var(--text-muted); margin: 1.25rem auto; }
.footer-bottom { font-size: 0.75rem; color: var(--text-muted); margin-top: 1.5rem; }

/* Toast */
#toza-toast { position: fixed; bottom: 24px; right: 24px; background: var(--wine); color: var(--white); padding: 12px 24px; font-size: 0.8125rem; font-weight: 500; z-index: 9999; opacity: 0; transition: opacity 0.3s; pointer-events: none; letter-spacing: 0.03em; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1.5rem; letter-spacing: 0.02em; }
.breadcrumb a { color: var(--text-secondary); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--midnight); }
.breadcrumb .sep { color: var(--text-muted); font-size: 0.875rem; }
.breadcrumb .current { color: var(--midnight); font-weight: 500; }

/* Sidebar */
.cat-layout { display: flex; gap: 32px; align-items: flex-start; }
.cat-sidebar { width: 220px; flex-shrink: 0; background: var(--white); border: 1px solid var(--border); padding: 1.25rem 0; position: sticky; top: 88px; }
.cat-sidebar h4 { font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; padding: 0 1.25rem 0.75rem; border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; }
.sidebar-link { display: block; padding: 0.5rem 1.25rem; font-size: 0.8125rem; color: var(--text-secondary); transition: all 0.15s; border-left: 2px solid transparent; }
.sidebar-link:hover { color: var(--midnight); background: var(--cream); }
.sidebar-link.active { color: var(--wine); font-weight: 500; border-left-color: var(--wine); background: var(--cream); }

/* Search bar */
.cat-top-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.cat-search-wrap { position: relative; flex: 1; max-width: 360px; }
.cat-search-wrap input { width: 100%; padding: 10px 14px 10px 36px; border: 1px solid var(--border); font-size: 0.8125rem; outline: none; background: var(--white); color: var(--midnight); transition: border-color 0.2s; }
.cat-search-wrap input:focus { border-color: var(--wine); }
.cat-search-wrap input::placeholder { color: var(--text-muted); }
.cat-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* Card link (whole card clickable) */
.card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.card-link:hover { color: inherit; }

/* Main content area */
.cat-main { flex: 1; min-width: 0; }

/* No results */
.no-results { text-align: center; padding: 4rem 1rem; color: var(--text-muted); font-size: 0.875rem; letter-spacing: 0.03em; }

/* Review form */
.review-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.review-form input, .review-form textarea, .review-form select { display: block; width: 100%; padding: 10px 14px; border: 1px solid var(--border); font-size: 0.8125rem; outline: none; background: var(--white); color: var(--midnight); margin-bottom: 10px; transition: border-color 0.2s; }
.review-form input:focus, .review-form textarea:focus, .review-form select:focus { border-color: var(--wine); }
.review-form textarea { resize: vertical; min-height: 60px; }
.review-form .review-submit { padding: 10px 24px; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; background: var(--wine); color: var(--white); border: none; cursor: pointer; font-weight: 500; transition: background 0.2s; }
.review-form .review-submit:hover { background: var(--wine-dark); }

/* Responsive */
@media (max-width: 768px) {
  .cat-layout { flex-direction: column; }
  .cat-sidebar { width: 100%; position: static; }
  .cat-top-bar { flex-direction: column; align-items: stretch; }
  .cat-search-wrap { max-width: 100%; }
}

/* Utility */
.hidden { display: none !important; }

/* Profile */
.prof-stat-grid { display: flex; flex-direction: column; gap: 8px; }

/* Discount pricing */
.price-original { text-decoration: line-through; color: var(--text-muted); font-family: var(--font-mono); font-size: inherit; margin-right: 6px; }
.discount-badge { display: inline-block; background: #4A0024; color: #fff; font-size: 0.625rem; font-weight: 600; padding: 1px 6px; letter-spacing: 0.05em; margin-left: 6px; vertical-align: middle; border-radius: 2px; line-height: 1.4; }

/* Low stock badge */
.low-stock { font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: #c0392b; font-weight: 600; padding: 2px 0; }

/* Product Gallery */
.prod-gallery { display: flex; flex-direction: column; gap: 10px; }
.prod-main-img { width: 100%; height: 400px; object-fit: cover; cursor: pointer; transition: opacity 0.2s; }
.prod-main-img:hover { opacity: 0.9; }
.prod-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.prod-thumb { width: 70px; height: 70px; object-fit: cover; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s, opacity 0.2s; opacity: 0.6; border-radius: 2px; }
.prod-thumb:hover { opacity: 0.8; }
.prod-thumb.active { border-color: var(--wine); opacity: 1; }

/* Lightbox */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-close { position: absolute; top: 20px; right: 30px; font-size: 2.5rem; color: #fff; cursor: pointer; z-index: 201; line-height: 1; transition: color 0.2s; }
.lightbox-close:hover { color: var(--text-muted); }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 2.5rem; color: #fff; cursor: pointer; padding: 10px; z-index: 201; transition: color 0.2s; user-select: none; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { color: var(--text-muted); }
.lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 4px; }
.lightbox-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: var(--text-muted); font-size: 0.875rem; letter-spacing: 0.05em; }

/* New Arrivals Section */
.new-arrivals-section { padding: 5rem 0; background: var(--cream); }
.new-arrivals-grid { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
@media (min-width: 640px) { .new-arrivals-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .new-arrivals-grid { grid-template-columns: repeat(4, 1fr); } }
.category-grid > *,
.featured-grid > *,
.product-grid-3 > *,
.new-arrivals-grid > * {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Banner Slideshow */
.hero-slideshow { position: relative; width: 100%; height: 600px; overflow: hidden; background: var(--cream); }
.hero-slides { position: relative; width: 100%; height: 100%; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease; }
.hero-slide.active { opacity: 1; z-index: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 10px; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: background 0.3s; }
.hero-dot.active { background: #fff; }
@media (max-width: 768px) { .hero-slideshow { height: 300px; } }
@media (max-width: 480px) { .hero-slideshow { height: 220px; } }

