/* ===== SoberSupply Design System ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --stone: #1a1816;
  --warm: #2d2926;
  --sand: #f5f0eb;
  --gold: #c9a96e;
  --gold-light: #ddc69b;
  --cream: #faf8f5;
  --text: #3d3632;
  --text-light: #8a7e76;
  --white: #ffffff;
  --danger: #c0392b;
  --success: #27ae60;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--cream);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}

a { color: inherit; text-decoration: none; }

/* ===== HEADER / NAV ===== */
.site-header {
  background: var(--stone);
  border-bottom: 1px solid rgba(201, 169, 110, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--sand);
  letter-spacing: -0.5px;
}

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

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
  transition: color 0.2s;
  position: relative;
}

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

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

.cart-link {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--gold);
  color: var(--stone);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
}

.cart-count.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===== PAGE CONTAINER ===== */
.page {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 40px;
  width: 100%;
}

.page-wide {
  max-width: 100%;
  padding: 0;
}

/* ===== SHOP HERO ===== */
.shop-hero {
  background: var(--stone);
  padding: 64px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.shop-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.shop-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--sand);
  margin-bottom: 12px;
}

.shop-hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.shop-hero p {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 500px;
  margin: 0 auto;
}

/* ===== CATEGORY TABS ===== */
.category-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 32px 40px 0;
  flex-wrap: wrap;
}

.tab {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 100px;
  border: 1px solid rgba(26, 24, 22, 0.1);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.tab:hover {
  border-color: var(--gold);
  color: var(--stone);
}

.tab.active {
  background: var(--stone);
  color: var(--gold);
  border-color: var(--stone);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 32px 40px 64px;
  max-width: 1200px;
  margin: 0 auto;
}

.product-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(26, 24, 22, 0.06);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(201, 169, 110, 0.12);
  transform: translateY(-3px);
}

.product-image {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-image .icon {
  font-size: 4rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.product-card:hover .product-image .icon,
.product-card:hover .product-image .product-img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--gold);
  color: var(--stone);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

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

.product-category-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 6px;
}

.product-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--stone);
  margin-bottom: 6px;
  line-height: 1.3;
}

.product-short-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--stone);
}

.product-price .compare {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-light);
  text-decoration: line-through;
  margin-left: 8px;
}

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

.detail-image {
  aspect-ratio: 1;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.detail-image .icon {
  font-size: 8rem;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-image .detail-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  padding: 16px;
}

.detail-info {
  padding-top: 16px;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb a {
  color: var(--text-light);
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--gold);
}

.breadcrumb .sep {
  color: var(--text-light);
  opacity: 0.4;
}

.detail-name {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--stone);
  line-height: 1.2;
  margin-bottom: 8px;
}

.detail-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 24px;
}

.detail-price .compare {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-light);
  text-decoration: line-through;
  margin-left: 12px;
}

.detail-description {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 32px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid rgba(26, 24, 22, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.qty-btn {
  width: 40px;
  height: 44px;
  border: none;
  background: var(--cream);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}

.qty-btn:hover {
  background: var(--sand);
}

.qty-value {
  width: 48px;
  height: 44px;
  border: none;
  border-left: 1px solid rgba(26, 24, 22, 0.12);
  border-right: 1px solid rgba(26, 24, 22, 0.12);
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--stone);
  background: var(--white);
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid rgba(26, 24, 22, 0.06);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.meta-icon {
  width: 20px;
  text-align: center;
}

/* ===== RELATED PRODUCTS ===== */
.related-section {
  padding: 64px 0;
  border-top: 1px solid rgba(26, 24, 22, 0.06);
}

.related-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--stone);
  margin-bottom: 32px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ===== BUTTONS ===== */
.btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--stone);
}

.btn-primary:hover {
  background: var(--gold-light);
  box-shadow: 0 4px 16px rgba(201, 169, 110, 0.3);
}

.btn-secondary {
  background: var(--stone);
  color: var(--sand);
}

.btn-secondary:hover {
  background: var(--warm);
}

.btn-outline {
  background: transparent;
  color: var(--stone);
  border: 1px solid rgba(26, 24, 22, 0.15);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

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

/* ===== CART ===== */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
  align-items: start;
}

.cart-empty {
  text-align: center;
  padding: 80px 40px;
  grid-column: 1 / -1;
}

.cart-empty .empty-icon {
  font-size: 4rem;
  margin-bottom: 24px;
  display: block;
}

.cart-empty h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--stone);
  margin-bottom: 12px;
}

.cart-empty p {
  color: var(--text-light);
  margin-bottom: 32px;
  font-size: 1rem;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 20px;
  align-items: center;
  border: 1px solid rgba(26, 24, 22, 0.06);
  transition: border-color 0.2s;
}

.cart-item:hover {
  border-color: rgba(201, 169, 110, 0.2);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-image .icon {
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-image .cart-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--stone);
  margin-bottom: 4px;
}

.cart-item-info .item-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  color: var(--gold);
  font-weight: 600;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.cart-item-actions .qty-control {
  transform: scale(0.85);
  transform-origin: right center;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.remove-btn:hover {
  color: var(--danger);
}

/* Cart Summary */
.cart-summary {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  border: 1px solid rgba(26, 24, 22, 0.06);
  position: sticky;
  top: 96px;
}

.cart-summary h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--stone);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(26, 24, 22, 0.06);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.95rem;
}

.summary-row .label {
  color: var(--text-light);
}

.summary-row .value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--stone);
}

.summary-total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(26, 24, 22, 0.08);
  font-size: 1.1rem;
}

.summary-total .value {
  font-size: 1.3rem;
  color: var(--gold);
}

.checkout-btn {
  margin-top: 24px;
}

.checkout-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 12px;
}

/* ===== CHECKOUT SUCCESS ===== */
.success-page {
  text-align: center;
  padding: 100px 40px;
  max-width: 600px;
  margin: 0 auto;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
}

.success-icon svg {
  width: 36px;
  height: 36px;
  stroke: white;
  fill: none;
  stroke-width: 3;
}

.success-page h1 {
  font-size: 2rem;
  color: var(--stone);
  margin-bottom: 16px;
}

.success-page p {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 8px;
}

.success-actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--warm);
  padding: 32px 40px;
  text-align: center;
  border-top: 1px solid rgba(201, 169, 110, 0.1);
  margin-top: auto;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}

/* ===== LOADING ===== */
.loading {
  display: flex;
  justify-content: center;
  padding: 80px 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(201, 169, 110, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--stone);
  color: var(--sand);
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  border: 1px solid rgba(201, 169, 110, 0.15);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast .toast-icon {
  font-size: 1.2rem;
}

/* ===== MOBILE MENU ===== */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--sand);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--stone);
    flex-direction: column;
    padding: 20px 40px;
    gap: 20px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.15);
  }

  .nav-links.open {
    display: flex;
  }

  .header-inner {
    padding: 0 24px;
  }

  .shop-hero {
    padding: 48px 24px;
  }

  .category-tabs {
    padding: 24px 24px 0;
    gap: 6px;
  }

  .tab {
    font-size: 0.8rem;
    padding: 8px 16px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    padding: 24px 24px 48px;
    gap: 16px;
  }

  .page {
    padding: 32px 24px;
  }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 0;
  }

  .detail-image {
    max-height: 300px;
  }

  .cart-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cart-summary {
    position: static;
  }

  .cart-item {
    grid-template-columns: 64px 1fr;
    gap: 12px;
  }

  .cart-item-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .cart-item-actions .qty-control {
    transform: scale(1);
  }

  .related-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .success-actions {
    flex-direction: column;
  }

  .site-footer {
    padding: 24px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  .product-card .product-image {
    aspect-ratio: 4/3;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}
