/* ── Design Tokens ── */
:root {
  --color-primary: #2b2d42;
  --color-secondary: #8d99ae;
  --color-accent: #ef233c;
  --color-background: #fdf8f8;
  --color-text: #2b2d42;
  --color-surface: #fff;
  --color-muted: #f5f5f5;
  --color-border: #e5e5e5;
  --color-text-muted: #666;
  --color-star: #f5a623;
  --color-success: #27ae60;
  --color-primary-dark: #1d2033;
}

/* ── Base Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-primary);
  color: #fff;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Letter placeholder */
.letter-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-secondary);
  background: var(--color-muted);
}

/* ── Header Variant 3: Brutalist minimal ── */
header {
  background: #000;
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid #fff;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  min-height: 56px;
}

.logo {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-right: 1px solid #333;
}

nav {
  display: flex;
  align-items: stretch;
}

.nav-link {
  color: #999;
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-left: 1px solid #333;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: #fff;
  color: #000;
}

.cart-link {
  color: #fff;
  font-weight: 700;
}

@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; }
  .logo { flex: 1; border-right: none; border-bottom: 1px solid #333; }
  nav { width: 100%; }
  .nav-link { flex: 1; justify-content: center; padding: 12px 8px; font-size: 0.75rem; }
}

/* ── Hero Variant 1: Gradient banner ── */
.hero {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary, var(--color-primary)));
  color: #fff;
  padding: 48px 24px;
  border-radius: 16px;
  margin-top: 24px;
  text-align: center;
}

.hero-title { font-size: 2.2rem; margin-bottom: 8px; }
.hero-subtitle { font-size: 1.1rem; opacity: 0.85; }

/* ── Products Variant 5: Badge Grid ── */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 36px;
  margin-top: 48px;
  color: var(--color-primary, #222);
}

.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-bottom: 48px;
}

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

@media (max-width: 768px) {
  .products { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

.product-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-surface, #fff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.25s, transform 0.25s;
}

.product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  transform: translateY(-4px);
}

.product-card__image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-muted, #f5f5f5);
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  z-index: 1;
}

.product-card__badge--sale { background: var(--color-accent, #e74c3c); }
.product-card__badge--new { background: var(--color-success, #27ae60); }

.product-card__info { padding: 16px; }

.product-card__name {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--color-primary, #222);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-card__price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.product-card__price--regular {
  font-size: 0.9rem;
  color: var(--color-text-muted, #888);
  text-decoration: line-through;
}

.product-card__price--sale {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-accent, #e74c3c);
}

.product-card__price--current {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary, #222);
}

.add-btn {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-radius: 6px;
  background: var(--color-primary, #222);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s;
  display: inline-block;
  text-align: center;
}

.add-btn:hover { background: var(--color-accent, #e74c3c); }

/* ── Product Detail Variant 2: Brutalist minimal ── */
.back-link {
  display: inline-block;
  margin: 24px 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #000;
  border-bottom: 1px solid #000;
}

.back-link:hover { color: #666; border-color: #666; }

.product-detail {
  display: flex;
  gap: 40px;
  padding: 0 0 48px;
  border-top: 2px solid #000;
  padding-top: 32px;
}

.detail-image {
  width: 280px;
  height: 280px;
  min-width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  border: 2px solid #000;
}

.detail-info { flex: 1; }

.detail-name {
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.detail-desc {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 24px;
  line-height: 1.5;
}

.detail-price {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 24px;
}

.detail-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.qty-picker {
  display: flex;
  align-items: center;
  border: 2px solid #000;
}

.qty-btn {
  background: #fff;
  border: none;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.15s;
}

.qty-btn:hover { background: #000; color: #fff; }

#qty-display {
  width: 40px;
  text-align: center;
  font-weight: 700;
  border-left: 2px solid #000;
  border-right: 2px solid #000;
  line-height: 40px;
}

.add-btn-lg {
  background: #000;
  color: #fff;
  border: none;
  padding: 0 32px;
  height: 44px;
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-block;
  text-align: center;
  line-height: 44px;
}

.add-btn-lg:hover { background: #333; }

.not-found {
  padding: 48px 0;
  font-size: 1.1rem;
  color: #666;
}

.not-found a {
  color: #000;
  font-weight: 700;
  border-bottom: 1px solid #000;
}

@media (max-width: 700px) {
  .product-detail { flex-direction: column; gap: 24px; }
  .detail-image { width: 100%; min-width: 0; height: 200px; font-size: 4rem; }
  .detail-actions { flex-direction: column; align-items: stretch; }
  .add-btn-lg { text-align: center; padding: 12px; }
}

/* ── Cart Page Variant 3 ── */
.cart-heading {
  font-size: 28px;
  font-weight: 700;
  margin: 32px 0;
  color: var(--color-text, #1a1a1a);
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: start;
  padding-bottom: 48px;
}

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

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border, #e5e5e5);
}

.cart-item:first-child { padding-top: 0; }

.cart-item-image {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-surface, #f5f5f5);
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text, #1a1a1a);
  text-decoration: none;
}

.cart-item-name:hover { color: var(--color-primary, #2563eb); }

.cart-item-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 6px;
  overflow: hidden;
}

.cart-item-qty button {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-qty button:hover { background: var(--color-surface, #f5f5f5); }

.cart-item-qty span {
  width: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-left: 1px solid var(--color-border, #ddd);
  border-right: 1px solid var(--color-border, #ddd);
  line-height: 32px;
}

.cart-item-subtotal {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
  min-width: 80px;
  text-align: right;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--color-text-muted, #999);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
}

.cart-item-remove:hover { color: #e53e3e; }

.cart-summary {
  position: sticky;
  top: 100px;
  background: #f9f9f9;
  border-radius: 12px;
  padding: 28px;
}

.cart-summary__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 15px;
  color: var(--color-text-muted, #555);
}

.summary-total {
  border-top: 2px solid var(--color-border, #ddd);
  margin-top: 12px;
  padding-top: 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
}

.checkout-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 24px;
  background: var(--color-primary, #2563eb);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.2s;
  box-sizing: border-box;
  border: none;
  cursor: pointer;
}

.checkout-btn:hover { background: var(--color-primary-dark, #1d4ed8); }

.cart-summary__continue {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  color: var(--color-primary, #2563eb);
  text-decoration: none;
}

.cart-summary__continue:hover { text-decoration: underline; }

.cart-items__empty {
  padding: 48px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .cart-item-image { width: 72px; height: 72px; }
}

/* ── CTA Variant 1 ── */
.cta {
  text-align: center;
  padding: 48px 0;
}

/* ── Footer Variant 2 ── */
footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.6);
  padding: 32px 0;
  margin-top: 48px;
  font-size: 0.9rem;
}

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

.footer-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  display: block;
  margin-bottom: 4px;
}

.footer-copyright { font-size: 0.8rem; }

.footer-links { display: flex; gap: 20px; }
.footer-links a {
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }

@media (max-width: 700px) {
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
}

/* ── Legal Pages ── */
.legal-page { padding: 48px 0; }
.legal-page h1 { font-size: 1.8rem; margin-bottom: 24px; }
.legal-page h2 { font-size: 1.3rem; margin: 32px 0 12px; }
.legal-page p, .legal-page li { line-height: 1.7; margin-bottom: 12px; color: var(--color-text-muted); }
.legal-page ul { padding-left: 24px; }
.legal-page a { color: var(--color-accent); }
.legal-page table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.legal-page th, .legal-page td { padding: 8px 12px; border: 1px solid var(--color-border); text-align: left; }
