/* ============================================
   IMPACT THEME — DESIGN SYSTEM (LIGHT)
   ============================================ */

:root {
  /* Colors — Ivory / Crème */
  --color-bg: #fafaf8;
  --color-bg-alt: #f3f1ec;
  --color-surface: #eceae4;
  --color-border: rgba(20,18,14,0.09);
  --color-text: #14120e;
  --color-text-muted: rgba(20,18,14,0.48);
  --color-text-subtle: rgba(20,18,14,0.25);
  --color-accent: #8b6a3e;
  --color-accent-warm: #a07840;
  --color-highlight: #000;
  --color-tag-bg: rgba(20,18,14,0.04);
  --color-tag-border: rgba(20,18,14,0.12);
  --color-btn-primary: #14120e;
  --color-btn-primary-text: #fafaf8;
  --color-btn-secondary-border: rgba(20,18,14,0.22);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;
  --space-2xl: 12rem;

  /* Layout */
  --max-width: 1440px;
  --gutter: clamp(1.5rem, 4vw, 5rem);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 200ms;
  --dur-normal: 400ms;
  --dur-slow: 700ms;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 100px;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================
   TYPOGRAPHY
   ============================================ */

.t-display { font-family: var(--font-display); font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; }

.t-display-xl {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 8vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.t-display-lg {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 6rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
}

.t-display-md {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.t-body-lg { font-size: 1.05rem; line-height: 1.75; color: var(--color-text-muted); }

.t-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.t-price { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }

/* ============================================
   LAYOUT
   ============================================ */

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--space-xl) 0; }
.section--sm { padding: var(--space-lg) 0; }
.section--xs { padding: var(--space-md) 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  transition: all var(--dur-normal) var(--ease-out);
  white-space: nowrap;
}

.btn--primary { background: var(--color-btn-primary); color: var(--color-btn-primary-text); }
.btn--primary:hover { background: #2d2a25; transform: translateY(-2px); box-shadow: 0 12px 32px rgba(20,18,14,0.18); }

.btn--outline { border: 1.5px solid var(--color-btn-secondary-border); color: var(--color-text); }
.btn--outline:hover { border-color: var(--color-text); background: rgba(20,18,14,0.04); }

.btn--ghost {
  color: var(--color-text);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-btn-secondary-border);
  border-radius: 0;
  letter-spacing: 0.08em;
}
.btn--ghost:hover { border-color: var(--color-text); gap: 1rem; }

.btn--icon {
  width: 3rem; height: 3rem; padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  justify-content: center;
}
.btn--icon:hover { background: rgba(20,18,14,0.05); }

.btn-arrow { display: inline-block; transition: transform var(--dur-normal) var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ============================================
   TAGS & BADGES
   ============================================ */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1.5px solid var(--color-tag-border);
  border-radius: var(--radius-full);
  background: var(--color-tag-bg);
  color: var(--color-text-muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.tag:hover { border-color: rgba(20,18,14,0.3); color: var(--color-text); background: rgba(20,18,14,0.07); }

.badge {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.7rem;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: var(--radius-full);
}
.badge--new { background: var(--color-accent-warm); color: #fff; }
.badge--sale { background: #c0392b; color: #fff; }
.badge--sold { background: var(--color-surface); color: var(--color-text-muted); border: 1px solid var(--color-border); }

/* ============================================
   MEDIA
   ============================================ */

.media { position: relative; overflow: hidden; background: var(--color-surface); }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.media:hover img { transform: scale(1.04); }
.media--square { aspect-ratio: 1/1; }
.media--portrait { aspect-ratio: 3/4; }
.media--wide { aspect-ratio: 16/9; }
.media--tall { aspect-ratio: 2/3; }

.media-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ede9e0 0%, #f5f2eb 50%, #ede9e0 100%);
}
.media-placeholder svg { opacity: 0.25; }

/* ============================================
   DIVIDER
   ============================================ */
.divider { height: 1px; background: var(--color-border); border: none; }

/* ============================================
   SCROLL ANIMATION
   ============================================ */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }
[data-reveal-delay="5"] { transition-delay: 0.5s; }

/* ============================================
   MARQUEE
   ============================================ */
.marquee { overflow: hidden; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); padding: 1.2rem 0; background: var(--color-bg); }
.marquee__track { display: flex; align-items: center; width: max-content; animation: marquee 32s linear infinite; }
.marquee__item { display: flex; align-items: center; gap: 3rem; padding: 0 3rem; white-space: nowrap; }
.marquee__sep { width: 4px; height: 4px; border-radius: 50%; background: var(--color-accent-warm); flex-shrink: 0; }
.marquee__text { font-family: var(--font-display); font-size: clamp(1rem, 2vw, 1.4rem); font-style: italic; color: var(--color-text-muted); letter-spacing: 0.01em; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================
   FORM
   ============================================ */
.input {
  width: 100%; padding: 0.9rem 1.2rem;
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text); font-size: 0.9rem;
  transition: border-color var(--dur-fast); outline: none;
}
.input:focus { border-color: rgba(20,18,14,0.35); }
.input::placeholder { color: var(--color-text-subtle); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(20,18,14,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
  padding-right: 2.5rem; cursor: pointer;
}

/* ============================================
   QTY
   ============================================ */
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--color-border); border-radius: var(--radius-full); overflow: hidden; }
.qty__btn { width: 2.5rem; height: 2.5rem; display: flex; align-items: center; justify-content: center; transition: background var(--dur-fast); }
.qty__btn:hover { background: rgba(20,18,14,0.05); }
.qty__val { width: 2rem; text-align: center; font-size: 0.9rem; }

/* ============================================
   TOAST
   ============================================ */
#toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.75rem; }
.toast {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--color-text); color: var(--color-bg);
  border-radius: var(--radius-lg);
  font-size: 0.875rem; font-weight: 500;
  box-shadow: 0 8px 40px rgba(20,18,14,0.18);
  animation: toast-in var(--dur-normal) var(--ease-out);
}
.toast.removing { animation: toast-out var(--dur-normal) var(--ease-out) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(8px) scale(0.95); } }

/* ============================================
   CART DRAWER
   ============================================ */
.cart-overlay { position: fixed; inset: 0; background: rgba(20,18,14,0.3); z-index: 900; opacity: 0; pointer-events: none; transition: opacity var(--dur-normal) var(--ease-out); backdrop-filter: blur(4px); }
.cart-overlay.is-open { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(480px, 100vw);
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  z-index: 950; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
  box-shadow: -8px 0 40px rgba(20,18,14,0.08);
}
.cart-drawer.is-open { transform: translateX(0); }
.cart-drawer__header { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem 2rem; border-bottom: 1px solid var(--color-border); }
.cart-drawer__body { flex: 1; overflow-y: auto; padding: 1.5rem 2rem; }
.cart-drawer__footer { padding: 1.5rem 2rem; border-top: 1px solid var(--color-border); }

.cart-item { display: grid; grid-template-columns: 80px 1fr; gap: 1.25rem; padding: 1.5rem 0; border-bottom: 1px solid var(--color-border); }
.cart-item:last-child { border-bottom: none; }
.cart-item__img { aspect-ratio: 1/1; background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; }
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__name { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.25rem; }
.cart-item__variant { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.75rem; }
.cart-item__actions { display: flex; align-items: center; justify-content: space-between; }
.cart-item__remove { font-size: 0.75rem; color: var(--color-text-muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cart-item__remove:hover { color: var(--color-text); }

.shipping-bar { margin-bottom: 1.5rem; }
.shipping-bar__text { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.6rem; }
.shipping-bar__track { height: 2px; background: var(--color-border); border-radius: var(--radius-full); overflow: hidden; }
.shipping-bar__fill { height: 100%; background: var(--color-accent-warm); border-radius: var(--radius-full); transition: width 0.6s var(--ease-out); }

.cart-total { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 1rem; text-align: center; color: var(--color-text-muted); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  :root { --space-xl: 4rem; --space-lg: 3rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
}
@media (max-width: 480px) { :root { --gutter: 1.25rem; } }
