:root {
  --color-bg: #101012;
  --color-bg-alt: #15161A;
  --color-accent: #C08A5A;
  --color-text: #EDE7DF;
  --color-text-muted: #CCC7BE;
  --color-card: #16181E;
  --radius-lg: 18px;
  --shadow-card: 0 4px 16px rgba(0,0,0,0.15);
  --font-family: 'Inter', system-ui, sans-serif;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  margin: 0;
  line-height: 1.5;
  font-size: 16px;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--color-bg-alt);
  height: 68px;
  box-shadow: 0 1px 8px rgba(16,14,18,0.12);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1272px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--color-accent);
}

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

.nav-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
}

.cart-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--color-text);
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition);
}

.cart-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--color-accent);
  color: var(--color-bg);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* Main */
main {
  flex: 1;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, rgba(192,138,90,0.1) 0%, transparent 100%);
  padding: 80px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.hero-content h1 {
  font-size: 3.5rem;
  margin: 0 0 16px 0;
  line-height: 1.2;
  font-weight: 700;
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* Shop Section */
.shop-section {
  padding: 60px 24px;
}

.container {
  max-width: 1272px;
  margin: 0 auto;
}

.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--color-text-muted);
  padding: 10px 20px;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}

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

.product-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: var(--color-accent);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(192,138,90,0.1) 0%, rgba(192,138,90,0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badges {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  background: var(--color-accent);
  color: var(--color-bg);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.product-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 8px 0;
  color: var(--color-text);
}

.product-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.product-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.add-to-cart-btn {
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition);
  margin-top: auto;
}

.add-to-cart-btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  padding: 60px 20px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(16,14,18,0.8);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-close:hover {
  color: var(--color-accent);
}

.product-detail {
  padding: 40px;
}

.product-detail-image {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(192,138,90,0.1) 0%, rgba(192,138,90,0.05) 100%);
  border-radius: 12px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--color-text-muted);
  overflow: hidden;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-info h2 {
  font-size: 2rem;
  margin: 0 0 16px 0;
}

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

.product-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.meta-item {
  background: rgba(255,255,255,0.02);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.meta-item strong {
  color: var(--color-accent);
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.product-detail-description {
  color: var(--color-text-muted);
  margin-bottom: 30px;
  line-height: 1.7;
}

.customization-field {
  margin-bottom: 20px;
}

.customization-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-accent);
}

.customization-field input,
.customization-field textarea {
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-family);
  resize: vertical;
}

.customization-field input:focus,
.customization-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255,255,255,0.08);
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.quantity-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--color-text);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition);
}

.quantity-btn:hover {
  border-color: var(--color-accent);
}

.quantity-input {
  width: 60px;
  text-align: center;
  padding: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--color-text);
}

.add-to-cart-modal-btn {
  width: 100%;
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  padding: 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
}

.add-to-cart-modal-btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

/* Cart Sidebar */
.cart-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(16,14,18,0.5);
  z-index: 60;
}

.cart-overlay.active {
  display: block;
}

.cart-sidebar {
  position: fixed;
  right: -400px;
  top: 0;
  width: 400px;
  height: 100vh;
  background: var(--color-card);
  z-index: 70;
  transition: right var(--transition);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.cart-sidebar.active {
  right: 0;
}

@media (max-width: 500px) {
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }
}

.cart-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.cart-close {
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-empty {
  text-align: center;
  color: var(--color-text-muted);
  margin-top: 40px;
}

.cart-item {
  background: rgba(255,255,255,0.02);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 8px;
}

.cart-item-price {
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 8px;
}

.cart-item-custom {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.cart-item-quantity {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.cart-item-remove {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: #ff6b6b;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.cart-item-remove:hover {
  border-color: #ff6b6b;
  background: rgba(255,107,107,0.1);
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: 700;
}

.checkout-btn {
  width: 100%;
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  padding: 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
}

.checkout-btn:hover {
  opacity: 0.9;
}

.checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
}

.toast {
  background: var(--color-card);
  color: var(--color-text);
  padding: 16px 24px;
  border-radius: 8px;
  margin-bottom: 12px;
  border-left: 4px solid var(--color-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Footer */
footer {
  background: var(--color-bg-alt);
  border-top: 1px solid rgba(255,255,255,0.04);
  padding: 30px 24px;
  text-align: center;
}

.footer-content {
  max-width: 1272px;
  margin: 0 auto;
  color: var(--color-text-muted);
}

.footer-content a {
  color: var(--color-accent);
  text-decoration: none;
}

.footer-content a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.2rem;
  }

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

  .nav-links {
    gap: 16px;
  }

  .product-detail {
    padding: 20px;
  }
}
