/* =========================================================================
   Dastaan by Palak — Design System
   Palette derived from the brand logo: deep teal ground, rose-gold accent,
   a soft ivory for content surfaces. Display type is a high-contrast serif
   (echoes the logo's script wordmark); body type is a light, wide-set sans
   for calm readability against the jewel-tone palette.
   Signature element: a thin flowing "drape" divider (an SVG curve that
   echoes the sari silhouette in the logo) used between major sections.
   ========================================================================= */

:root {
  --teal-950: #0a2e2e;
  --teal-900: #0d3b3b;
  --teal-800: #124d4d;
  --teal-100: #e4efee;
  --rose-500: #c9a267;
  --rose-600: #b98a4c;
  --rose-100: #f3e6d2;
  --ivory: #faf7f2;
  --ink: #221f1a;
  --ink-soft: #5c574e;
  --line: #e7e0d4;
  --error: #a33d3d;
  --success: #2f6b4f;

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Jost', 'Helvetica Neue', Arial, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  --space-7: 96px;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 14px;

  --shadow-card: 0 2px 18px rgba(10, 46, 46, 0.08);
  --shadow-lift: 0 12px 32px rgba(10, 46, 46, 0.16);
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: local('Cormorant Garamond');
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--teal-900);
  margin: 0 0 var(--space-3);
  letter-spacing: 0.2px;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.05; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 var(--space-3); color: var(--ink-soft); }
a { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--rose-600);
  font-weight: 500;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-4); }
.section { padding: var(--space-7) 0; }
.section--tight { padding: var(--space-6) 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:focus-visible { outline: 2px solid var(--rose-500); outline-offset: 2px; }
.btn-primary { background: var(--teal-900); color: var(--rose-100); }
.btn-primary:hover { background: var(--teal-800); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--teal-900); color: var(--teal-900); }
.btn-outline:hover { background: var(--teal-900); color: var(--rose-100); }
.btn-rose { background: var(--rose-500); color: var(--teal-950); }
.btn-rose:hover { background: var(--rose-600); }
.btn-text { background: none; border: none; color: var(--teal-900); text-decoration: underline; padding: 4px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-block { width: 100%; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--space-4); max-width: 1180px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.5rem; color: var(--teal-900); }
.brand img { height: 40px; width: 40px; border-radius: 50%; object-fit: cover; }
.main-nav { display: flex; gap: var(--space-4); }
.main-nav a { font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); }
.main-nav a:hover { color: var(--rose-600); }
.header-icons { display: flex; align-items: center; gap: var(--space-3); }
.icon-btn { position: relative; background: none; border: none; cursor: pointer; color: var(--teal-900); padding: 6px; }
.icon-badge {
  position: absolute; top: -2px; right: -2px; background: var(--rose-500); color: var(--teal-950);
  font-size: 0.65rem; font-weight: 700; border-radius: 50%; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}
.mobile-nav-toggle { display: none; background: none; border: none; cursor: pointer; }

@media (max-width: 820px) {
  .main-nav { display: none; }
  .mobile-nav-toggle { display: block; }
}

/* Signature drape divider */
.drape-divider { width: 100%; height: 48px; display: block; color: var(--rose-500); }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--teal-950), var(--teal-900) 60%);
  color: var(--rose-100);
  padding: var(--space-7) 0 var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero h1 { color: var(--rose-100); }
.hero p.lead { color: rgba(243, 230, 210, 0.82); max-width: 560px; margin: 0 auto var(--space-4); font-size: 1.05rem; }
.hero .eyebrow { color: var(--rose-500); }

/* Cards */
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.product-card {
  background: #fff; border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-card); transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.product-card__image { aspect-ratio: 3/4; background: var(--teal-100) center/cover no-repeat; position: relative; }
.product-card__badge {
  position: absolute; top: 10px; left: 10px; background: var(--rose-500); color: var(--teal-950);
  font-size: 0.65rem; letter-spacing: 1px; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; font-weight: 600;
}
.product-card__body { padding: var(--space-3); flex: 1; display: flex; flex-direction: column; gap: 4px; }
.product-card__name { font-family: var(--font-display); font-size: 1.15rem; color: var(--teal-900); }
.product-card__price { color: var(--rose-600); font-weight: 600; }
.product-card__compare { text-decoration: line-through; color: var(--ink-soft); font-size: 0.85rem; margin-left: 6px; }
.product-card__oos { color: var(--error); font-size: 0.8rem; font-weight: 600; }

.card { background: #fff; border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow-card); }

/* Forms */
.field { margin-bottom: var(--space-3); text-align: left; }
.field label { display: block; font-size: 0.82rem; letter-spacing: 0.5px; color: var(--teal-900); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--rose-500); outline-offset: 1px; border-color: var(--rose-500); }
.field-error { color: var(--error); font-size: 0.8rem; margin-top: 4px; }

/* Auto-applied by formValidation.js — every empty required field or
   invalid entry (bad email, etc.) gets this treatment across the whole
   app, on submit attempt and live as the person fixes it. */
.field-invalid {
  border-color: var(--error) !important;
  background: #fef8f8;
  box-shadow: 0 0 0 1px var(--error);
}
.field-error-msg {
  color: var(--error);
  font-size: 0.78rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.field-error-msg::before {
  content: "⚠";
  font-size: 0.75rem;
}
.field-row { display: flex; gap: var(--space-3); }
.field-row .field { flex: 1; }
@media (max-width: 560px) { .field-row { flex-direction: column; } }

/* iOS Safari auto-zooms the page on focusing any input under 16px font
   size — this affects every input on the site, not just ones inside
   .field wrappers (e.g. inline admin-table edit inputs), so it's global. */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
}

.alert { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: var(--space-3); font-size: 0.9rem; }
.alert-error { background: #fbeaea; color: var(--error); border: 1px solid #f0cccc; }
.alert-success { background: #eaf5ee; color: var(--success); border: 1px solid #cde8d8; }
.alert-info { background: var(--teal-100); color: var(--teal-900); border: 1px solid #cfe3e1; }

.empty-state { text-align: center; padding: var(--space-6) var(--space-3); color: var(--ink-soft); }
.loading-state { text-align: center; padding: var(--space-6) var(--space-3); color: var(--ink-soft); }

/* Footer */
.site-footer { background: var(--teal-950); color: rgba(243, 230, 210, 0.75); padding: var(--space-6) 0 var(--space-4); margin-top: var(--space-7); }
.site-footer h4 { color: var(--rose-100); font-size: 1rem; }
.site-footer a { color: rgba(243, 230, 210, 0.75); }
.site-footer a:hover { color: var(--rose-500); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-4); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: var(--space-5); padding-top: var(--space-3); font-size: 0.8rem; text-align: center; }

/* Cart drawer */
.cart-drawer {
  position: fixed; top: 0; right: -420px; width: min(420px, 100vw); height: 100vh; background: #fff;
  box-shadow: -10px 0 30px rgba(0,0,0,0.15); z-index: 100; transition: right 0.25s ease; display: flex; flex-direction: column;
}
.cart-drawer.open { right: 0; }
.cart-drawer__header { padding: var(--space-4); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.cart-drawer__items { flex: 1; overflow-y: auto; padding: var(--space-3) var(--space-4); }
.cart-drawer__footer { padding: var(--space-4); border-top: 1px solid var(--line); }
.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 64px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); background: var(--teal-100); }
.cart-line__info { flex: 1; }
.cart-line__qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cart-line__qty button { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; }
.overlay { position: fixed; inset: 0; background: rgba(10,46,46,0.4); z-index: 90; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.overlay.open { opacity: 1; pointer-events: auto; }

/* Badges / misc */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-teal { background: var(--teal-100); color: var(--teal-900); }
.badge-rose { background: var(--rose-100); color: var(--rose-600); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--teal-900); color: #fff; padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 10px; top: 10px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
