/* ============================================================
   ATELIER — design system
   A premium, editorial fashion-store look: warm stone canvas,
   near-black ink, a single confident bramble accent, restrained
   glassmorphism. Fraunces (display serif) + Manrope (UI sans).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* Palette */
  --canvas: #F1EEE8;
  --canvas-raised: #FBFAF7;
  --ink: #1C1B19;
  --ink-soft: #4A443C;
  --umber: #6B6154;
  --line: #DEDACF;
  --line-strong: #C9C2B2;
  --bramble: #6E2E3A;
  --bramble-dark: #571F29;
  --bramble-tint: #F4E7E9;
  --sage: #6F7C5E;
  --sage-tint: #EBEEE4;
  --gold: #9C7A3C;

  --glass-bg: rgba(251, 250, 247, 0.62);
  --glass-bg-strong: rgba(251, 250, 247, 0.82);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-dark-bg: rgba(28, 27, 25, 0.62);
  --glass-dark-border: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 1px 2px rgba(28, 27, 25, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(28, 27, 25, 0.18);
  --shadow-lg: 0 24px 60px -16px rgba(28, 27, 25, 0.28);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-ui: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1280px;
  --nav-height: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--bramble); color: var(--canvas-raised); }

/* ── Typography ────────────────────────────────────────────── */

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
}

.display-1 { font-size: clamp(2.6rem, 5.5vw, 4.6rem); font-weight: 400; }
.display-2 { font-size: clamp(2.1rem, 4vw, 3.2rem); font-weight: 400; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; font-weight: 600; font-family: var(--font-ui); letter-spacing: 0; }

p { margin: 0 0 1em; color: var(--ink-soft); }
.lede { font-size: 1.15rem; color: var(--ink-soft); }
.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bramble);
}
.muted { color: var(--umber); }
.italic { font-style: italic; }

/* ── Layout ────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 64px 0; }
.section-tight { padding: 36px 0; }

@media (max-width: 720px) {
  .section { padding: 40px 0; }
  .container { padding: 0 18px; }
}

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.spread { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; justify-content: center; }

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--ink);
  color: var(--canvas-raised);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) { background: var(--bramble-dark); box-shadow: var(--shadow-md); }

.btn-accent {
  background: var(--bramble);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-accent:hover:not(:disabled) { background: var(--bramble-dark); box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-outline:hover:not(:disabled) { border-color: var(--ink); background: rgba(28,27,25,0.04); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 16px;
}
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: rgba(28,27,25,0.05); }

.btn-danger { background: var(--bramble); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--bramble-dark); }

.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; border-radius: var(--radius-pill); }

/* ── Glass surfaces ────────────────────────────────────────── */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.glass-dark {
  background: var(--glass-dark-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-dark-border);
  color: var(--canvas-raised);
}

.panel {
  background: var(--canvas-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ── Forms ─────────────────────────────────────────────────── */

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink);
}
.field-hint { font-size: 0.78rem; color: var(--umber); margin-top: 6px; }
.field-error {
  font-size: 0.8rem;
  color: var(--bramble);
  margin-top: 6px;
  display: none;
}
.field.has-error .field-error { display: block; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--bramble); }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="tel"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--canvas-raised);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(28,27,25,0.08);
}
textarea { resize: vertical; min-height: 110px; }

.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 0.88rem; color: var(--ink-soft); }
.checkbox-row input { width: auto; }

.form-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .form-two-col { grid-template-columns: 1fr; } }

/* ── Badges & tags ─────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-sale { background: var(--bramble); color: #fff; }
.badge-new { background: var(--sage-tint); color: var(--sage); }
.badge-out { background: rgba(28,27,25,0.08); color: var(--umber); }
.badge-status { text-transform: capitalize; }
.badge-status-pending { background: #F4EBD9; color: #8A6A22; }
.badge-status-processing { background: #E4EAF3; color: #37548C; }
.badge-status-shipped { background: #E1EEEA; color: #2E7860; }
.badge-status-completed { background: var(--sage-tint); color: var(--sage); }
.badge-status-cancelled { background: var(--bramble-tint); color: var(--bramble); }

/* ── Nav ───────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  max-width: var(--container);
  margin: 0 auto;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-links a:hover, .nav-links a.active { background: rgba(28,27,25,0.06); color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  position: relative;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.icon-btn:hover { background: rgba(28,27,25,0.06); }
.cart-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--bramble);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.nav-burger { display: none; }
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--canvas);
  padding: 24px;
  overflow-y: auto;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 16px 4px;
  font-size: 1.2rem;
  font-family: var(--font-display);
  border-bottom: 1px solid var(--line);
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
}

/* ── Footer ────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-col h4 { margin-bottom: 14px; }
.footer-col a { display: block; color: var(--ink-soft); font-size: 0.88rem; padding: 5px 0; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--umber);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Product grid & cards ──────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 28px 22px;
}

.product-card { display: block; cursor: pointer; }
.product-card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--line);
  margin-bottom: 14px;
}
.product-card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
}
.product-card:hover .product-card-media img { transform: scale(1.045); }
.product-card-badges {
  position: absolute; top: 12px; left: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.product-card-name {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 3px;
}
.product-card-category { font-size: 0.78rem; color: var(--umber); margin-bottom: 6px; }
.product-price-row { display: flex; align-items: baseline; gap: 8px; }
.price { font-weight: 700; }
.price-strike { color: var(--umber); text-decoration: line-through; font-size: 0.85rem; font-weight: 500; }
.price-sale { color: var(--bramble); }

/* ── Skeletons ─────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--line) 25%, var(--line-strong) 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ── Toasts ────────────────────────────────────────────────── */

.toast-stack {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 400;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  animation: toast-in 0.25s cubic-bezier(.2,.8,.2,1);
}
.toast-success { background: var(--ink); color: var(--canvas-raised); }
.toast-error { background: var(--bramble); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .toast-stack { left: 16px; right: 16px; bottom: 16px; max-width: none; } }

/* ── Animations ────────────────────────────────────────────── */

@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.animate-in { animation: fade-up 0.55s cubic-bezier(.2,.8,.2,1) both; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }

/* ── Misc ──────────────────────────────────────────────────── */

.divider { height: 1px; background: var(--line); border: none; margin: 32px 0; }
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state h3 { margin-bottom: 8px; }
.loading-spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(28,27,25,0.15);
  border-top-color: var(--ink);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-header { padding: 48px 0 32px; }
.breadcrumb { font-size: 0.82rem; color: var(--umber); margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }
