/* ═══════════════════════════════════════════
   PRIMORA — Shared Design System
   ═══════════════════════════════════════════ */

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

:root {
  --ink: #1a1410;
  --cream: #f8f5f0;
  --warm: #e8e0d4;
  --accent: #c4956a;
  --accent-deep: #8b6142;
  --muted: #9a8e82;
  --white: #ffffff;
  --error: #c44a3a;
  --success: #4a8c5c;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── NAV ──────────────────────────────────── */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1.2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(248, 245, 240, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(26, 20, 16, 0.06);
}

.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

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

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link.active {
  color: var(--ink);
}

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cart-count {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--accent-deep);
  color: var(--cream);
  font-size: 0.65rem;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  line-height: 1;
}

/* ─── BUTTONS ──────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1rem 2.5rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}

.btn-primary {
  background: var(--ink);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--cream);
}

.btn-accent {
  background: var(--accent-deep);
  color: var(--cream);
}

.btn-accent:hover {
  background: var(--ink);
}

.btn-small {
  padding: 0.6rem 1.5rem;
  font-size: 0.75rem;
}

/* ─── PRODUCT CARDS ────────────────────────── */

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.product-card {
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.3s;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card-image {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.product-card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,0.08), transparent);
  pointer-events: none;
}

.product-card-type {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  z-index: 1;
}

.product-card-info {
  padding: 1rem 0;
}

.product-card-category {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.product-card-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.15rem;
}

.product-card-color {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 0.5rem;
}

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

/* ─── COST BREAKDOWN BAR ──────────────────── */

.cost-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.cost-bar-segment {
  transition: width 0.5s ease;
}

.cost-bar-fabric { background: var(--accent); }
.cost-bar-manufacturing { background: var(--accent-deep); }
.cost-bar-logistics { background: var(--muted); }
.cost-bar-margin { background: var(--ink); }

.cost-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.cost-item-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.cost-item-value {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.cost-item-detail {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.5;
}

/* ─── SIZE SELECTOR ────────────────────────── */

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

.size-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(26, 20, 16, 0.15);
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
}

.size-btn:hover {
  border-color: var(--ink);
}

.size-btn.selected {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

/* ─── FILTER PILLS ─────────────────────────── */

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.filter-pill {
  padding: 0.5rem 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: 1px solid rgba(26, 20, 16, 0.15);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

/* ─── PAGE SECTIONS ────────────────────────── */

.page-hero {
  padding: 8rem 3rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.page-hero h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.page-hero p {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 300;
  max-width: 500px;
  line-height: 1.7;
}

.page-content {
  padding: 0 3rem 6rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── FOOTER ───────────────────────────────── */

.site-footer {
  padding: 3rem;
  border-top: 1px solid rgba(26, 20, 16, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-link {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 300;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--ink);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 300;
}

/* ─── TOAST NOTIFICATION ───────────────────── */

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ink);
  color: var(--cream);
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.toast a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ─── EMPTY STATE ──────────────────────────── */

.empty-state {
  text-align: center;
  padding: 5rem 2rem;
}

.empty-state h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.empty-state p {
  color: var(--muted);
  font-weight: 300;
  font-size: 1.05rem;
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* ─── CART ITEMS ───────────────────────────── */

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(26, 20, 16, 0.08);
}

.cart-item-image {
  width: 80px;
  height: 100px;
  border-radius: 2px;
}

.cart-item-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.cart-item-details {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 300;
}

.cart-item-price {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-align: right;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(26, 20, 16, 0.15);
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.qty-btn:hover {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.qty-value {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s;
  margin-top: 0.5rem;
}

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

/* ─── ORDER SUMMARY ────────────────────────── */

.order-summary {
  background: var(--white);
  padding: 2rem;
  border: 1px solid rgba(26, 20, 16, 0.08);
}

.order-summary h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(26, 20, 16, 0.08);
}

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

.summary-row.total {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  border-top: 1px solid rgba(26, 20, 16, 0.15);
  margin-top: 1rem;
  padding-top: 1rem;
}

.summary-label {
  color: var(--muted);
  font-weight: 300;
}

.total .summary-label {
  color: var(--ink);
}

/* ─── RESPONSIVE ───────────────────────────── */

@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cost-items {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  nav {
    padding: 1rem 1.5rem;
  }
  .nav-links {
    gap: 1.25rem;
  }
  .page-hero {
    padding: 7rem 1.5rem 2rem;
  }
  .page-content {
    padding: 0 1.5rem 4rem;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .cost-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .cart-item {
    grid-template-columns: 60px 1fr;
    gap: 1rem;
  }
  .cart-item-price {
    text-align: left;
  }
  .site-footer {
    padding: 2rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .footer-links {
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
  .filter-pills {
    gap: 0.35rem;
  }
  .filter-pill {
    padding: 0.4rem 0.9rem;
    font-size: 0.75rem;
  }
}
