:root {
  --primary: #1a1a1a;
  --accent: #3b82f6;
  --bg-gray: #f9fafb;
  --border: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --sidebar-width: 400px;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  line-height: 1.5;
  background-color: #fff;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
  }
}

/* Gallery & Zoom */
.gallery-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-image-wrapper {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-gray);
  position: relative;
  cursor: zoom-in;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.main-image-wrapper:hover .main-image {
  transform: scale(1.5);
}

.thumbnails {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  object-fit: cover;
  flex-shrink: 0;
}

.thumbnail.active {
  border-color: var(--accent);
}

/* Product Info */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.variants-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.variant-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.variant-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: 500;
}

.variant-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 2px;
  background-clip: content-box;
}

.color-swatch.selected {
  border-color: var(--accent);
}

/* Cart & Quantity */
.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  width: fit-content;
  border-radius: 4px;
}

.quantity-btn {
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
}

.quantity-display {
  padding: 0 1rem;
  font-weight: 600;
}

.add-to-cart-btn {
  background: var(--primary);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  width: 100%;
  transition: var(--transition);
}

.add-to-cart-btn:hover {
  opacity: 0.9;
}

/* Cart Sidebar */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: var(--sidebar-width);
  height: 100%;
  background: white;
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.cart-sidebar.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

/* Carousel */
.related-section {
  margin-top: 4rem;
}

.carousel {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 1rem 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.product-card {
  flex: 0 0 250px;
  scroll-snap-align: start;
}

.product-card img {
  border-radius: 8px;
  margin-bottom: 0.5rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
