/* ===========================================================================
   Sanidad al Día — Estilos (mobile-first, paleta verde/blanco)
   =========================================================================== */
:root {
  --green-900: #0f5132;
  --green-700: #198754;
  --green-600: #1aa179;
  --green-500: #22c08a;
  --green-100: #d7f3e6;
  --green-050: #eefaf4;
  --ink: #1b2b27;
  --muted: #5c726a;
  --line: #d9e6e0;
  --white: #ffffff;
  --bg: #f4faf7;
  --danger: #c0392b;
  --warn: #d68910;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(16, 71, 50, 0.10);
  --shadow-sm: 0 2px 10px rgba(16, 71, 50, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: var(--green-700); }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--green-900); }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--green-600), var(--green-900));
  display: grid; place-items: center; color: #fff; font-size: 18px;
}
.header-link { font-size: 14px; font-weight: 600; text-decoration: none; }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 700; font-size: 16px;
  padding: 14px 26px; border-radius: 999px; text-decoration: none;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-900); }
.btn-ghost { background: transparent; color: var(--green-900); border: 2px solid var(--green-700); }
.btn-ghost:hover { background: var(--green-050); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 14px; }

/* --- Hero --- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, var(--green-100), transparent),
    linear-gradient(180deg, var(--green-050), var(--bg));
  padding: 56px 0 40px;
}
.hero-grid { display: grid; gap: 30px; }
.eyebrow {
  display: inline-block; background: var(--green-100); color: var(--green-900);
  font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 999px;
}
.hero h1 { font-size: 32px; line-height: 1.15; margin: 14px 0 12px; color: var(--green-900); }
.hero p.lead { font-size: 17px; color: var(--muted); margin: 0 0 22px; }

/* --- Tarjeta de precio --- */
.price-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); text-align: center;
}
.price-card .badge {
  display: inline-block; background: var(--green-700); color: #fff;
  font-weight: 800; font-size: 12px; letter-spacing: .5px;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 12px;
}
.price-old { color: var(--muted); text-decoration: line-through; font-size: 20px; }
.price-new { color: var(--green-900); font-size: 40px; font-weight: 900; margin: 4px 0; }
.price-note { color: var(--muted); font-size: 13px; }
.price-card .btn { margin-top: 16px; }

/* --- Productos --- */
.section { padding: 46px 0; }
.section h2 { font-size: 26px; color: var(--green-900); margin: 0 0 8px; }
.section .sub { color: var(--muted); margin: 0 0 26px; }
.products { display: grid; gap: 16px; }
.product {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.product .ico {
  width: 46px; height: 46px; border-radius: 12px; background: var(--green-100);
  display: grid; place-items: center; font-size: 22px; margin-bottom: 12px;
}
.product h3 { margin: 0 0 6px; font-size: 17px; color: var(--green-900); }
.product p { margin: 0; color: var(--muted); font-size: 14px; }

/* --- Formulario multi-paso --- */
.form-section { background: #fff; }
.form-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; max-width: 760px; margin: 0 auto;
}
/* Aviso de precisión (visible durante todo el formulario) */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff8e6; border: 1px solid #f4d97b; border-left: 4px solid var(--warn);
  color: #6b4e00; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
  font-size: 13.5px; line-height: 1.45;
}
.notice .notice-ico { font-size: 16px; line-height: 1.4; }
.notice strong { color: #5a3d00; }

/* Agregar opción personalizada en grupos de checkboxes */
.check-adder { display: flex; gap: 8px; margin-top: 10px; }
.check-adder .input { flex: 1; }
.check-adder .add-link { width: auto; white-space: nowrap; }

.autosave {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
  font-size: 13px; color: var(--green-700); margin-bottom: 8px; min-height: 20px;
}
.autosave .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green-500);
  box-shadow: 0 0 0 0 rgba(34,192,138,.6);
}
.autosave.saving .dot { animation: pulse 1s infinite; background: var(--warn); }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(214,137,16,.5)} 70%{box-shadow:0 0 0 8px rgba(214,137,16,0)} 100%{box-shadow:0 0 0 0 rgba(214,137,16,0)} }

.steps { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.step-pill {
  flex: 1; min-width: 60px; height: 6px; border-radius: 999px; background: var(--line);
}
.step-pill.active { background: var(--green-600); }
.step-pill.done { background: var(--green-900); }
.step-title { font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.step-heading { font-size: 21px; color: var(--green-900); margin: 0 0 18px; }

.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--green-100);
}
.textarea { min-height: 80px; resize: vertical; }
.row { display: grid; gap: 14px; }
@media (min-width: 620px) { .row.cols-2 { grid-template-columns: 1fr 1fr; } .row.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* Tarjetas seleccionables (tipo de establecimiento) */
.cards { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 620px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card-choice {
  border: 2px solid var(--line); border-radius: 12px; padding: 16px; text-align: center;
  cursor: pointer; background: #fff; transition: all .15s ease;
}
.card-choice .emoji { font-size: 28px; }
.card-choice .name { font-weight: 700; font-size: 14px; margin-top: 6px; color: var(--green-900); }
.card-choice:hover { border-color: var(--green-500); }
.card-choice.selected { border-color: var(--green-700); background: var(--green-050); box-shadow: var(--shadow-sm); }

/* Checkboxes / radios en cuadrícula */
.checks { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .checks { grid-template-columns: 1fr 1fr; } }
.check {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px;
}
.check input { width: 18px; height: 18px; accent-color: var(--green-700); }
.check.selected { border-color: var(--green-700); background: var(--green-050); }

.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-group label {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px;
}
.radio-group input { accent-color: var(--green-700); }

/* Items repetibles */
.repeater-item {
  display: grid; gap: 8px; grid-template-columns: 1fr; align-items: end;
  border: 1px dashed var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px;
  position: relative;
}
@media (min-width: 620px) { .repeater-item.two { grid-template-columns: 2fr 1fr auto; } }
.repeater-item .remove {
  background: transparent; border: 0; color: var(--danger); cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 8px;
}
.add-link {
  background: transparent; border: 1px dashed var(--green-600); color: var(--green-700);
  border-radius: 10px; padding: 10px; width: 100%; cursor: pointer; font-weight: 600;
}

/* Subida de archivos */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  border: 2px dashed var(--green-500); border-radius: 12px;
  padding: 26px 18px; min-height: 130px;
  background: var(--green-050); cursor: pointer; color: var(--muted);
  transition: background .15s ease, border-color .15s ease;
}
.dropzone:hover { background: var(--green-100); border-color: var(--green-600); }
.dropzone .dz-ico { font-size: 30px; line-height: 1; }
.dropzone .dz-main { font-size: 15px; color: var(--ink); }
.dropzone .dz-main strong { color: var(--green-900); }
.dropzone .dz-sub { font-size: 12px; color: var(--muted); }
.previews { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); margin-top: 12px; }
.preview {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff;
  font-size: 12px; position: relative; text-align: center;
}
.preview img { height: 70px; object-fit: cover; border-radius: 6px; margin: 0 auto 6px; }
.preview .file-ico { font-size: 34px; margin-bottom: 6px; }
.preview .pname { word-break: break-word; color: var(--muted); }
.preview .del { position: absolute; top: 4px; right: 6px; cursor: pointer; color: var(--danger); font-weight: 800; }

.form-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

/* Confirmación */
.confirm {
  text-align: center; max-width: 560px; margin: 0 auto; padding: 30px 20px;
}
.confirm .check-circle {
  width: 84px; height: 84px; border-radius: 50%; background: var(--green-100);
  display: grid; place-items: center; font-size: 44px; margin: 0 auto 18px;
}
.confirm h2 { color: var(--green-900); }

/* Mis establecimientos */
.est-list { display: grid; gap: 12px; }
.est-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.est-item .meta { font-size: 13px; color: var(--muted); }
.tag { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; }
.tag.pendiente { background: #fef3cd; color: #946200; }
.tag.compro { background: var(--green-100); color: var(--green-900); }
.tag.no_compro { background: #fde2e0; color: var(--danger); }
.tag.borrador { background: #e7eef0; color: #51606b; }

/* WhatsApp flotante */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  width: 58px; height: 58px; border-radius: 50%; background: #25d366;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(37,211,102,.45);
  color: #fff; font-size: 30px; text-decoration: none;
}
.wa-float:hover { transform: scale(1.05); }

/* Footer */
.site-footer { background: var(--green-900); color: #cfe9dd; padding: 26px 0; margin-top: 30px; font-size: 14px; }
.site-footer a { color: #fff; }

/* Utilidades */
.hidden { display: none !important; }
.center { text-align: center; }
.mt-2 { margin-top: 14px; }
.muted { color: var(--muted); }
.err { color: var(--danger); font-size: 13px; margin-top: 4px; }

@media (min-width: 880px) {
  .hero-grid { grid-template-columns: 1.3fr 1fr; align-items: center; }
  .hero h1 { font-size: 42px; }
  .products { grid-template-columns: repeat(3, 1fr); }
}
