/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Light Theme Palette */
  --bg-primary: #fbf8f5;
  --bg-secondary: #f4eee6;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-warm: #e8ded2;
  --bg-dark-section: #211c19;
  
  --text-main: #1e1b18;
  --text-muted: #6b635b;
  --text-subtle: #9c948a;
  
  --accent-gold: #b38b59;
  --accent-gold-hover: #9c7544;
  --accent-gold-light: #f7f1e6;
  --accent-wood: #43332b;
  
  --border-light: #ebd0bd33;
  --border-main: #e8e0d5;
  --border-card: #ece5dc;
  
  --shadow-sm: 0 2px 8px rgba(30, 27, 24, 0.04);
  --shadow-md: 0 8px 24px rgba(30, 27, 24, 0.08);
  --shadow-lg: 0 16px 40px rgba(30, 27, 24, 0.12);
  --shadow-hover: 0 20px 48px rgba(30, 27, 24, 0.14);
}

.dark {
  /* Dark Theme Palette (matching preview dark cards) */
  --bg-primary: #121110;
  --bg-secondary: #181715;
  --bg-surface: #1e1c1a;
  --bg-card: #23201d;
  --bg-warm: #2c2825;
  --bg-dark-section: #0c0b0a;
  
  --text-main: #f5f3f0;
  --text-muted: #a69f96;
  --text-subtle: #756e66;
  
  --accent-gold: #cba36b;
  --accent-gold-hover: #dfb77f;
  --accent-gold-light: #2c251c;
  --accent-wood: #e5c38d;
  
  --border-light: rgba(255, 255, 255, 0.05);
  --border-main: #2e2a26;
  --border-card: #35302b;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 20px 48px rgba(0, 0, 0, 0.7);
}

/* Base Styles */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

.font-serif-luxury {
  font-family: 'Playfair Display', serif;
}

.font-sans-ui {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-main);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* Theme helper classes */
.bg-theme-main { background-color: var(--bg-primary); }
.bg-theme-secondary { background-color: var(--bg-secondary); }
.bg-theme-surface { background-color: var(--bg-surface); }
.bg-theme-card { background-color: var(--bg-card); }
.bg-theme-warm { background-color: var(--bg-warm); }
.bg-theme-dark-sec { background-color: var(--bg-dark-section); }

.text-theme-main { color: var(--text-main); }
.text-theme-muted { color: var(--text-muted); }
.text-theme-subtle { color: var(--text-subtle); }
.text-theme-gold { color: var(--accent-gold); }

.border-theme-main { border-color: var(--border-main); }
.border-theme-card { border-color: var(--border-card); }

/* Luxury Button Styles */
.btn-gold {
  background-color: var(--accent-gold);
  color: #ffffff;
  transition: all 0.3s ease;
}
.btn-gold:hover {
  background-color: var(--accent-gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(179, 139, 89, 0.35);
}

.btn-dark {
  background-color: var(--text-main);
  color: var(--bg-surface);
  transition: all 0.3s ease;
}
.btn-dark:hover {
  opacity: 0.92;
  transform: translateY(-2px);
}

.btn-outline-luxury {
  border: 1px solid var(--border-main);
  background: transparent;
  color: var(--text-main);
  transition: all 0.3s ease;
}
.btn-outline-luxury:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background-color: var(--accent-gold-light);
}

/* Product Card Effects */
.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-gold);
}

.product-image-wrap {
  position: relative;
  background-color: var(--bg-secondary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
}

.product-image-wrap img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.08);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 10;
}
.badge-sale { background-color: #d9534f; color: #ffffff; }
.badge-new { background-color: #2e7d32; color: #ffffff; }
.badge-hot { background-color: #e67e22; color: #ffffff; }

.product-actions-overlay {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  display: flex;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 10;
}
.product-card:hover .product-actions-overlay {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.action-btn-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: 1px solid var(--border-card);
}
.action-btn-circle:hover {
  background-color: var(--accent-gold);
  color: #ffffff;
  transform: scale(1.1);
}

/* Slide-over Drawer styles */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-surface);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.slide-drawer.active {
  transform: translateX(0);
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 85%;
  max-width: 340px;
  background-color: var(--bg-surface);
  box-shadow: 10px 0 30px rgba(0,0,0,0.25);
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.mobile-nav-drawer.active {
  transform: translateX(0);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background-color: var(--bg-surface);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-card);
  max-width: 850px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
.toast-msg {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--accent-gold);
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s, transform 0.3s;
}
@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Range Slider Styling */
.range-slider {
  position: relative;
  height: 6px;
  background-color: var(--border-main);
  border-radius: 3px;
}
.range-slider-progress {
  position: absolute;
  height: 100%;
  background-color: var(--accent-gold);
  border-radius: 3px;
}
.range-slider input[type="range"] {
  position: absolute;
  top: -7px;
  height: 20px;
  width: 100%;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 2px solid #ffffff;
  pointer-events: auto;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Category Pill / Tab */
.cat-pill {
  transition: all 0.25s ease;
  border: 1px solid var(--border-main);
  background-color: var(--bg-surface);
  color: var(--text-muted);
}
.cat-pill.active, .cat-pill:hover {
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #ffffff;
}

/* Quantity Counter Input */
.quantity-input input::-webkit-outer-spin-button,
.quantity-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.quantity-input input[type=number] {
  -moz-appearance: textfield;
}

/* Smooth Image Gallery thumbnail */
.gallery-thumb {
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  border-radius: 8px;
  overflow: hidden;
}
.gallery-thumb.active {
  border-color: var(--accent-gold);
}

/* Luxury decorative divider */
.gold-divider {
  width: 50px;
  height: 2px;
  background: var(--accent-gold);
  margin: 12px 0;
}
