/* ==============================================
   HIDER · base.css
   Ubicacion: frontend/css/base.css
   Descripción: Estilos globales, variables de diseño y componentes reutilizables.
   Paleta oficial: #5b4234 · #fcf4e8
   ============================================== */

/* ── LuminarySerif — títulos y display ──────── */
@font-face { font-family:'LuminarySerif'; src:url('../fonts/luminary-serif/LuminarySerif-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'LuminarySerif'; src:url('../fonts/luminary-serif/LuminarySerif-Italic.ttf') format('truetype'); font-weight:400; font-style:italic; font-display:swap; }
@font-face { font-family:'LuminarySerif'; src:url('../fonts/luminary-serif/LuminarySerif-Medium.ttf') format('truetype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'LuminarySerif'; src:url('../fonts/luminary-serif/LuminarySerif-MediumItalic.ttf') format('truetype'); font-weight:500; font-style:italic; font-display:swap; }
@font-face { font-family:'LuminarySerif'; src:url('../fonts/luminary-serif/LuminarySerif-SemiBold.ttf') format('truetype'); font-weight:600; font-style:normal; font-display:swap; }
@font-face { font-family:'LuminarySerif'; src:url('../fonts/luminary-serif/LuminarySerif-SemiBoldItalic.ttf') format('truetype'); font-weight:600; font-style:italic; font-display:swap; }
@font-face { font-family:'LuminarySerif'; src:url('../fonts/luminary-serif/LuminarySerif-Bold.ttf') format('truetype'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'LuminarySerif'; src:url('../fonts/luminary-serif/LuminarySerif-BoldItalic.ttf') format('truetype'); font-weight:700; font-style:italic; font-display:swap; }
@font-face { font-family:'LuminarySerif'; src:url('../fonts/luminary-serif/LuminarySerif-ExtraBold.ttf') format('truetype'); font-weight:800; font-style:normal; font-display:swap; }
@font-face { font-family:'LuminarySerif'; src:url('../fonts/luminary-serif/LuminarySerif-ExtraBoldItalic.ttf') format('truetype'); font-weight:800; font-style:italic; font-display:swap; }
@font-face { font-family:'Luminari'; src:url('../fonts/luminary-serif/LuminarySerif-Regular.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Luminari'; src:url('../fonts/luminary-serif/LuminarySerif-Italic.ttf') format('truetype'); font-weight:400; font-style:italic; font-display:swap; }
@font-face { font-family:'Luminari'; src:url('../fonts/luminary-serif/LuminarySerif-Medium.ttf') format('truetype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'Luminari'; src:url('../fonts/luminary-serif/LuminarySerif-MediumItalic.ttf') format('truetype'); font-weight:500; font-style:italic; font-display:swap; }
@font-face { font-family:'Luminari'; src:url('../fonts/luminary-serif/LuminarySerif-SemiBold.ttf') format('truetype'); font-weight:600; font-style:normal; font-display:swap; }
@font-face { font-family:'Luminari'; src:url('../fonts/luminary-serif/LuminarySerif-SemiBoldItalic.ttf') format('truetype'); font-weight:600; font-style:italic; font-display:swap; }
@font-face { font-family:'Luminari'; src:url('../fonts/luminary-serif/LuminarySerif-Bold.ttf') format('truetype'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'Luminari'; src:url('../fonts/luminary-serif/LuminarySerif-BoldItalic.ttf') format('truetype'); font-weight:700; font-style:italic; font-display:swap; }
@font-face { font-family:'Luminari'; src:url('../fonts/luminary-serif/LuminarySerif-ExtraBold.ttf') format('truetype'); font-weight:800; font-style:normal; font-display:swap; }
@font-face { font-family:'Luminari'; src:url('../fonts/luminary-serif/LuminarySerif-ExtraBoldItalic.ttf') format('truetype'); font-weight:800; font-style:italic; font-display:swap; }

/* ── Gotham — cuerpo de texto y UI ─────────── */
@font-face { font-family:'Gotham'; src:url('../fonts/Gotham/Gotham Extra Light/Gotham Extra Light.otf') format('opentype'); font-weight:200; font-style:normal; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('../fonts/Gotham/Gotham Extra Light Italic/Gotham Extra Light Italic.otf') format('opentype'); font-weight:200; font-style:italic; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('../fonts/Gotham/Gotham Light/Gotham Light.otf') format('opentype'); font-weight:300; font-style:normal; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('../fonts/Gotham/Gotham Book/Gotham Book.otf') format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('../fonts/Gotham/Gotham Italic/Gotham Italic.otf') format('opentype'); font-weight:400; font-style:italic; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('../fonts/Gotham/Gotham Medium/Gotham Medium.otf') format('opentype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('../fonts/Gotham/Gotham Bold/Gotham Bold.otf') format('opentype'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('../fonts/Gotham/Gotham Bold Italic/Gotham Bold Italic.ttf') format('truetype'); font-weight:700; font-style:italic; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('../fonts/Gotham/Gotham Black/Gotham Black.otf') format('opentype'); font-weight:900; font-style:normal; font-display:swap; }

:root {
  /* ── Paleta de marca ── */
  --brown:        #5b4234;
  --brown-deep:   #3e2a1e;
  --brown-mid:    #7a5a48;
  --brown-light:  #a07060;
  --cream:        #fcf4e8;
  --cream-soft:   #fefaf4;
  --cream-dark:   #f0e0c8;
  --gold:         #b8865a;
  --gold-light:   #d4a87a;

  /* ── Neutros ── */
  --ink:          #1e1208;
  --muted:        #8a6a58;
  --line:         #e8d4bc;
  --line-soft:    #f0e4d4;
  --white:        #ffffff;
  --sale:         #c0432a;
  --success:      #4a7a3e;

  /* ── Superficies ── */
  --bg:           var(--cream-soft);
  --bg-soft:      var(--cream);
  --bg-dark:      var(--cream-dark);
  --surface:      var(--white);
  --text:         var(--ink);
  --text-mute:    var(--muted);
  --border:       var(--line);
  --brand:        var(--brown);

  /* ── Tipografía ── */
  --font-display: 'Luminari', 'LuminarySerif', serif;
  --font-serif:   var(--font-display);
  --font-body:    'Gotham', system-ui, sans-serif;

  /* ── Espaciado ── */
  --r-xs:  4px;
  --r-sm:  8px;
  --r:     14px;
  --r-lg:  22px;
  --r-xl:  32px;

  /* ── Sombras ── */
  --shadow-xs: 0 2px 8px rgba(62, 42, 30, 0.06);
  --shadow-sm: 0 4px 16px rgba(62, 42, 30, 0.08);
  --shadow:    0 12px 40px rgba(62, 42, 30, 0.12);
  --shadow-lg: 0 24px 64px rgba(62, 42, 30, 0.18);

  /* ── Layout ── */
  --container:  1320px;
  --header-h:   72px;
  --section-py: clamp(64px, 10vw, 120px);

  /* ── Transiciones ── */
  --ease:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --duration:   0.25s;
  --duration-lg: 0.45s;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: 0;
  word-spacing: -0.12em;
  color: var(--text);
  margin: 0;
}

p { margin: 0; }
ul { list-style: none; }

::selection {
  background: var(--brown);
  color: var(--cream);
}

/* ── Layout ─────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
}

/* ── Botones ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1.5px solid transparent;
  transition:
    background var(--duration) var(--ease),
    color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    transform 0.15s var(--ease),
    box-shadow var(--duration) var(--ease);
  cursor: pointer;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brown);
  color: var(--cream);
  box-shadow: 0 6px 24px rgba(91, 66, 52, 0.28);
}
.btn-primary:hover {
  background: var(--brown-deep);
  box-shadow: 0 8px 32px rgba(91, 66, 52, 0.38);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--brown);
  color: var(--brown);
}

.btn-cream {
  background: var(--cream);
  color: var(--brown-deep);
}
.btn-cream:hover { background: var(--cream-dark); }

.btn-dark {
  background: var(--ink);
  color: var(--cream);
}

.btn-link {
  padding: 0;
  background: none;
  border: none;
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 4px;
  letter-spacing: 0;
  font-size: inherit;
}

.btn-sm { padding: 10px 20px; font-size: 12px; }
.btn-lg { padding: 18px 36px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Formularios ─────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label,
.field-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 560px) {
  .fields-row { grid-template-columns: 1fr; }
}

.input, .textarea, .select {
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(91, 66, 52, 0.08);
}

.input--error {
  border-color: var(--sale) !important;
  box-shadow: 0 0 0 3px rgba(192, 67, 42, 0.08) !important;
}

.input--ok {
  border-color: var(--success) !important;
}

/* ── Phone input con bandera ─────────────────── */
.phone-input-group {
  display: flex;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
  transition: border-color var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.phone-input-group:focus-within {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(91,66,52,0.08);
}

.phone-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: var(--cream-soft, #f7f1ea);
  border-right: 1.5px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.phone-flag-emoji { font-size: 20px; line-height: 1; }
.phone-code       { font-weight: 700; color: var(--ink); }

.phone-number-input {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 14px 14px !important;
  min-width: 0;
}

.phone-number-input:focus {
  outline: none;
  border: none !important;
  box-shadow: none !important;
}

.field-required { color: var(--sale); }

/* Mensaje de error inline generado por FormValidator */
.field-error-msg {
  font-size: 11.5px;
  color: var(--sale);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: errorIn 0.2s ease;
}

.field-error-msg::before {
  content: '!';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sale);
  color: white;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}

@keyframes errorIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.field-error {
  font-size: 12px;
  color: var(--sale);
}
.field-hint {
  font-size: 12px;
  color: var(--muted);
}

/* ── Eyebrow ─────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

/* ── Precio ──────────────────────────────────── */
.price {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.price-was {
  text-decoration: line-through;
  color: #6f6258;
  font-size: 13px;
  font-weight: 400;
}

.price-off {
  font-size: 11px;
  font-weight: 600;
  background: var(--sale);
  color: white;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  letter-spacing: 0.04em;
}

.product-price,
.price-main,
.cart-item__price,
.cart-row__price,
.cart-row__total,
.summary-item__price,
.search-item__price,
.hero-floater__price,
.launch-card__price,
.nivel-stat__n,
#summarySubtotal,
#summarySavings,
#summaryShipping,
#summaryDiscount,
#summaryIgv,
#summaryTotal {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ── Stars ───────────────────────────────────── */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--gold);
}

.stars svg {
  width: 14px;
  height: 14px;
}

.stars-lg svg {
  width: 18px;
  height: 18px;
}

/* ── Badge / Chip ────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-xs);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-sale    { background: var(--sale);   color: white; }
.badge-new     { background: var(--ink);    color: var(--cream); }
.badge-best    { background: var(--brown);  color: var(--cream); }
.badge-success { background: var(--success); color: white; }

/* ── Divider ─────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* ── Skeleton ────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--cream-dark) 0%,
    var(--line) 50%,
    var(--cream-dark) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast ───────────────────────────────────── */
#toasts {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: rgba(255,255,255,.96);
  color: var(--ink);
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 14px 38px rgba(28,28,46,.12);
  min-width: 240px;
  max-width: min(340px, calc(100vw - 36px));
  animation: toastIn 0.25s var(--ease-out);
  pointer-events: auto;
}

.toast__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.toast__icon svg {
  width: 15px;
  height: 15px;
}

.toast-success .toast__icon { background: rgba(22,163,74,.10); color: var(--success); }
.toast-error .toast__icon   { background: rgba(192,57,43,.10); color: var(--sale); }
.toast-warning .toast__icon { background: rgba(245,158,11,.12); color: #b45309; }
.toast-info .toast__icon,
.toast-default .toast__icon { background: rgba(107,74,55,.10); color: var(--brown); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-10px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Utilidades ──────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-brown  { color: var(--brown); }
.text-sale   { color: var(--sale); }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.hidden { display: none !important; }

@media (max-width: 768px) {
  .hidden-mobile  { display: none !important; }
}
@media (min-width: 769px) {
  .hidden-desktop { display: none !important; }
}

/* ── Page transition ─────────────────────────── */
.page-enter {
  animation: pageIn 0.4s var(--ease-out);
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section head ────────────────────────────── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
  gap: 24px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════
   DARK MODE
   Activado con: <html data-theme="dark">
   Respeta prefers-color-scheme si no hay
   preferencia guardada en localStorage.
   ══════════════════════════════════════════════ */

[data-theme="dark"] {
  /* ── Superficies ── */
  --bg:           #0f0c0a;
  --bg-soft:      #161210;
  --bg-dark:      #080604;
  --surface:      #1c1714;
  --surface-2:    #241d19;

  /* ── Texto ── */
  --text:         #ede8e0;
  --text-mute:    #8a7d72;

  /* ── Bordes y líneas ── */
  --border:       #2e2620;
  --line:         #2e2620;
  --line-soft:    #241c18;

  /* ── Sombras (más oscuras y cálidas) ── */
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow:    0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);

  /* ── Mantener brand ── */
  --brand:        var(--gold-light);
  --muted:        #7a6e64;
  --cream:        #ede8e0;
  --cream-soft:   #1c1714;
  --cream-dark:   #2e2620;
  --white:        #1c1714;
  --ink:          #ede8e0;
}

/* ── Transición suave al cambiar tema ── */
html {
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* ── Componentes que usan colores fijos ── */

/* Body */
[data-theme="dark"] body {
  color: var(--text);
  background: var(--bg);
}

/* Header */
[data-theme="dark"] .header-inner {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

[data-theme="dark"] .promo-strip {
  background: var(--surface-2);
}

/* Inputs y formularios */
[data-theme="dark"] .input,
[data-theme="dark"] .textarea,
[data-theme="dark"] .select {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

[data-theme="dark"] .input::placeholder,
[data-theme="dark"] .textarea::placeholder {
  color: var(--muted);
}

/* Product card */
[data-theme="dark"] .pc-media {
  background: var(--surface);
}

[data-theme="dark"] .pc-name,
[data-theme="dark"] .pc-body {
  color: var(--text);
}

/* Skeleton en dark */
[data-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 0%,
    var(--surface-2) 50%,
    var(--surface) 100%
  );
  background-size: 200% 100%;
}

/* Toasts */
[data-theme="dark"] .toast {
  background: #2e2420;
  color: #ede8e0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

/* Footer */
[data-theme="dark"] .site-footer {
  background: #090706;
  border-top: 1px solid var(--line);
}

/* Cart drawer */
[data-theme="dark"] .cart-drawer {
  background: var(--surface);
  border-left: 1px solid var(--line);
}

[data-theme="dark"] .cart-scrim { background: rgba(0,0,0,0.7); }

/* Modal */
[data-theme="dark"] .modal {
  background: var(--surface);
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0,0,0,0.75);
}

/* Breadcrumb */
[data-theme="dark"] .breadcrumb a { color: var(--muted); }
[data-theme="dark"] .breadcrumb .current { color: var(--text); }

/* Page hero */
[data-theme="dark"] .page-hero {
  background: var(--surface);
}

/* Sección crema */
[data-theme="dark"] .section-cream {
  background: var(--surface);
}

/* Filtros catálogo */
[data-theme="dark"] .filters {
  background: var(--surface);
}

[data-theme="dark"] .filter-group__title {
  color: var(--text);
}

/* Cart summary */
[data-theme="dark"] .cart-summary-box {
  background: var(--surface);
}

/* Mobile drawer */
[data-theme="dark"] .mobile-drawer {
  background: var(--surface);
}

/* Search overlay — estilos en layout.css */

/* Auth — estilos completos en auth.css */

/* Dark mode toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition:
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--surface);
  border-color: var(--brown);
  color: var(--brown);
}

.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Sistema de colores automático ── */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg:           #0f0c0a;
    --bg-soft:      #161210;
    --bg-dark:      #080604;
    --surface:      #1c1714;
    --surface-2:    #241d19;
    --text:         #ede8e0;
    --text-mute:    #8a7d72;
    --border:       #2e2620;
    --line:         #2e2620;
    --line-soft:    #241c18;
    --shadow-xs:    0 2px 8px rgba(0,0,0,0.3);
    --shadow-sm:    0 4px 16px rgba(0,0,0,0.4);
    --shadow:       0 12px 40px rgba(0,0,0,0.5);
    --shadow-lg:    0 24px 64px rgba(0,0,0,0.6);
    --brand:        var(--gold-light);
    --muted:        #7a6e64;
    --cream:        #ede8e0;
    --cream-soft:   #1c1714;
    --cream-dark:   #2e2620;
    --white:        #1c1714;
    --ink:          #ede8e0;
  }
}
