/* ==========================================================================
   BASE.CSS — Design Tokens, Typography, Buttons, Utilities
   Artesanía Domenech · Sistema visual profesional
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS (Custom Properties)
   -------------------------------------------------------------------------- */
:root {

  /* --- COLOR PALETTE: Warm Amber & Cream --- */
  --amber-50:   #fdf9f0;
  --amber-100:  #f9eed6;
  --amber-200:  #f2d9a2;
  --amber-300:  #e8c070;
  --amber-400:  #dca448;
  --amber-500:  #c47a20;   /* primary brand */
  --amber-600:  #a56019;
  --amber-700:  #7d4612;
  --amber-800:  #4f2b0b;
  --amber-900:  #271505;

  /* Warm neutrals */
  --cream-50:  #fdfaf3;
  --cream-100: #f9f3e5;
  --cream-200: #f2e8d1;
  --cream-300: #e5d2b0;
  --cream-400: #c9ad84;
  --cream-800: #3a2212;
  --cream-900: #1a0f06;

  /* Semantic color roles */
  --bg:            #f5ecde;
  --bg-soft:       #efe3d0;
  --bg-warm:       #fbf4e8;
  --surface:       #fffaf2;
  --surface-raised: #fffdf8;
  --surface-overlay: rgba(253, 250, 243, 0.95);

  --ink:         #211306;
  --ink-soft:    #52331b;
  --ink-muted:   #7f5d45;
  --ink-subtle:  #a88568;

  --primary:        #c9781f;
  --primary-strong: #9d5816;
  --primary-light:  #efbe64;
  --primary-soft:   rgba(196, 122, 32, 0.14);
  --primary-glow:   rgba(196, 122, 32, 0.22);

  --accent:       #8c4a1e;
  --accent-soft:  rgba(140, 74, 30, 0.1);

  --success:     #2a7a4e;
  --danger:      #b54038;
  --wa:          #22c55e;
  --wa-hover:    #16a34a;

  --border:      rgba(100, 65, 30, 0.12);
  --border-soft: rgba(100, 65, 30, 0.07);
  --border-warm: rgba(196, 122, 32, 0.2);

  /* Storefront overlay palette (used in storefront.css) */
  --store-ink:    #1c1108;
  --store-muted:  #7a5640;
  --store-accent: #c47a20;
  --store-accent-strong: #a56019;
  --store-accent-soft:   rgba(196, 122, 32, 0.14);
  --store-gold:   #f0c872;
  --store-border: rgba(100, 65, 30, 0.12);
  --store-bg:     #f6eed9;
  --store-surface: rgba(253, 250, 243, 0.9);

  /* --- SPACING SCALE (4px grid) --- */
  --sp-1:  0.25rem;   /* 4px  */
  --sp-2:  0.5rem;    /* 8px  */
  --sp-3:  0.75rem;   /* 12px */
  --sp-4:  1rem;      /* 16px */
  --sp-5:  1.25rem;   /* 20px */
  --sp-6:  1.5rem;    /* 24px */
  --sp-8:  2rem;      /* 32px */
  --sp-10: 2.5rem;    /* 40px */
  --sp-12: 3rem;      /* 48px */
  --sp-16: 4rem;      /* 64px */
  --sp-20: 5rem;      /* 80px */
  --sp-24: 6rem;      /* 96px */
  --sp-32: 8rem;      /* 128px */

  /* Section padding: Desktop → Mobile (via responsive.css) */
  --section-py:  5.5rem;
  --hero-pt:     7rem;
  --hero-pb:     5rem;

  /* --- TYPOGRAPHY --- */
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:  'Manrope', system-ui, -apple-system, sans-serif;

  /* Fluid type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  1.875rem;
  --text-3xl:  2.375rem;
  --text-4xl:  3rem;
  --text-5xl:  4rem;

  --h1: clamp(2.75rem, 5.5vw + 0.75rem, 5.5rem);
  --h2: clamp(1.9rem,  3.5vw + 0.5rem,  3.8rem);
  --h3: clamp(1.3rem,  2vw   + 0.15rem, 2rem);
  --lead-size: clamp(1.05rem, 1.5vw + 0.15rem, 1.22rem);

  /* Line heights */
  --lh-tight:  1.05;
  --lh-snug:   1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;
  --lh-loose:  1.85;

  /* Letter spacing */
  --ls-tight: -0.025em;
  --ls-normal: 0;
  --ls-wide:   0.04em;
  --ls-wider:  0.1em;
  --ls-widest: 0.22em;

  /* --- SHADOWS (warm brown undertone) --- */
  --shadow-xs: 0 1px 4px rgba(45, 24, 7, 0.05);
  --shadow-sm: 0 4px 16px rgba(45, 24, 7, 0.07), 0 1px 4px rgba(45, 24, 7, 0.04);
  --shadow-md: 0 10px 30px rgba(45, 24, 7, 0.1),  0 3px 10px rgba(45, 24, 7, 0.05);
  --shadow-lg: 0 22px 56px rgba(45, 24, 7, 0.13), 0 8px 20px rgba(45, 24, 7, 0.07);
  --shadow-xl: 0 40px 80px rgba(45, 24, 7, 0.16), 0 14px 36px rgba(45, 24, 7, 0.09);
  --shadow-primary: 0 8px 26px rgba(196, 122, 32, 0.32);
  --shadow-primary-lg: 0 16px 42px rgba(196, 122, 32, 0.38);
  --shadow-wa: 0 8px 28px rgba(34, 197, 94, 0.36);
  --shadow-wa-lg: 0 16px 42px rgba(34, 197, 94, 0.42);

  /* Storefront alias */
  --store-shadow:      var(--shadow-xl);
  --store-shadow-soft: var(--shadow-md);

  /* --- BORDER RADII --- */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   22px;
  --r-xl:   32px;
  --r-2xl:  42px;
  --r-pill: 999px;

  /* Alias for old code */
  --radius-sm: var(--r-lg);
  --radius-md: var(--r-xl);
  --radius-lg: var(--r-2xl);

  /* --- TRANSITIONS --- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:   0.15s;
  --t-base:   0.24s;
  --t-slow:   0.42s;

  /* --- LAYOUT --- */
  --container: 1200px;
  --container-sm: 860px;
  --container-xs: 640px;
  --gutter: clamp(1rem, 3vw, 2rem);
}

/* --------------------------------------------------------------------------
   2. BASE ELEMENT STYLES
   -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  overflow-x: hidden;
}

body.modal-open,
body.nav-open {
  overflow: hidden;
}

/* --- Headings --- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
}

h1 { font-size: var(--h1); line-height: 0.96; }
h2 { font-size: var(--h2); line-height: 1.0; }
h3 { font-size: var(--h3); line-height: 1.12; }
h4 { font-size: clamp(1.15rem, 1.5vw, 1.45rem); line-height: 1.2; }

/* Refinement: italic variant for emotional emphasis */
.h-italic { font-style: italic; }

p {
  color: var(--ink-soft);
  line-height: var(--lh-relaxed);
}

p + p {
  margin-top: 0.9em;
}

strong { color: var(--ink); font-weight: 700; }
/* --- Utilities --- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  color: var(--primary);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
}

.lead {
  font-size: var(--lead-size);
  line-height: var(--lh-relaxed);
  color: var(--ink-soft);
  max-width: 60ch;
}

.text-balance { text-wrap: balance; }
.text-center  { text-align: center; }

/* --- Icons --- */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.icon svg { width: 100%; height: 100%; }

/* --------------------------------------------------------------------------
   3. BUTTON SYSTEM
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 3rem;
  padding: 0 var(--sp-6);
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--t-base) var(--ease-out),
    border-color     var(--t-base) var(--ease-out),
    color            var(--t-base) var(--ease-out),
    transform        0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow       var(--t-base) var(--ease-out);
}

.button:hover   { transform: translateY(-3px); }
.button:active  { transform: translateY(0); transition-duration: var(--t-fast); }
.button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Primary */
.button--primary {
  background: linear-gradient(135deg, var(--primary) 0%, #e0ad4c 100%);
  color: #1c0e04;
  box-shadow: 0 8px 24px rgba(196, 122, 32, 0.3), 0 2px 8px rgba(196, 122, 32, 0.15);
}
.button--primary:hover {
  background: linear-gradient(135deg, var(--primary-strong) 0%, var(--primary) 60%, #d89c3a 100%);
  box-shadow: 0 14px 36px rgba(196, 122, 32, 0.4), 0 4px 12px rgba(196, 122, 32, 0.2);
}
.button--primary:active { box-shadow: 0 4px 12px rgba(196, 122, 32, 0.2); }
/* Secondary / Ghost */
.button--secondary,
.button--ghost {
  border-color: rgba(100, 65, 30, 0.18);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.button--secondary:hover,
.button--ghost:hover {
  border-color: rgba(196, 122, 32, 0.3);
  background: rgba(255, 252, 244, 0.95);
  box-shadow: 0 6px 20px rgba(45, 24, 7, 0.08);
}
/* Small */
.button--small {
  height: 2.6rem;
  padding: 0 var(--sp-5);
  font-size: var(--text-xs);
}

/* Large */
.button--large {
  height: 3.5rem;
  padding: 0 var(--sp-8);
  font-size: var(--text-base);
}

/* WhatsApp */
.button--whatsapp {
  background: var(--wa);
  color: #fff;
  box-shadow: var(--shadow-wa);
  border: none;
}
.button--whatsapp:hover {
  background: var(--wa-hover);
  box-shadow: var(--shadow-wa-lg);
}
.button--whatsapp-block {
  width: 100%;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   4. BADGE SYSTEM
   -------------------------------------------------------------------------- */
.badge {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  padding: 0.35rem 0.7rem;
  border-radius: var(--r-pill);
  background: rgba(28, 17, 8, 0.75);
  color: #fff8ee;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  z-index: 1;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.38rem 0.68rem;
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-soft--warning {
  background: rgba(196, 122, 32, 0.16);
  color: #a46f31;
}
.badge-soft--success {
  background: rgba(42, 122, 78, 0.14);
  color: #1a5c35;
}
.badge-soft--info {
  background: rgba(52, 90, 171, 0.12);
  color: #24478a;
}
.badge-soft--danger {
  background: rgba(181, 64, 56, 0.12);
  color: #8e2f24;
}

/* --------------------------------------------------------------------------
   5. UTILITY CLASSES
   -------------------------------------------------------------------------- */
.empty-state {
  width: 100%;
  padding: var(--sp-12) var(--sp-6);
  border: 1px dashed var(--border);
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
}
.empty-state h3,
.empty-state h2 { margin-bottom: var(--sp-3); }

/* Divider */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  border: 0;
  margin: 0;
}

/* Price display */
.price-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.price-row strong {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary-strong);
  font-family: var(--font-serif);
}
.price-row span {
  font-size: var(--text-sm);
  text-decoration: line-through;
  color: var(--ink-subtle);
}
.price-row--large strong {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

/* Focus ring (global fallback) */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* Feature list */
.feature-list {
  display: grid;
  gap: var(--sp-3);
}
.feature-list li {
  position: relative;
  padding-left: var(--sp-5);
  color: var(--ink-soft);
}
.feature-list li::before {
  content: '';
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* Button row / actions */
.button-row,
.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
