/* ===== GoodsHaven Store Styles ===== */
/* Design language matches the landing page */

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

:root {
  --ink: #0d0d0d;
  --paper: #faf8f5;
  --sage: #4a6741;
  --sage-light: #e8ede6;
  --sage-dark: #3a5233;
  --warm: #c4956a;
  --warm-light: #f5ece4;
  --cream: #f2efe8;
  --muted: #6b6b6b;
  --danger: #c44141;
  --danger-light: #fde8e8;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== NAV ===== */
.store-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.store-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-decoration: none;
}
.store-nav .logo span { color: var(--sage); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: -0.2px;
  transition: color 0.2s;
  position: relative;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); }

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sage);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}

/* ===== PAGE LAYOUT ===== */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 3rem;
}

.page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 500px;
}

/* ===== CATEGORY FILTERS ===== */
.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.55rem 1.25rem;
  border-radius: 100px;
  border: 1.5px solid rgba(0,0,0,0.1);
  background: transparent;
  color: var(--muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.2px;
}
.filter-btn:hover {
  border-color: var(--sage);
  color: var(--sage);
}
.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

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

.product-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  border: 1px solid rgba(0,0,0,0.04);
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.product-card-image {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

/* Category-based gradients */
.product-card-image.health {
  background: linear-gradient(135deg, #e8ede6 0%, #d1dccf 50%, #c2d4bc 100%);
}
.product-card-image.home {
  background: linear-gradient(135deg, #f5ece4 0%, #edddd0 50%, #e5d0be 100%);
}
.product-card-image.lifestyle {
  background: linear-gradient(135deg, #f2efe8 0%, #e5e0d6 50%, #dbd4c8 100%);
}

.product-card-body {
  padding: 1.25rem;
}

.product-card-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--sage);
  margin-bottom: 0.35rem;
}

.product-card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.btn-add-small {
  padding: 0.45rem 1rem;
  border-radius: 100px;
  border: none;
  background: var(--sage);
  color: white;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-add-small:hover { background: var(--sage-dark); }
.btn-add-small.added {
  background: var(--ink);
  pointer-events: none;
}

/* ===== PRODUCT DETAIL ===== */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.product-image-large {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
  overflow: hidden;
}

.product-info {
  padding-top: 1rem;
}

.product-breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.product-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.product-breadcrumb a:hover { color: var(--sage); }

.product-category-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  background: var(--sage-light);
  color: var(--sage-dark);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.product-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.product-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--sage);
  margin-bottom: 1.5rem;
}

.product-description {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.product-features {
  list-style: none;
  margin-bottom: 2.5rem;
}
.product-features li {
  padding: 0.55rem 0;
  font-size: 0.9rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.product-features li:last-child { border-bottom: none; }
.feature-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sage-light);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.quantity-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  overflow: hidden;
}
.qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.qty-btn:hover { background: var(--cream); }
.qty-value {
  width: 44px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Space Grotesk', sans-serif;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  border-radius: 12px;
  border: none;
  background: var(--sage);
  color: white;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.2px;
}
.btn-primary:hover { background: var(--sage-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  border-radius: 12px;
  border: 1.5px solid rgba(0,0,0,0.1);
  background: transparent;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.2px;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--ink); }

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

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: white;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.04);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.3px;
  margin-bottom: 0.15rem;
}

.cart-item-category {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.cart-item-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.cart-item-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}
.cart-item-remove:hover { color: var(--danger); }

.cart-summary {
  position: sticky;
  top: 6rem;
  background: white;
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(0,0,0,0.04);
}

.cart-summary h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}
.cart-summary-row .label { color: var(--muted); }
.cart-summary-row .value {
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1.5px solid rgba(0,0,0,0.08);
  font-size: 1.1rem;
}
.cart-summary-total .label { font-weight: 600; }
.cart-summary-total .value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--sage);
}

.btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  margin-top: 1.5rem;
  border-radius: 12px;
  border: none;
  background: var(--ink);
  color: white;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.2px;
}
.btn-checkout:hover { background: #1a1a1a; transform: translateY(-1px); }
.btn-checkout:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-continue {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 600;
}
.btn-continue:hover { color: var(--ink); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 6rem 2rem;
}
.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.3;
}
.empty-state h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}
.empty-state p {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ===== SUCCESS / DEMO MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.modal-box {
  background: white;
  border-radius: 20px;
  padding: 3rem;
  max-width: 460px;
  width: 90%;
  text-align: center;
  transform: scale(0.95);
  animation: scaleIn 0.3s ease forwards;
}

@keyframes scaleIn {
  to { transform: scale(1); }
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.modal-box h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
}

.modal-box p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* ===== LOADING ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--cream);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ===== FOOTER ===== */
.store-footer {
  padding: 2.5rem 2rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 1rem;
}

.store-footer .footer-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.store-footer .footer-logo span { color: var(--sage); }
.store-footer .footer-note {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .cart-layout {
    grid-template-columns: 1fr;
  }
  .cart-summary {
    position: static;
  }
}

@media (max-width: 768px) {
  .store-nav { padding: 1rem 1.25rem; }
  .nav-links { gap: 1.25rem; }
  .page { padding: 6rem 1.25rem 3rem; }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
  .product-card-image { font-size: 3rem; }
  .product-image-large { font-size: 5rem; }
  .store-footer {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.25rem;
  }
  .cart-item {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .cart-item-right {
    flex-direction: column;
    gap: 0.75rem;
  }
}
