/* ============================================================
   Página personalizable del taxista
   Se combina con style.css. El color y la fuente los elige el
   taxista y llegan como variables CSS inline (--tp-color) y una
   clase de plantilla (tp-plantilla-clasica/moderna/minimal).
   ============================================================ */

.tp-page{ --tp-color: #F5B43F; }

.tp-preview-banner{
  background:var(--ink); color:#fff; text-align:center;
  padding:12px 16px; font-size:.92rem; font-weight:600;
}
.tp-preview-banner a{ color:var(--amber); text-decoration:underline; margin-left:10px; }

/* ---------- Hero ---------- */
.tp-hero{
  background:var(--ink) center/cover no-repeat;
  color:#fff; text-align:center; padding:96px 24px;
}
.tp-hero-inner{ max-width:720px; margin:0 auto; }
.tp-hero h1{ font-family:var(--tp-font, var(--font-display)); font-size:clamp(2rem,5vw,3.2rem); margin-bottom:14px; }
.tp-hero-sub{ font-size:1.15rem; opacity:.92; margin-bottom:28px; }
.tp-cta-btn{ background:var(--tp-color); color:#1C1400; border:0; font-weight:800; }

/* ---------- Bloques genéricos ---------- */
.tp-block{ max-width:900px; margin:0 auto; padding:56px 24px; }
.tp-block h2{ font-family:var(--tp-font, var(--font-display)); font-size:1.7rem; margin-bottom:20px; }

.tp-texto-largo{ color:var(--text); line-height:1.75; white-space:pre-line; }

.tp-sobre-inner.tp-con-imagen{ display:grid; grid-template-columns:220px 1fr; gap:32px; align-items:start; }
.tp-sobre-img{ width:100%; border-radius:16px; object-fit:cover; aspect-ratio:1/1; }
@media (max-width:640px){ .tp-sobre-inner.tp-con-imagen{ grid-template-columns:1fr; } .tp-sobre-img{ max-width:200px; margin:0 auto; } }

.tp-chips{ display:flex; flex-wrap:wrap; gap:10px; list-style:none; padding:0; }
.tp-chips li{ background:var(--paper-2); border:1px solid var(--line); border-radius:999px; padding:8px 16px; font-size:.92rem; font-weight:600; }

.tp-galeria-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; }
.tp-galeria-grid img{ width:100%; aspect-ratio:1/1; object-fit:cover; border-radius:12px; }

.tp-testimonios-grid{ display:grid; gap:18px; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); }
.tp-testimonios-grid blockquote{ background:var(--paper-2); border-radius:14px; padding:22px; }
.tp-testimonios-grid p{ font-style:italic; margin-bottom:10px; }
.tp-testimonios-grid cite{ font-style:normal; font-weight:700; color:var(--muted); }

.tp-plan-badge{
  position:fixed; top:18px; right:18px; z-index:20;
  font-family:var(--font-display); font-weight:800; font-size:.78rem;
  letter-spacing:.03em; padding:8px 16px; border-radius:999px; color:#fff;
  box-shadow:0 8px 20px rgba(0,0,0,.22);
}
.tp-plan-badge--destacado{ background:linear-gradient(90deg,var(--amber-d),var(--amber)); color:#1C1400; }
.tp-plan-badge--premium{ background:linear-gradient(90deg,#6C2E9C,#8E44AD); }
.tp-plan-badge--elite{ background:linear-gradient(90deg,#0F172A,#1E293B); color:#F5B43F; }
@media (max-width:640px){ .tp-plan-badge{ position:absolute; top:12px; right:12px; } }

.tp-footer-cta{ text-align:center; padding:48px 24px 64px; }
.tp-footer-cta .btn{ background:var(--tp-color); color:#1C1400; border:0; font-weight:800; }

/* ---------- Plantilla: Moderna (dos columnas, borde de color) ---------- */
.tp-plantilla-moderna .tp-hero{ text-align:left; padding:110px 24px; border-bottom:6px solid var(--tp-color); }
.tp-plantilla-moderna .tp-hero-inner{ margin:0; max-width:640px; }
.tp-plantilla-moderna .tp-block h2{ border-left:5px solid var(--tp-color); padding-left:14px; }

/* ---------- Plantilla: Minimal (sin imagen de fondo grande, muy tipográfica) ---------- */
.tp-plantilla-minimal .tp-hero{ background-image:none !important; background:var(--paper-2); color:var(--ink); padding:80px 24px; }
.tp-plantilla-minimal .tp-hero h1{ color:var(--ink); }
.tp-plantilla-minimal .tp-hero-sub{ color:var(--muted); opacity:1; }
.tp-plantilla-minimal .tp-cta-btn{ background:transparent; color:var(--ink); border:2px solid var(--tp-color); }
.tp-plantilla-minimal .tp-block h2{ font-weight:700; text-transform:uppercase; letter-spacing:.06em; font-size:1.15rem; }

/* ============================================================
   Editor PRO: panel de diseño con vista previa en vivo
   ============================================================ */

/* ---------- Estructura general de dos columnas ---------- */
.editor-shell{ display:grid; grid-template-columns:minmax(0,1fr) 428px; gap:26px; align-items:start; }
.editor-main{ min-width:0; }

/* Barra superior pegajosa: navegación rápida entre secciones */
.editor-quicknav{
  display:flex; gap:8px; overflow-x:auto; -webkit-overflow-scrolling:touch;
  padding:6px 4px 14px; margin-bottom:6px; scrollbar-width:thin;
}
.editor-quicknav::-webkit-scrollbar{ height:5px; }
.editor-quicknav a{
  flex:0 0 auto; display:inline-flex; align-items:center; gap:6px;
  background:#fff; border:1.5px solid var(--line); color:var(--ink-2);
  padding:8px 14px; border-radius:999px; font-size:.84rem; font-weight:700;
  text-decoration:none; white-space:nowrap; transition:.15s;
}
.editor-quicknav a:hover{ border-color:var(--tp-color,var(--amber)); color:var(--ink); }
.editor-quicknav a.is-oculto-nav{ opacity:.5; }

/* ---------- Tarjeta de sección (diseño general) ---------- */
.editor-panel{
  background:#fff; border:1px solid var(--line); border-radius:16px;
  padding:22px; margin-bottom:18px; scroll-margin-top:20px;
}
.editor-panel-head{ margin-bottom:16px; }
.editor-panel-head h2{ font-size:1.02rem; font-weight:800; display:flex; align-items:center; gap:8px; }
.editor-panel-head p{ font-size:.85rem; color:var(--muted); margin-top:3px; }

/* Selector de color con muestras rápidas */
.editor-colores{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.color-swatch{
  width:32px; height:32px; border-radius:50%; border:2px solid #fff;
  box-shadow:0 0 0 1.5px var(--line); cursor:pointer; padding:0; flex:0 0 auto;
  transition:transform .12s;
}
.color-swatch:hover{ transform:scale(1.1); }
.color-swatch.is-activo{ box-shadow:0 0 0 2px #fff, 0 0 0 3.5px var(--ink); }
.color-swatch-custom{
  width:32px; height:32px; border-radius:50%; border:1.5px solid var(--line);
  cursor:pointer; padding:0; background:conic-gradient(from 180deg,#F5B43F,#E4572E,#8E44AD,#2E86AB,#2FB56B,#F5B43F);
  position:relative; flex:0 0 auto;
}
.color-swatch-custom input[type=color]{ position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }

/* Función bloqueada por el plan: candado + enlace a Planes */
.color-swatch-custom--bloqueada{
  cursor:pointer; opacity:.55; filter:grayscale(.4);
  display:flex; align-items:center; justify-content:center;
}
.color-swatch-custom--bloqueada input[type=color]{ pointer-events:none; }
.color-swatch-custom--bloqueada:hover{ opacity:.8; }
.editor-candado{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size:.85rem; pointer-events:none;
}

.editor-grid2{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:18px; }
.editor-campo-label{ display:block; font-size:.82rem; font-weight:700; margin-bottom:8px; color:var(--ink-2); }

/* Plantillas: tarjetas visuales con boceto en miniatura */
.editor-plantillas{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; }
.editor-plantilla-opt{ position:relative; }
.editor-plantilla-opt input{ position:absolute; opacity:0; width:0; height:0; }
.editor-plantilla-opt span{
  display:block; border:2px solid var(--line); border-radius:14px; padding:12px;
  cursor:pointer; background:#fff; transition:.15s; text-align:left;
}
.editor-plantilla-opt:hover span{ border-color:#c7d6e6; }
.editor-plantilla-opt input:checked + span{ border-color:var(--tp-color,var(--amber)); background:#FFF8E8; box-shadow:0 4px 14px rgba(0,0,0,.06); }
.plantilla-boceto{ height:52px; border-radius:8px; background:var(--paper-2); margin-bottom:10px; position:relative; overflow:hidden; }
.plantilla-boceto i{ position:absolute; background:#c7d6e6; border-radius:2px; }
.plantilla-boceto.b-clasica i{ inset:8px 14px auto 14px; height:8px; }
.plantilla-boceto.b-clasica::after{ content:""; position:absolute; left:36%; right:36%; bottom:10px; height:10px; border-radius:5px; background:var(--tp-color,var(--amber)); }
.plantilla-boceto.b-moderna{ display:flex; align-items:center; padding:0 10px; gap:6px; }
.plantilla-boceto.b-moderna i:nth-child(1){ width:5px; height:34px; background:var(--tp-color,var(--amber)); position:static; border-radius:3px; }
.plantilla-boceto.b-moderna i:nth-child(2){ flex:1; height:6px; position:static; }
.plantilla-boceto.b-minimal i{ position:static; display:block; width:60%; height:5px; margin:6px auto 0; }
.plantilla-boceto.b-minimal{ display:flex; flex-direction:column; align-items:center; justify-content:center; }
.editor-plantilla-opt span strong{ display:block; font-size:.86rem; font-weight:800; }
.editor-plantilla-opt span em{ display:block; font-style:normal; font-size:.76rem; color:var(--muted); margin-top:2px; }

/* Plantilla bloqueada por el plan actual */
a.editor-plantilla-opt--bloqueada{ text-decoration:none; color:inherit; display:block; }
a.editor-plantilla-opt--bloqueada span{
  border-style:dashed; background:var(--paper-2); opacity:.8; cursor:pointer;
}
a.editor-plantilla-opt--bloqueada:hover span{ border-color:var(--amber-d); opacity:1; }
a.editor-plantilla-opt--bloqueada .plantilla-boceto{ filter:grayscale(.5); opacity:.7; }
a.editor-plantilla-opt--bloqueada .plantilla-boceto .editor-candado{ font-size:1.1rem; }
a.editor-plantilla-opt--bloqueada em{ color:var(--amber-d); font-weight:700; }

/* Etiqueta de "función bloqueada" junto al título de un bloque */
.editor-tag-bloqueado{
  font-size:.72rem; font-weight:800; background:#FDECEA; color:#A5700F;
  background:#FFF3D6; padding:3px 9px; border-radius:999px; margin-left:8px;
}

/* Panel de upsell cuando un bloque entero está bloqueado (ej. Testimonios) */
.editor-bloqueado{
  text-align:center; padding:26px 20px; display:flex; flex-direction:column;
  align-items:center; gap:14px; background:var(--paper-2); border-radius:12px;
}
.editor-bloqueado p{ color:var(--ink-2); font-size:.92rem; max-width:420px; }

/* ---------- Bloques de contenido (acordeón) ---------- */
.editor-bloque{ background:#fff; border:1px solid var(--line); border-radius:16px; padding:0; margin-bottom:14px; overflow:hidden; scroll-margin-top:20px; }
.editor-bloque.is-oculto .editor-bloque-top{ opacity:.5; }
.editor-bloque-top{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:16px 20px; flex-wrap:wrap; cursor:pointer; user-select:none;
}
.editor-bloque-top h3{ font-size:.98rem; display:flex; align-items:center; gap:9px; }
.editor-chevron{ display:inline-block; transition:transform .18s; color:var(--muted); font-size:.8rem; margin-left:2px; }
.editor-bloque.is-colapsado .editor-chevron{ transform:rotate(-90deg); }
.editor-bloque-body{ padding:0 20px 20px; }
.editor-bloque.is-colapsado .editor-bloque-body{ display:none; }
.editor-mover{ display:flex; gap:6px; }
.editor-mover button{ width:32px; height:32px; border-radius:8px; border:1.5px solid var(--line); background:#fff; cursor:pointer; font-size:.9rem; }
.editor-mover button:hover{ background:var(--paper-2); }
.editor-visible{ position:relative; }
.editor-visible label{ display:flex; align-items:center; gap:7px; font-size:.85rem; font-weight:600; cursor:pointer; }
/* interruptor tipo switch */
.tp-switch{ position:relative; display:inline-block; width:38px; height:22px; flex:0 0 auto; }
.tp-switch input{ opacity:0; width:0; height:0; }
.tp-switch .tp-switch-track{ position:absolute; inset:0; background:#CBD6E2; border-radius:999px; transition:.15s; }
.tp-switch .tp-switch-track::before{ content:""; position:absolute; width:16px; height:16px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.15s; box-shadow:0 1px 3px rgba(0,0,0,.25); }
.tp-switch input:checked + .tp-switch-track{ background:var(--tp-color,var(--amber)); }
.tp-switch input:checked + .tp-switch-track::before{ transform:translateX(16px); }

.editor-campo{ margin-bottom:14px; }
.editor-campo label{ display:block; font-size:.85rem; font-weight:600; margin-bottom:5px; color:var(--muted); }
.editor-campo input[type=text], .editor-campo input[type=url], .editor-campo textarea, .editor-campo select{
  width:100%; padding:10px 12px; border:1.5px solid var(--line); border-radius:8px; font-family:inherit; font-size:.95rem; background:#fff;
}
.editor-campo input:focus, .editor-campo textarea:focus, .editor-campo select:focus{ outline:none; border-color:var(--tp-color,var(--amber)); }
.editor-campo textarea{ resize:vertical; min-height:80px; }
.editor-campo-contador{ text-align:right; font-size:.74rem; color:var(--muted); margin-top:3px; }
.editor-repetible-fila{ display:flex; gap:8px; margin-bottom:8px; align-items:center; }
.editor-repetible-fila input{ flex:1; }
.editor-quitar{ background:none; border:0; color:#C0392B; font-weight:800; cursor:pointer; font-size:1.1rem; padding:4px 8px; flex:0 0 auto; }
.editor-anadir{ background:var(--paper-2); border:1.5px dashed var(--line); border-radius:8px; padding:8px 14px; font-weight:700; font-size:.88rem; cursor:pointer; }
.editor-anadir:hover{ background:#e6edf5; }

/* ---------- Vista previa en vivo ---------- */
.editor-preview{
  position:sticky; top:20px; background:#fff; border:1px solid var(--line);
  border-radius:18px; box-shadow:var(--shadow); overflow:hidden;
  display:flex; flex-direction:column; max-height:calc(100vh - 40px);
}
.editor-preview-bar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:12px 14px; background:var(--paper-2); border-bottom:1px solid var(--line); flex-wrap:wrap;
}
.editor-preview-titulo{ display:flex; align-items:center; gap:8px; font-size:.84rem; font-weight:800; color:var(--ink); }
.editor-preview-titulo .dot{ width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 0 3px rgba(47,181,107,.18); animation:tp-pulse 1.8s infinite; }
@keyframes tp-pulse{ 0%,100%{ opacity:1 } 50%{ opacity:.4 } }
.device-toggle{ display:flex; gap:4px; background:#fff; border:1.5px solid var(--line); border-radius:9px; padding:3px; }
.device-toggle button{
  border:0; background:none; padding:6px 10px; border-radius:6px; cursor:pointer;
  font-size:.86rem; color:var(--muted); line-height:1;
}
.device-toggle button.is-activo{ background:var(--ink); color:#fff; }
.preview-cerrar{ display:none; border:0; background:none; font-size:1.3rem; cursor:pointer; color:var(--muted); padding:2px 6px; }

.editor-preview-body{ flex:1; overflow:auto; background:#E4EAF1; padding:22px 16px; display:flex; justify-content:center; }
.preview-frame{
  width:100%; max-width:100%; background:#fff; border-radius:10px; overflow:hidden;
  box-shadow:0 12px 34px rgba(20,40,60,.14); transition:max-width .22s ease; height:fit-content;
}
.preview-frame.device-mobile{ max-width:360px; }
.preview-frame .tp-page{ transform-origin:top center; }
.preview-frame .tp-hero{ padding:56px 20px; }
.preview-frame .tp-block{ padding:34px 20px; }
.preview-frame .tp-footer-cta{ padding:30px 20px 40px; }
.preview-vacio{ padding:60px 24px; text-align:center; color:var(--muted); font-size:.92rem; }
.preview-vacio strong{ display:block; font-size:1.6rem; margin-bottom:6px; }

/* Botón flotante para abrir la vista previa en móvil */
.preview-fab{
  display:none; position:fixed; right:18px; bottom:18px; z-index:55;
  align-items:center; gap:8px; background:var(--ink); color:#fff; border:0;
  padding:13px 20px; border-radius:999px; font-weight:800; font-size:.9rem;
  box-shadow:0 10px 26px rgba(20,40,60,.35); cursor:pointer;
}

@media (max-width:980px){
  .editor-shell{ grid-template-columns:1fr; }
  .editor-preview{
    position:fixed; inset:0; top:auto; height:88vh; max-height:88vh; z-index:70;
    border-radius:18px 18px 0 0; transform:translateY(100%); transition:transform .25s ease;
    box-shadow:0 -10px 40px rgba(0,0,0,.25);
  }
  .editor-preview.is-abierta{ transform:translateY(0); }
  .preview-cerrar{ display:inline-block; }
  .preview-fab{ display:inline-flex; }
}

/* ---------- Cabecera / acciones sticky ---------- */
.form-actions{ position:sticky; bottom:0; background:linear-gradient(0deg,var(--paper-2) 65%,transparent); padding:18px 0 10px; margin-top:6px; display:flex; gap:12px; flex-wrap:wrap; z-index:10; }
