/* Anchal Garments — Premium design tokens & base components */

:root {
  /* Neutral slate backdrop */
  --ink: #0f172a;
  --graphite: #334155;
  --blueprint: #0a3d62;
  --blueprint-deep: #062a44;
  --chalk: #f8fafc;
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --grid-line: rgba(15, 23, 42, 0.035);
  --kraft: #a67c52;
  --kraft-deep: #5f3f22;
  --signal: #c81d25;
  --signal-deep: #9e151c;
  --muted: #475569;
  --muted-soft: #64748b;
  --line: rgba(15, 23, 42, 0.1);
  --on-dark: #f8fafc;
  --on-dark-muted: #e2e8f0;
  --success: #1f6b4a;
  --serif: "Syne", "Segoe UI", sans-serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;

  /* Radius scale */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Ambient shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 8px 32px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-focus: 0 0 0 3px rgba(10, 61, 98, 0.16);

  /* Typography rhythm */
  --leading-tight: 1.25;
  --leading-normal: 1.65;
  --leading-relaxed: 1.75;
  --leading-loose: 1.85;

  /* Spacing */
  --space-section: clamp(3rem, 6vw, 5.5rem);
  --space-block: clamp(1.25rem, 3vw, 2rem);
  --container-gutter: clamp(1.25rem, 4vw, 2.5rem);
  --dock-offset: 88px;

  /* Motion */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Legacy aliases */
  --ts-charcoal: var(--graphite);
  --ts-ink: var(--ink);
  --ts-paper: var(--paper);
  --ts-surface: var(--surface-muted);
  --ts-surface-2: #e2e8f0;
  --ts-muted: var(--muted);
  --ts-line: var(--line);
  --ts-wine: var(--signal);
  --ts-wine-dark: var(--signal-deep);
  --ts-gold: var(--kraft);
  --ts-gold-pale: #f0e2d0;
  --ts-grove: var(--blueprint);
  --ts-grove-deep: var(--blueprint-deep);
  --ts-mist: var(--chalk);
  --ts-success: var(--success);
  --font-body: var(--sans);
  --font-display: var(--serif);
  --night: var(--blueprint-deep);
  --plum: var(--blueprint);
  --saffron: var(--signal);
  --saffron-deep: var(--signal-deep);
  --sand: var(--chalk);
  --mist: #e2e8f0;
  --clay: var(--kraft);
  --clay-ink: var(--kraft-deep);
  --fog: var(--surface-muted);
  --saffron-ink: var(--signal-deep);
}

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

body.a55-store {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--ink);
  background-color: var(--chalk);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(10, 61, 98, 0.06), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--chalk) 40%, #eef2f7 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
::placeholder { color: var(--muted-soft); opacity: 1; }

input, select, textarea {
  color: var(--ink);
  background: var(--paper);
  caret-color: var(--ink);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.container {
  width: min(1200px, calc(100% - var(--container-gutter) * 2));
  margin-inline: auto;
}

.page-wrap { min-height: 100vh; display: flex; flex-direction: column; position: relative; }
.page-main { flex: 1; padding-bottom: var(--space-block); }

/* Typography hierarchy */
h1, h2, h3, h4, .a55-serif {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: var(--leading-tight);
}

h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.85rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 650; }

p { line-height: var(--leading-relaxed); }

/* Buttons */
.a55-btn, .ts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--blueprint);
  color: var(--on-dark);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background var(--transition),
    color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.a55-btn:hover, .ts-btn:hover {
  background: var(--blueprint-deep);
  color: var(--on-dark);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow);
}

.a55-btn:active, .ts-btn:active {
  transform: translateY(0) scale(0.98);
}

.a55-btn-ghost, .ts-btn-outline {
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.a55-btn-ghost:hover, .ts-btn-outline:hover {
  background: var(--surface-muted);
  color: var(--blueprint);
  border-color: rgba(10, 61, 98, 0.2);
}

.a55-btn-saffron, .a55-btn-signal {
  background: var(--signal);
  color: #fff;
}

.a55-btn-saffron:hover, .a55-btn-signal:hover {
  background: var(--signal-deep);
  color: #fff;
}

.a55-btn:focus-visible, .ts-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Cards */
.a55-card {
  background: var(--paper);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.a55-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.a55-card-media {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface-muted);
  overflow: hidden;
}

.a55-card-media img { width: 100%; height: 100%; object-fit: cover; }

.a55-card-seal {
  position: absolute; top: 12px; right: 12px;
  background: var(--signal);
  color: #fff;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--radius-full);
}

.a55-card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.a55-card-aisle {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.a55-card-body h3 { margin: 0; font-size: 1.05rem; line-height: var(--leading-tight); font-weight: 650; }
.a55-card-body h3 a { color: var(--ink); }
.a55-card-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; }
.a55-card-price { font-weight: 700; color: var(--blueprint); font-size: 1.05rem; }
.a55-card-sku { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; font-weight: 500; }

.a55-product-grid, .ts-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 24px);
}

/* Utility text */
.empty-state { padding: var(--space-section) var(--space-block); text-align: center; color: var(--ink); }
.empty-state .sub { color: var(--muted); line-height: var(--leading-relaxed); }

.a55-kicker {
  margin: 0 0 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--blueprint);
  font-weight: 700;
}

.a55-lede {
  font-size: 1.0625rem;
  line-height: var(--leading-loose);
  max-width: 48ch;
  color: var(--graphite);
  font-weight: 400;
}

.a55-fine { color: var(--muted); font-size: 0.875rem; line-height: var(--leading-relaxed); }
.a55-split { display: grid; gap: var(--space-block); }

/* Alerts & notices */
.notice, .a55-loading {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: var(--space-block);
  color: var(--ink);
  line-height: var(--leading-relaxed);
  box-shadow: var(--shadow-xs);
}

.a55-alert {
  background: #fef2f2;
  color: #991b1b;
  padding: 16px 18px;
  border-radius: var(--radius);
  margin-bottom: var(--space-block);
  border: 1px solid rgba(200, 29, 37, 0.12);
  line-height: var(--leading-relaxed);
}

.a55-ok { background: #ecfdf5; color: #166534; border-radius: var(--radius); }

.a55-pass label { display: grid; gap: 8px; margin-bottom: 14px; font-weight: 600; font-size: 0.875rem; }
.a55-pass .a55-btn { width: 100%; }

/* Toast */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  max-width: min(380px, calc(100vw - 32px));
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--on-dark);
  border-left: 4px solid var(--signal);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: var(--shadow-lg);
  line-height: var(--leading-relaxed);
}

.toast.is-visible, .toast.visible {
  opacity: 1; pointer-events: auto;
  transform: translateY(0);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--signal); }

@media (max-width: 980px) {
  .a55-product-grid, .ts-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .a55-product-grid, .ts-product-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .a55-btn, .ts-btn, .a55-card, .toast {
    transition: none !important;
  }
  .a55-btn:hover, .ts-btn:hover, .a55-card:hover {
    transform: none !important;
  }
}
