/* ==========================================================================
 * vl-seleccion.css — Selección múltiple de vallas (home) + modal de solicitud.
 * Cargado solo en la portada. Paleta alineada con el resto del sitio.
 * ========================================================================== */

/* --- botón "Seleccionar" dentro de cada tarjeta --- */
.card .btn.vl-sel-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .75rem; border-radius: .5rem;
  border: 1px solid rgba(148, 163, 184, .35);
  background: rgba(15, 23, 42, .55); color: #e2e8f0;
  font-size: .8rem; font-weight: 700; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.card .btn.vl-sel-btn:hover { background: rgba(56, 189, 248, .18); border-color: rgba(56, 189, 248, .55); color: #fff; }
.card .btn.vl-sel-btn.is-on {
  background: rgba(16, 185, 129, .18); border-color: rgba(16, 185, 129, .65);
  color: #6ee7b7;
}
.card.vl-selected {
  outline: 2px solid rgba(16, 185, 129, .75);
  outline-offset: -2px;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}

/* --- barra fija --- */
.vl-sel-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom, 0px));
  background: rgba(8, 13, 24, .96);
  border-top: 1px solid rgba(56, 189, 248, .28);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .45);
  backdrop-filter: blur(10px);
}
.vl-sel-count { color: #e2e8f0; font-weight: 800; font-size: .95rem; }
.vl-sel-count span { color: #34d399; }
.vl-sel-actions { display: flex; align-items: center; gap: .5rem; }
.vl-sel-btn-primary {
  background: #10b981; color: #04140d; border: 0; border-radius: .55rem;
  font-weight: 900; font-size: .85rem; padding: .6rem .9rem; cursor: pointer;
  white-space: nowrap;
}
.vl-sel-btn-primary:hover { background: #34d399; }
.vl-sel-btn-ghost {
  background: transparent; color: #93c5fd; border: 1px solid rgba(147, 197, 253, .4);
  border-radius: .55rem; font-weight: 700; font-size: .82rem; padding: .55rem .8rem; cursor: pointer;
}
.vl-sel-btn-ghost:hover { background: rgba(59, 130, 246, .15); color: #dbeafe; }
.vl-sel-btn-icon {
  background: transparent; color: #cbd5e1; border: 1px solid rgba(148, 163, 184, .3);
  border-radius: .5rem; width: 2.1rem; height: 2.1rem; cursor: pointer; font-size: .9rem; line-height: 1;
}
.vl-sel-btn-icon:hover { background: rgba(244, 63, 94, .15); color: #fda4af; border-color: rgba(244, 63, 94, .4); }

/* --- panel de chips --- */
.vl-sel-panel {
  position: fixed; left: 0; right: 0; bottom: calc(3.7rem + env(safe-area-inset-bottom, 0px));
  z-index: 99999; max-height: 42vh; overflow: auto;
  display: flex; flex-wrap: wrap; gap: .45rem;
  padding: .9rem 1rem; background: rgba(8, 13, 24, .98);
  border-top: 1px solid rgba(148, 163, 184, .2);
}
.vl-sel-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .55rem .35rem .7rem; border-radius: 999px;
  background: rgba(30, 41, 59, .9); border: 1px solid rgba(148, 163, 184, .25);
  max-width: 100%;
}
.vl-sel-chip-name { color: #f1f5f9; font-size: .8rem; font-weight: 700; max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-sel-chip-meta { color: #94a3b8; font-size: .68rem; font-weight: 600; letter-spacing: .02em; }
.vl-sel-chip-x {
  border: 0; background: rgba(148, 163, 184, .18); color: #cbd5e1;
  width: 1.25rem; height: 1.25rem; border-radius: 999px; cursor: pointer; font-size: .65rem; line-height: 1;
}
.vl-sel-chip-x:hover { background: rgba(244, 63, 94, .35); color: #fff; }

/* --- modal --- */
body.vl-modal-open { overflow: hidden; }
body.vl-sel-active { padding-bottom: 4.2rem; }
.vl-sel-overlay {
  position: fixed; inset: 0; z-index: 100100; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(2, 6, 23, .78); backdrop-filter: blur(4px);
}
.vl-sel-dialog {
  width: min(44rem, 100%); max-height: 92vh; display: flex; flex-direction: column;
  background: #0b1220; border: 1px solid rgba(56, 189, 248, .25); border-radius: 1rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden;
}
.vl-sel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.1rem; border-bottom: 1px solid rgba(148, 163, 184, .18);
  position: sticky; top: 0; z-index: 3; background: #0b1220;
}
.vl-sel-close-bottom {
  display: none; margin-top: .55rem; width: 100%; background: transparent;
  border: 1px solid rgba(148, 163, 184, .35); color: #cbd5e1; border-radius: .55rem;
  padding: .7rem; font-size: .85rem; font-weight: 800; cursor: pointer;
}
.vl-sel-close-bottom:hover { background: rgba(148, 163, 184, .12); color: #fff; }
.vl-sel-kicker { margin: 0; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #38bdf8; }
.vl-sel-title { margin: .15rem 0 0; color: #fff; font-size: 1.15rem; font-weight: 900; }
.vl-sel-scroll { overflow: auto; padding: 1rem 1.1rem 1.2rem; }
.vl-sel-list { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.vl-sel-section {
  margin: .2rem 0 .8rem; font-size: .68rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: #94a3b8;
}
.vl-sel-form { display: flex; flex-direction: column; gap: .8rem; }
.vl-sel-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.vl-sel-field { display: flex; flex-direction: column; gap: .35rem; }
.vl-sel-field > span { font-size: .78rem; font-weight: 700; color: #cbd5e1; }
.vl-sel-field b { color: #fb7185; }
.vl-sel-field em { color: #64748b; font-style: normal; font-weight: 500; }
.vl-sel-field input[type="text"],
.vl-sel-field input[type="tel"],
.vl-sel-field input[type="email"],
.vl-sel-field input[type="date"],
.vl-sel-field select,
.vl-sel-field textarea {
  width: 100%; background: #0f172a; border: 1px solid rgba(148, 163, 184, .3);
  border-radius: .55rem; padding: .6rem .7rem; color: #fff; font-size: .86rem;
  font-family: inherit; color-scheme: dark;
}
.vl-sel-field input:focus, .vl-sel-field select:focus, .vl-sel-field textarea:focus {
  outline: none; border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, .15);
}
.vl-sel-radios, .vl-sel-checks { display: flex; flex-direction: column; gap: .3rem; }
.vl-sel-radios label, .vl-sel-checks label {
  display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: #e2e8f0; cursor: pointer;
}
.vl-sel-radios input, .vl-sel-checks input { width: 1rem; height: 1rem; accent-color: #38bdf8; flex: none; }
.vl-sel-hint { margin: .15rem 0 0; font-size: .72rem; color: #6ee7b7; }
.vl-sel-submit {
  margin-top: .2rem; width: 100%; border: 0; border-radius: .6rem; padding: .85rem 1rem;
  background: #10b981; color: #04140d; font-weight: 900; font-size: .95rem; cursor: pointer;
}
.vl-sel-submit:hover { background: #34d399; }
.vl-sel-submit:disabled { background: #334155; color: #94a3b8; cursor: not-allowed; }
.vl-sel-legal { margin: 0; font-size: .7rem; color: #64748b; text-align: center; }
.vl-sel-msg { border-radius: .55rem; padding: .7rem .8rem; font-size: .8rem; font-weight: 700; }
.vl-sel-msg.is-error { background: rgba(244, 63, 94, .16); color: #fecdd3; border: 1px solid rgba(244, 63, 94, .4); }
.vl-sel-msg.is-info { background: rgba(56, 189, 248, .15); color: #bae6fd; border: 1px solid rgba(56, 189, 248, .35); }
.vl-sel-ok { text-align: center; padding: .6rem 0 .2rem; }
.vl-sel-ok-title { margin: 0 0 .4rem; color: #6ee7b7; font-weight: 900; font-size: 1.05rem; }
.vl-sel-ok-text { margin: 0 0 .9rem; color: #cbd5e1; font-size: .86rem; }
.vl-sel-ok-text b { color: #fff; font-family: ui-monospace, monospace; }
.vl-sel-wa {
  display: block; text-decoration: none; background: #10b981; color: #04140d;
  font-weight: 900; border-radius: .6rem; padding: .8rem 1rem; font-size: .9rem;
}
.vl-sel-wa:hover { background: #34d399; }
.vl-sel-again {
  margin-top: .6rem; background: transparent; border: 1px solid rgba(148, 163, 184, .35);
  color: #cbd5e1; border-radius: .5rem; padding: .55rem 1rem; font-size: .8rem; font-weight: 700; cursor: pointer;
}

/* --- toast --- */
.vl-sel-toast {
  position: fixed; left: 50%; bottom: 5rem; transform: translate(-50%, 1rem);
  z-index: 100200; background: rgba(15, 23, 42, .97); color: #f1f5f9;
  border: 1px solid rgba(56, 189, 248, .35); border-radius: .6rem;
  padding: .6rem .9rem; font-size: .8rem; font-weight: 700; max-width: 88vw;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
  text-align: center;
}
.vl-sel-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- móvil --- */
@media (max-width: 640px) {
  /* Modal tipo hoja completa: se puede cerrar siempre (arriba y abajo) */
  .vl-sel-overlay { padding: 0; align-items: stretch; }
  .vl-sel-dialog {
    width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border-left: 0; border-right: 0;
  }
  .vl-sel-head { padding-top: calc(.85rem + env(safe-area-inset-top, 0px)); }
  .vl-sel-btn-icon { width: 2.6rem; height: 2.6rem; font-size: 1.05rem; }
  .vl-sel-close-bottom { display: block; }
  .vl-sel-scroll { padding-bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); }
  .vl-sel-grid2 { grid-template-columns: 1fr; }
  .vl-sel-chip-name { max-width: 11rem; }
  .vl-sel-field input[type="text"], .vl-sel-field input[type="tel"],
  .vl-sel-field input[type="email"], .vl-sel-field input[type="date"],
  .vl-sel-field select, .vl-sel-field textarea { font-size: 16px; }
  /* Barra inferior más compacta y por encima del contenido */
  .vl-sel-bar { gap: .45rem; padding: .55rem .75rem calc(.55rem + env(safe-area-inset-bottom, 0px)); }
  .vl-sel-count { font-size: .85rem; }
  .vl-sel-actions { width: auto; margin-left: auto; }
  .vl-sel-btn-primary { flex: 0 0 auto; padding: .55rem .8rem; font-size: .8rem; }
  .vl-sel-btn-ghost { padding: .5rem .65rem; font-size: .78rem; }
  .vl-sel-panel { bottom: calc(3.9rem + env(safe-area-inset-bottom, 0px)); max-height: 46vh; }
}

/* ===== Barra: oculta si no hay selección + modo minimizado ===== */
.vl-sel-bar[hidden] { display: none !important; }
.vl-sel-panel[hidden] { display: none !important; }
.vl-sel-bar.is-min {
  left: auto; right: 16px; bottom: 16px; width: auto;
  border-radius: 999px; padding: .45rem .6rem;
  border: 1px solid rgba(56, 189, 248, .45);
}
.vl-sel-bar.is-min .vl-sel-actions > :not(#vlSelMin) { display: none; }
.vl-sel-bar.is-min .vl-sel-count { font-size: .8rem; margin-left: .25rem; }