/* CasaDensueños — sistema visual (dorado del logo + crema + tinta cálida) */
:root {
  --gold: #b8913a;
  --gold-600: #9c7a2c;
  --gold-700: #7d6122;
  --gold-300: #d9bf7f;
  --gold-100: #f3e9cf;
  --gold-50: #faf5e8;
  --cream: #fdfaf4;
  --paper: #ffffff;
  --ink: #2a231c;
  --ink-2: #5b5047;
  --ink-3: #8f8378;
  --line: #ece4d6;
  --line-2: #e2d7c3;
  --rose: #e9b9bd;
  --rose-50: #fbeff0;
  --sage: #8fa58a;
  --green: #2f8a57;
  --green-50: #e7f4ec;
  --red: #c8483f;
  --red-50: #fbecea;
  --amber: #c98a12;
  --amber-50: #fdf3df;
  --blue: #3c6fb6;
  --wa: #25d366;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(42, 35, 28, .06), 0 1px 3px rgba(42, 35, 28, .05);
  --shadow: 0 6px 24px -8px rgba(42, 35, 28, .14), 0 2px 6px rgba(42, 35, 28, .05);
  --shadow-lg: 0 24px 60px -20px rgba(42, 35, 28, .30);
  --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--cream);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
.serif { font-family: var(--serif); font-weight: 600; letter-spacing: .2px; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Botones ── */
.btn {
  --bg: var(--paper); --fg: var(--ink); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 44px; padding: 0 1.15rem; border-radius: 999px; border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font-weight: 500; font-size: 14px; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, color .2s;
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--gold-300); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:focus-visible, .input:focus-visible, .chip:focus-visible { outline: 3px solid var(--gold-100); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-gold { --bg: linear-gradient(135deg, #c9a24c, #a9842f); --fg: #fff; --bd: transparent; background: linear-gradient(135deg, #c9a24c, #a9842f); box-shadow: 0 6px 18px -6px rgba(169, 132, 47, .55); }
.btn-gold:hover { box-shadow: 0 10px 24px -8px rgba(169, 132, 47, .7); }
.btn-dark { --bg: var(--ink); --fg: #fff; --bd: var(--ink); }
.btn-wa { --bg: var(--wa); --fg: #fff; --bd: transparent; }
.btn-ghost { --bg: transparent; --bd: transparent; }
.btn-ghost:hover { background: var(--gold-50); box-shadow: none; }
.btn-danger { --bg: var(--red-50); --fg: var(--red); --bd: #f1cfcb; }
.btn-sm { height: 36px; padding: 0 .85rem; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 1.6rem; font-size: 15px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.btn-icon.btn-sm { width: 34px; height: 34px; border-radius: 10px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ── Formularios ── */
.input, .select, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--paper); transition: border-color .2s, box-shadow .2s; outline: none;
}
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-50); }
.select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath stroke='%238f8378' stroke-width='1.6' d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.input-icon > [data-icon] { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; z-index: 1; }
.input-icon > [data-icon] svg { width: 18px; height: 18px; }
.input-icon > .input { padding-left: 42px; }

/* ── Chips ── */
.chip {
  display: inline-flex; align-items: center; gap: .45rem; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--paper); cursor: pointer; font-size: 13.5px; font-weight: 500;
  transition: all .18s var(--ease); white-space: nowrap; color: var(--ink-2);
}
.chip:hover { border-color: var(--gold-300); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .count { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--gold-50); color: var(--gold-700); }
.chip.active .count { background: rgba(255,255,255,.16); color: #fff; }

/* ── Badges ── */
.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; letter-spacing: .2px; }
.badge-gold { background: var(--gold-100); color: var(--gold-700); }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-gray { background: #f1ede6; color: var(--ink-2); }
.badge-rose { background: var(--rose-50); color: #b5636b; }

/* ── Tarjetas / superficies ── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(32, 26, 20, .45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(100%, 560px); max-height: calc(100vh - 40px); overflow: auto;
  transform: translateY(16px) scale(.98); transition: transform .3s var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 8px; }
.modal-head h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.modal-body { padding: 8px 24px 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px 22px; border-top: 1px solid var(--line); background: #fffdf9; position: sticky; bottom: 0; }

/* ── Toasts ── */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 10px; z-index: 200; width: min(92vw, 420px); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 14px; background: var(--ink); color: #fff;
  box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .35s var(--ease);
}
.toast.ok { background: #1f5f3d; }
.toast.err { background: #8e2f28; }
.toast svg { width: 20px; height: 20px; flex: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ── Esqueleto de carga ── */
.skeleton { background: linear-gradient(90deg, #f3eee5 25%, #faf6ee 37%, #f3eee5 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 12px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── Vacío ── */
.empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.empty svg { width: 56px; height: 56px; color: var(--gold-300); margin: 0 auto 12px; }
.empty h4 { font-family: var(--serif); font-size: 24px; color: var(--ink); margin-bottom: 4px; }

::selection { background: var(--gold-100); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #e0d5c2; border-radius: 10px; border: 2px solid var(--cream); }
