/* Layout: header con ubicación → titular → boutiques + mapa → catálogo en rejilla */
:root {
  --bg: #F5F4F7;
  --surface: #FFFFFF;
  --ink: #1D1A26;
  --muted: #6B6578;
  --line: #E2DEE8;
  --accent: #A3285E;
  --accent-ink: #FFFFFF;
  --ok: #2E7D5B;
  --warn: #B26A00;
  --f-display: "Bodoni Moda", "Didot", Georgia, serif;
  --f-body: "Jost", "Futura", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141219; --surface: #1D1A24; --ink: #F1EEF5; --muted: #A49DB2;
    --line: #2F2B39; --accent: #E2679C; --accent-ink: #1D1A24; --ok: #5BC795; --warn: #E0A04A;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--f-body);
}
.wrap {
  max-width: 1180px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; text-wrap: balance; margin: 0; line-height: 1.1; }
.muted { color: var(--muted); margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; color: var(--accent); margin: 0; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.top { position: sticky; top: 0; z-index: 1000; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.logo { font-family: var(--f-display); font-style: italic; font-size: 26px; color: var(--ink); text-decoration: none; }
.loc { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-width: 0; }
.loc #locText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; animation: pulse 1.2s infinite; }
.dot.ok { background: var(--ok); animation: none; }
.dot.manual { background: var(--muted); animation: none; }
@keyframes pulse { 50% { opacity: .3; } }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Hero */
.hero { padding-block: 56px 36px; display: grid; gap: 18px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 64px); max-width: 17ch; }
.hero h1 em { color: var(--accent); }
.lede { max-width: 60ch; color: var(--muted); font-size: 18px; margin: 0; }

/* Boutiques + mapa */
.near { padding-block: 24px; }
.near-head, .cat-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.near h2, .catalog h2 { font-size: 32px; }
.near-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; }
.stores { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; max-height: 420px; overflow-y: auto; }
.store { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; cursor: pointer; text-align: left; width: 100%; }
.store:hover, .store.sel { border-color: var(--accent); }
.store b { font-weight: 600; }
.store .km { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); grid-row: span 2; align-self: center; white-space: nowrap; }
.store small { color: var(--muted); font-size: 13px; }
.map { min-height: 420px; border-radius: 6px; border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.leaflet-container { font-family: var(--f-body); }

/* Catálogo */
.catalog { padding-block: 48px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; }
.filters label { display: grid; gap: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
select, input { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 9px 10px; min-width: 0; font-size: 15px; text-transform: none; letter-spacing: 0; }
#count { margin-bottom: 16px; }
.dresses { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.dress { display: grid; gap: 10px; }
.pic { aspect-ratio: 3 / 4; max-width: 100%; border-radius: 6px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1px solid var(--line); }
.pic svg { width: 58%; height: auto; }
.dress h3 { font-size: 24px; }
.dress .tipo { color: var(--muted); font-size: 14px; margin: 0; }
.meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.price { font-weight: 600; font-size: 18px; }
.price small { font-weight: 400; color: var(--muted); font-size: 13px; }
.near-tag { font-size: 13px; color: var(--muted); }
.near-tag b { color: var(--ink); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; color: var(--muted); }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 4px; padding: 11px 16px; font-weight: 600; cursor: pointer; letter-spacing: .02em; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.empty { grid-column: 1 / -1; padding: 40px 0; color: var(--muted); }

/* Dialogs */
.dlg { border: 0; border-radius: 8px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
.dlg::backdrop { background: rgb(20 16 28 / .55); }
.dlg form, .dlg .ok { padding: 24px; display: grid; gap: 16px; position: relative; }
.dlg h3 { font-size: 28px; }
.cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cities button { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 12px; cursor: pointer; text-align: left; }
.cities button:hover { border-color: var(--accent); }
.close { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.rent-top { display: grid; grid-template-columns: 84px 1fr; gap: 16px; align-items: center; padding-right: 24px; }
.rent-pic .pic { aspect-ratio: 3/4; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.fields .full { grid-column: 1 / -1; }
.small { font-size: 14px; }
.step { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
.step legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.step legend span { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: 12px; }

/* Selector de día y hora */
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.days:empty, .slots:empty { display: none; }
.day, .slot { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-variant-numeric: tabular-nums; }
.day { flex: none; width: 60px; padding: 8px 4px; display: grid; gap: 0; text-align: center; line-height: 1.2; }
.day small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day b { font-size: 20px; font-weight: 600; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slot { padding: 9px 4px; font-size: 14px; }
.day:hover:not(:disabled), .slot:hover:not(:disabled) { border-color: var(--accent); }
.day[aria-checked="true"], .slot[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day[aria-checked="true"] small { color: inherit; }
.day:disabled, .slot:disabled { opacity: .38; cursor: not-allowed; text-decoration: line-through; }

.ok-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.dlg { max-height: calc(100dvh - 32px); }

/* Mis citas */
.mine { padding-block: 24px 0; display: grid; gap: 14px; }
.mine h2 { font-size: 32px; }
.citas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cita { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 14px 16px; display: grid; gap: 4px; }
.cita b { font-weight: 600; }
.cita .when { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.cita small { color: var(--muted); }
.cita-act { display: flex; gap: 14px; margin-top: 6px; }
.quote { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; padding: 14px 16px; background: var(--bg); border-radius: 6px; font-variant-numeric: tabular-nums; font-size: 15px; }
.quote dt { color: var(--muted); }
.quote dd { margin: 0; text-align: right; }
.quote .tot { font-weight: 600; color: var(--ink); }
.err { color: var(--accent); margin: 0; font-size: 14px; min-height: 1em; }
.err:empty { display: none; }

.foot { padding-block: 32px 48px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .near-grid { grid-template-columns: 1fr; }
  .map { min-height: 300px; order: -1; }
  .stores { max-height: none; }
  .loc #locText { max-width: 24ch; }
  .fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

/* Política del apartado */
.policy { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--muted); cursor: pointer; }
.policy input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }

.paypal { min-height: 150px; }
#payBack { justify-self: start; }
