/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0b;
  --bg2: #121214;
  --bg3: #1a1a1e;
  --bg4: #252529;
  --gold: #d4af37;
  --gold-light: #e8c84a;
  --gold-dim: #a68a2c;
  --text: #e8e8ea;
  --text-dim: #909096;
  --text-muted: #666;
  --border: #2a2a2e;
  --danger: #e74c3c;
  --success: #2ecc71;
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-light); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; }

img { max-width: 100%; height: auto; }

.gold { color: var(--gold); }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon { color: var(--gold); font-size: 1.3rem; }

.nav-links { display: flex; gap: 32px; }

.nav-link {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--gold); }

.cart-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  color: var(--text);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 1.1rem;
  transition: border-color 0.2s;
}
.cart-btn:hover { border-color: var(--gold); }

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--gold);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== MAIN CONTENT ===== */
.main-content { padding-top: 64px; min-height: calc(100vh - 300px); }

/* ===== HERO ===== */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--bg) 0%, #1a1010 50%, var(--bg) 100%);
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
  top: -200px;
  right: -200px;
}

.hero-content { max-width: 700px; position: relative; z-index: 1; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 20px;
  color: var(--text);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 36px;
  line-height: 1.8;
}

.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: var(--bg);
  padding: 14px 36px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--gold-light);
  color: var(--bg);
  transform: translateY(-1px);
}

/* ===== SECTIONS ===== */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
}

.section-title {
  text-align: center;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 40px;
  font-family: var(--font-display);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
}
.product-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.img-placeholder {
  aspect-ratio: 1;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--gold-dim);
}
.img-placeholder.large { font-size: 5rem; }
.img-placeholder.small { font-size: 2rem; width: 80px; height: 80px; }

.product-card-body { padding: 20px; }

.product-category {
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.product-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin: 6px 0 10px;
}
.product-name:hover { color: var(--gold); }

.product-price {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.btn-add-cart {
  width: 100%;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 10px;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.btn-add-cart:hover { background: var(--gold); color: var(--bg); }
.btn-add-cart:disabled { border-color: var(--text-muted); color: var(--text-muted); cursor: not-allowed; }
.btn-add-cart.large { padding: 14px; font-size: 1rem; }
.btn-add-cart:disabled:hover { background: transparent; color: var(--text-muted); }

/* ===== CATEGORIES ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.category-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s;
  display: block;
}
.category-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.cat-icon {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 16px;
}

.category-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 8px;
}

.category-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ===== PRODUCTS PAGE ===== */
.page-products, .page-detail, .page-cart, .page-checkout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}
.products-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
}

.search-form {
  display: flex;
  gap: 8px;
}
.search-form input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.9rem;
  width: 250px;
}
.search-form input:focus { outline: none; border-color: var(--gold); }
.search-form button {
  background: var(--gold);
  color: var(--bg);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}

.products-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
}

.sidebar h3 {
  font-family: var(--font-display);
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.cat-filter {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px 16px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.cat-filter:hover { border-color: var(--gold-dim); color: var(--text); }
.cat-filter.active {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
  font-weight: 600;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  padding: 60px 0;
}

/* ===== PRODUCT DETAIL ===== */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.detail-info h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 8px 0 16px;
}

.detail-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 20px;
}

.detail-desc {
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 24px;
}

.detail-meta {
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.detail-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty-control button {
  background: var(--bg3);
  border: none;
  color: var(--text);
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.qty-control button:hover { background: var(--bg4); }
.qty-control span {
  width: 48px;
  text-align: center;
  font-weight: 600;
}

.back-link {
  display: inline-block;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 20px;
}
.back-link:hover { color: var(--gold); }

/* ===== CART PAGE ===== */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.cart-item-info a {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}

.cart-item-price {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cart-item-qty button {
  background: var(--bg3);
  border: none;
  color: var(--text);
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.cart-item-qty span { width: 36px; text-align: center; }

.cart-item-total { font-weight: 600; }

.cart-item-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.cart-item-remove:hover { opacity: 1; }

.cart-summary {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 88px;
}
.cart-summary h3 {
  font-family: var(--font-display);
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--text-dim);
}
.summary-row.total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 12px;
}

.checkout-btn {
  display: block;
  text-align: center;
  margin-top: 20px;
}

.page-cart.empty, .page-checkout.empty {
  text-align: center;
  padding: 80px 20px;
}
.page-cart.empty p, .page-checkout.empty p {
  color: var(--text-dim);
  margin: 20px 0;
}

/* ===== CHECKOUT ===== */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
}

.checkout-form h3 {
  font-family: var(--font-display);
  margin-bottom: 20px;
}

.checkout-form label {
  display: block;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.checkout-form input,
.checkout-form textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.95rem;
  margin-top: 6px;
  font-family: var(--font-sans);
}
.checkout-form input:focus,
.checkout-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.checkout-form textarea { resize: vertical; }

.checkout-summary {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 88px;
}
.checkout-summary h3 {
  font-family: var(--font-display);
  margin-bottom: 16px;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-dim);
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  padding-top: 16px;
  margin-top: 8px;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.page-checkout.success {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.checkout-success {
  text-align: center;
  max-width: 500px;
}
.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 2rem;
  margin-bottom: 24px;
}
.checkout-success h1 { margin-bottom: 16px; }
.checkout-success p { color: var(--text-dim); margin-bottom: 24px; }

/* ===== CART DRAWER ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.drawer-overlay.active { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h3 { font-family: var(--font-display); }
.drawer-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
}

.drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.drawer-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 0;
}

.drawer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.drawer-item:last-child { border-bottom: none; }

.drawer-item-info { display: flex; flex-direction: column; gap: 4px; }
.drawer-item-name { font-weight: 500; font-size: 0.9rem; }
.drawer-item-price { color: var(--gold); font-size: 0.85rem; }

.drawer-item-actions { display: flex; align-items: center; gap: 6px; }
.drawer-item-actions button {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-item-actions span { width: 24px; text-align: center; font-size: 0.85rem; }
.drawer-item-remove { color: var(--danger) !important; }

.drawer-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.drawer-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.btn-checkout {
  display: block;
  text-align: center;
  background: var(--gold);
  color: var(--bg);
  padding: 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
}
.btn-checkout:hover { background: var(--gold-light); color: var(--bg); }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  margin-top: 80px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text);
}

.footer-col p, .footer-col a {
  display: block;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 8px;
  line-height: 1.6;
}
.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .detail-layout { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .products-layout { grid-template-columns: 1fr; }
  .sidebar { display: flex; flex-wrap: wrap; gap: 8px; }
  .sidebar h3 { width: 100%; }
  .cat-filter { width: auto; margin-bottom: 0; }
  .cart-item { grid-template-columns: auto 1fr auto; gap: 8px; }
  .cart-item-total, .cart-item-remove { grid-column: 3; }
  .cart-item-total { justify-self: end; }
  .search-form input { width: 180px; }
}

@media (max-width: 480px) {
  .nav-links { gap: 16px; }
  .product-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr; }
  .cart-drawer { width: 100vw; }
}
