/* ==========================================================================
   PleaseWash · estilos
   Tipografía Plus Jakarta Sans (alojada aquí), iconos Lucide en sprite SVG.
   ========================================================================== */

@font-face {
  font-family: 'Jakarta';
  src: url('vendor/fonts/jakarta-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jakarta';
  src: url('vendor/fonts/jakarta-latin-ext.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --brand: #0b7a85;
  --brand-dark: #075a62;
  --brand-soft: #e1f2f3;
  --brand-softer: #f0f8f8;
  --accent: #f5a524;
  --bg: #f5f7f8;
  --card: #ffffff;
  --text: #13232a;
  --muted: #5b6c73;
  --border: #e1e8ea;
  --danger: #c2372b;
  --danger-soft: #fbe9e7;
  --ok: #18804a;
  --ok-soft: #e3f4ea;
  --warn: #8a5208;
  --warn-soft: #fdf1dc;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 40, 48, .05), 0 6px 20px rgba(16, 40, 48, .06);
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #31b7c3;
    --brand-dark: #7ad6de;
    --brand-soft: #15363a;
    --brand-softer: #12292c;
    --bg: #0d1517;
    --card: #152024;
    --text: #e7eff1;
    --muted: #98abb1;
    --border: #253438;
    --danger: #ff7d70;
    --danger-soft: #3a1d1a;
    --ok: #5fd395;
    --ok-soft: #173424;
    --warn: #f3b552;
    --warn-soft: #3a2d14;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 16px/1.55 'Jakarta', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); }
h1 { font-size: 1.65rem; line-height: 1.2; letter-spacing: -.02em; margin: 8px 0 14px; font-weight: 800; }
h2 { font-size: 1.12rem; letter-spacing: -.01em; margin: 24px 0 10px; font-weight: 750; }
.card > h2:first-child, .card h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
mark { background: #fff3c4; color: #5a4500; padding: 0 3px; border-radius: 4px; }

/* ---------- iconos ---------- */
.i {
  width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.i.lg { width: 1.6em; height: 1.6em; }
.icon-bubble {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 8px;
}

/* ---------- cabecera y navegación ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand img { border-radius: 8px; }
#nav { display: flex; gap: 2px; align-items: center; white-space: nowrap; }
#nav a, #nav button {
  display: inline-flex; align-items: center; gap: 6px; position: relative;
  font: inherit; font-size: .92rem; font-weight: 600; color: var(--muted); text-decoration: none;
  background: none; border: 0; padding: 8px 10px; border-radius: 10px; cursor: pointer;
}
#nav a:hover { color: var(--text); }
#nav a.active { color: var(--brand); background: var(--brand-soft); }
.dot {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .66rem; font-weight: 700; line-height: 17px; text-align: center;
}

/* Barra de pestañas inferior (móvil) */
#tabbar { display: none; }
@media (max-width: 719px) {
  body.has-tabs #nav .tab { display: none; }
  body.has-tabs #tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-top: 1px solid var(--border);
  }
  #tabbar a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: .7rem; font-weight: 650; color: var(--muted); text-decoration: none;
  }
  #tabbar a .i { width: 1.45em; height: 1.45em; }
  #tabbar a.active { color: var(--brand); }
  #tabbar a.active::before {
    content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand);
  }
  #tabbar .dot { top: 6px; right: calc(50% - 22px); }
  body.has-tabs main { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
  body.has-tabs footer.site { padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
  body.has-tabs #toast { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
}
@media (min-width: 720px) {
  #nav .tab-only { display: none; }
}

#banner:empty { display: none; }
#banner {
  max-width: 720px; margin: 12px auto 0; padding: 0 16px;
}
#banner .notice { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0; }

main { max-width: 720px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); }
main h1:focus { outline: none; }
[aria-busy="true"] { cursor: progress; opacity: .75; }

/* ---------- tarjetas y textos ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin: 12px 0; box-shadow: var(--shadow);
}
.notice {
  display: block; background: var(--brand-softer); border: 1px solid var(--brand-soft); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 14px; font-size: .9rem; margin: 10px 0;
}
.notice.warn { background: var(--warn-soft); border-color: transparent; }
.notice .i { color: var(--brand); margin-right: 4px; }
.error { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: 0; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .i { width: 2.4em; height: 2.4em; display: block; margin: 0 auto 10px; color: var(--brand); opacity: .7; }

/* ---------- formularios ---------- */
form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 650; font-size: .88rem; }
input, select, textarea {
  font: inherit; font-weight: 450; color: var(--text); background: var(--card);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
  font-size: max(16px, 1rem); /* iPhone hace zoom en campos de menos de 16 px */
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input:disabled { opacity: .7; }
input[style*="uppercase"]::placeholder { text-transform: none; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.req { color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 450; font-size: .92rem; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: .95rem; padding: 12px 18px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--brand); color: #fff; border: 1.5px solid var(--brand); text-decoration: none;
  transition: background .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(11, 122, 133, .25);
}
@media (prefers-color-scheme: dark) { .btn { color: #052326; } }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--card); color: var(--brand); border-color: var(--border); box-shadow: none; }
.btn.secondary:hover { border-color: var(--brand); background: var(--brand-softer); }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); box-shadow: none; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.block { width: 100%; }
.btn.lg { padding: 15px 22px; font-size: 1.02rem; }
.small-btn { padding: 9px 14px; font-size: .85rem; border-radius: 10px; min-height: 40px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option > span {
  display: flex; flex-direction: column; gap: 2px; padding: 13px 14px; height: 100%;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-weight: 450; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.option > span b { display: flex; align-items: center; gap: 6px; }
.option > span .price-tag { font-weight: 750; color: var(--brand); }
.option input:checked + span { border-color: var(--brand); background: var(--brand-softer); box-shadow: inset 0 0 0 1px var(--brand); }
.option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.step-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1.05rem; font-weight: 750; }
.step-title .n {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .82rem; font-weight: 800;
}
@media (prefers-color-scheme: dark) { .step-title .n { color: #052326; } }

/* Buscador de direcciones */
.ac { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1100; list-style: none; margin: 0; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.ac-list li { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: .92rem; }
.ac-list li .i { margin-top: 3px; color: var(--muted); }
.ac-list li:hover, .ac-list li.active { background: var(--brand-softer); }
.ac-list small { display: block; color: var(--muted); }

.map { height: 280px; border-radius: var(--radius-sm); border: 1px solid var(--border); z-index: 0; margin-top: 10px; }
.map.tall { height: 360px; }

/* ---------- estados, precios, datos ---------- */
.status {
  display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark);
}
.status.completed { background: var(--ok-soft); color: var(--ok); }
.status.cancelled { background: var(--danger-soft); color: var(--danger); }
.status.in_progress { background: var(--warn-soft); color: var(--warn); }
.status.pending_payment { background: var(--warn-soft); color: var(--warn); }
.job-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.price { font-weight: 800; font-size: 1.2rem; white-space: nowrap; letter-spacing: -.01em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .94rem; margin: 10px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 0; font-size: .86rem; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; padding: 14px 8px; margin: 0; }
.stat b { display: block; font-size: 1.3rem; letter-spacing: -.02em; }
.stats + .stats { margin-top: 10px; }

.stars { display: flex; gap: 4px; }
.stars button { font-size: 1.7rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--muted); opacity: .45; padding: 4px; min-width: 44px; min-height: 44px; }
.stars button.on { color: var(--accent); opacity: 1; }
.stars-static { color: var(--accent); letter-spacing: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark); vertical-align: middle;
}
.badge .i { width: 1em; height: 1em; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; }
.code { font-family: ui-monospace, monospace; letter-spacing: 1px; background: var(--brand-soft); padding: 2px 8px; border-radius: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .86rem; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.chip:hover, .chip.on { border-color: var(--brand); background: var(--brand-softer); }
.row-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.row-item:last-child { border-bottom: 0; }
.row-item > span { display: inline-flex; align-items: center; gap: 8px; }
.price-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.price-row:last-of-type { border-bottom: 0; }

/* ---------- fotos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-top: 8px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--border); }
.preview { position: relative; }
.preview button {
  position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; padding: 0;
}
.preview button::before { content: ''; position: absolute; inset: -6px; } /* zona táctil más grande */
.upload { cursor: pointer; }

/* ---------- ofertas y contraofertas ---------- */
.offer { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.offer-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.offer-actions .btn { flex: 1; padding: 9px 12px; }
.counter { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }

/* ---------- portada ---------- */
.hero { text-align: center; padding: 20px 0 8px; }
.hero h1 { font-size: clamp(1.9rem, 6.5vw, 2.6rem); letter-spacing: -.035em; margin-bottom: 10px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { color: var(--muted); max-width: 32em; margin: 0 auto 18px; font-size: 1.04rem; }
.hero-art { display: block; width: min(100%, 420px); height: auto; margin: 0 auto 8px; }
.hero-search { max-width: 520px; margin: 0 auto; text-align: left; padding: 14px; }
.hero-search form { grid-template-columns: 1fr; }
.trust { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 0; font-size: .85rem; color: var(--muted); }
.trust span { display: inline-flex; align-items: center; gap: 5px; }
.trust .i { color: var(--ok); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.steps .card { margin: 0; }
.steps .card b { display: block; margin: 2px 0 4px; }
.steps .card p { margin: 0; }
.cta-washer { background: linear-gradient(135deg, var(--brand-soft), var(--brand-softer)); border-color: transparent; }
.faq details { padding: 14px 18px; margin: 8px 0; }
.faq summary { font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--brand); font-weight: 800; }
.faq details[open] summary::after { content: '–'; }
.faq p { margin: 10px 0 0; color: var(--muted); }

.guide h2 { display: flex; align-items: center; gap: 8px; }
.guide ul, .guide ol { padding-left: 20px; margin: 0; }
.guide li { margin: 7px 0; }
.legal h2 { font-size: 1.02rem; }

footer.site { max-width: 720px; margin: 0 auto; padding: 8px 16px 32px; text-align: center; font-size: .8rem; color: var(--muted); }
footer.site a { color: var(--muted); }

/* ---------- avisos, chat, admin ---------- */
.notification { display: grid; gap: 2px; text-decoration: none; color: inherit; }
.notification.unread { border-left: 4px solid var(--brand); }
.chat { padding: 0; overflow: hidden; }
.messages { height: min(60vh, 480px); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 80%; align-self: flex-start; background: var(--bg); border-radius: 14px 14px 14px 4px; padding: 7px 11px; }
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-radius: 14px 14px 4px 14px; }
@media (prefers-color-scheme: dark) { .msg.mine { color: #052326; } }
.msg span { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg time { display: block; font-size: .7rem; opacity: .7; text-align: right; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; padding-bottom: 2px; }
.tabs a { white-space: nowrap; padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); border: 1.5px solid var(--border); font-size: .88rem; font-weight: 600; }
.tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.dispute summary { cursor: pointer; color: var(--muted); margin-top: 12px; font-size: .88rem; }
.dispute-form, .rate-client { margin-top: 10px; }

/* ---------- carga ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--border); border-radius: 8px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: shimmer 1.2s infinite;
}
@media (prefers-color-scheme: dark) { .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); } }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; margin: 10px 0; }
.sk-title { height: 18px; width: 50%; }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

#view > * { animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #view > * { animation: none; } }

#toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; z-index: 2000; font-weight: 550;
  max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}
#payment-element { min-height: 40px; }

@media (max-width: 520px) {
  .segmented.services { grid-template-columns: 1fr; }
  h1 { font-size: 1.45rem; }
  .card { padding: 16px; }
}
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
details.add { margin-top: 10px; }
details.add > summary { list-style: none; display: inline-flex; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { display: none; }
#nav a.btn { color: #fff; background: var(--brand); padding: 8px 14px; margin-left: 4px; }
#nav a.btn:hover { background: var(--brand-dark); }
@media (prefers-color-scheme: dark) { #nav a.btn { color: #052326; } }
.service-box { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--brand); background: var(--brand-softer); border-radius: var(--radius-sm); }
.service-box > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); flex: none; }
.service-box > div { display: grid; gap: 1px; }

/* Progreso de un lavado (Mis lavados) */
.progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; list-style: none; padding: 0; margin: 12px 0 0; counter-reset: step; }
.progress li { font-size: .72rem; font-weight: 600; color: var(--muted); padding-top: 8px; border-top: 4px solid var(--border); line-height: 1.2; }
.progress li.done { border-color: var(--brand); color: var(--text); }
.progress li.now { border-color: var(--brand); color: var(--brand); }
