/* =========================================================
   Cotizador Transporte Local - frontend
   Paleta tomada del tema CargoHub de contenext.com:
   azul #00529f (precios/enlaces), CTA morado #7f54b3 (boton
   "Anadir al carrito" actual), bordes #eaeaea, Open Sans.
   Todo va scoped bajo .ctxcot para no pisar al tema.
   ========================================================= */

.ctxcot {
    --ctx-azul: #00529f;
    --ctx-azul-suave: #eaf2fa;
    --ctx-cta: #7f54b3;
    --ctx-cta-texto: #ffffff;
    --ctx-texto: #222222;
    --ctx-gris: #515151;
    --ctx-borde: #eaeaea;
    --ctx-fondo: #f7f8fa;
    --ctx-ok: #1e9e6a;
    --ctx-error: #b32d2e;
    font-family: inherit;
    color: var(--ctx-texto);
    margin: 10px 0 30px;
}
.ctxcot *, .ctxcot *::before, .ctxcot *::after { box-sizing: border-box; }

/* Cotizador cerrado por completo (interruptor maestro) */
.ctxcot-cerrado {
    background: #f7f8fa;
    border: 1px solid #e0e5eb;
    border-radius: 3px;
    padding: 40px 32px;
    text-align: center;
}
.ctxcot-cerrado h3 { margin: 0 0 12px !important; font-size: 22px; font-weight: 600; color: #16324f; }
.ctxcot-cerrado p { margin: 0 auto; max-width: 62ch; font-size: 15.5px; font-weight: 300; line-height: 1.65; color: #515151; }

/* Nota de servicio en actualizacion (el formulario sigue funcionando como solicitud) */
.ctxcot-nota-inactivo {
    background: #eaf2fa;
    border: 1px solid #b9d3ec;
    border-left: 4px solid #00529f;
    border-radius: 3px;
    padding: 14px 18px;
    margin-bottom: 18px;
    font-size: 14.5px;
    font-weight: 300;
    line-height: 1.6;
    color: #16324f;
}
.ctxcot-nota-inactivo strong { font-weight: 600; }

/* Agradecimiento tras solicitar cotizacion (servicio en actualizacion) */
.ctxcot-gracias {
    background: #edf9ee;
    border: 1px solid #b6e0bd;
    border-left: 4px solid #1e9e6a;
    border-radius: 3px;
    padding: 16px 18px;
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.6;
    color: #14663f;
}

/* El atributo hidden debe ganar SIEMPRE, incluso sobre display:flex
   (sin esto, la fila del descuento aparecia con "$0" al revelar la tarifa) */
.ctxcot [hidden] { display: none !important; }

/* Revelado progresivo de pasos (equivalente a GP Page Transitions del
   formulario original: cada paso aparece al completar el anterior).
   El ocultamiento lo aplica el JS: sin JavaScript se ve todo el formulario. */
.ctxcot-paso-oculto { display: none !important; }
@keyframes ctxcot-aparecer {
    0%   { opacity: 0; transform: translateY(22px); }
    60%  { opacity: 1; }
    100% { opacity: 1; transform: none; }
}
.ctxcot-paso-aparece { animation: ctxcot-aparecer .65s cubic-bezier(.22, .61, .36, 1); }

.ctxcot-cols { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 880px) { .ctxcot-cols { grid-template-columns: 1fr; } }

/* ---------- pasos ---------- */
.ctxcot-paso {
    background: #fff;
    border: 1px solid var(--ctx-borde);
    border-radius: 3px;
    padding: 26px 28px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(11, 37, 69, .05);
}
.ctxcot-paso-titulo {
    margin: 0 0 8px !important;
    font-size: 19px;
    font-weight: 600;
    color: var(--ctx-texto);
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.3;
}
.ctxcot-num {
    flex: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--ctx-azul-suave);
    color: var(--ctx-azul);
    font-size: 14px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.ctxcot-desc,
.ctxcot-paso-desc {
    margin: 0 0 18px;
    color: var(--ctx-gris);
    font-size: 14.5px;
    font-weight: 300;
    line-height: 1.65;
    max-width: 72ch;
}

/* ---------- tarjetas con imagen ---------- */
.ctxcot-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .ctxcot-choices { grid-template-columns: 1fr; } }

.ctxcot-choice {
    position: relative;
    display: flex; flex-direction: column;
    padding: 0; margin: 0;
    background: #fff;
    border: 2px solid var(--ctx-borde);
    border-radius: 3px;
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    font: inherit; color: inherit;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
}
.ctxcot-choice:hover { border-color: #b9cfe4; }
.ctxcot-choice.ctxcot-sel {
    border-color: var(--ctx-azul);
    box-shadow: 0 0 0 3px rgba(0, 82, 159, .15);
}
.ctxcot-choice img {
    width: 100%; height: 185px;
    object-fit: cover; display: block;
    background: var(--ctx-fondo);
}
.ctxcot-ph {
    height: 185px;
    display: flex; align-items: center; justify-content: center;
    background: var(--ctx-fondo);
    color: var(--ctx-azul);
}
@media (max-width: 520px) {
    .ctxcot-choice img, .ctxcot-ph { height: 150px; }
}
.ctxcot-choice-lbl { padding: 13px 16px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.ctxcot-tick {
    position: absolute; top: 8px; right: 8px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--ctx-azul);
    color: #fff;
    font-size: 13px;
    display: none;
    align-items: center; justify-content: center;
    z-index: 1;
}
.ctxcot-choice.ctxcot-sel .ctxcot-tick { display: flex; }

/* ---------- campos ---------- */
.ctxcot-campo { margin: 0 0 18px; }
.ctxcot-campo label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.ctxcot select, .ctxcot input[type="text"] {
    width: 100%;
    max-width: 520px;
    padding: 12px 14px;
    border: 1px solid #cfd6dd;
    border-radius: 3px;
    background: #fff;
    color: var(--ctx-texto);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.4;
    height: auto;
}
.ctxcot select:focus, .ctxcot input[type="text"]:focus {
    outline: 2px solid rgba(0, 82, 159, .3);
    border-color: var(--ctx-azul);
}

.ctxcot-slider-row { display: flex; align-items: center; gap: 16px; max-width: 520px; }
.ctxcot input[type="range"] { flex: 1; accent-color: var(--ctx-azul); margin: 0; height: 8px; }
.ctxcot-m3-valor {
    flex: none;
    min-width: 100px;
    text-align: center;
    background: var(--ctx-azul);
    color: #fff;
    border-radius: 3px;
    padding: 9px 12px;
    font-size: 15px;
}
.ctxcot-m3-valor b { font-size: 19px; font-weight: 700; }
.ctxcot-escala {
    display: flex; justify-content: space-between;
    max-width: 520px;
    color: var(--ctx-gris); font-size: 12.5px; margin-top: 5px;
}

.ctxcot-extras { margin-top: 6px; }
.ctxcot-extra {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--ctx-borde);
    border-radius: 3px;
    padding: 13px 15px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 14.5px;
}
.ctxcot-extra input { width: 18px; height: 18px; accent-color: var(--ctx-azul); flex: none; margin: 0; }
.ctxcot-extra span { font-weight: 600; }
.ctxcot-extra-precio { margin-left: auto; color: var(--ctx-azul); white-space: nowrap; }

/* ---------- confirmacion ---------- */
.ctxcot-confirm {
    display: flex; align-items: flex-start; gap: 13px;
    background: #fff9ec;
    border: 1px solid #f2ddb0;
    border-radius: 3px;
    padding: 16px 18px;
    cursor: pointer;
    font-size: 15px;
}
.ctxcot-confirm input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ctx-azul); flex: none; }
.ctxcot-confirm span { font-weight: 600; }

/* ---------- panel de tarifa ---------- */
.ctxcot-col-panel { position: sticky; top: 20px; }
.ctxcot-panel {
    background: #fff;
    border: 1px solid var(--ctx-borde);
    border-radius: 3px;
    overflow: hidden;
}
.ctxcot-panel-head {
    background: var(--ctx-azul);
    color: #fff;
    padding: 15px 18px;
    font-size: 16px;
    font-weight: 600;
}
.ctxcot-bloqueado {
    padding: 30px 20px;
    text-align: center;
    color: var(--ctx-gris);
}
.ctxcot-bloqueado svg { opacity: .4; margin-bottom: 8px; }
.ctxcot-bloqueado p { margin: 0; font-size: 13.5px; font-weight: 300; line-height: 1.5; }

.ctxcot-detalle { padding: 18px 20px; }
.ctxcot-fila {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 10px 0;
    font-size: 14.5px;
    border-bottom: 1px dashed var(--ctx-borde);
}
.ctxcot-fila .ctxcot-k { color: var(--ctx-gris); font-weight: 300; }
.ctxcot-fila b { font-weight: 600; white-space: nowrap; }
.ctxcot-fila-desc b { color: var(--ctx-ok); }

.ctxcot-total {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-top: 12px; padding-top: 13px;
    border-top: 2px solid var(--ctx-azul);
    font-size: 15px; font-weight: 600;
}
.ctxcot-total b {
    /* mismo estilo que el precio del tema: azul, grande, peso 300 */
    color: var(--ctx-azul);
    font-size: 29px;
    font-weight: 300;
}

.ctxcot-cupon { display: flex; gap: 8px; margin: 14px 0 0; }
.ctxcot-cupon-input { flex: 1; }
.ctxcot-cupon-btn {
    padding: 8px 14px;
    border: 1px solid var(--ctx-azul);
    background: #fff;
    color: var(--ctx-azul);
    border-radius: 3px;
    font-weight: 600; font-size: 13.5px;
    cursor: pointer;
    font-family: inherit;
}
.ctxcot-cupon-btn:hover { background: var(--ctx-azul-suave); }
.ctxcot-cupon-msg { margin: 6px 0 0; font-size: 12.5px; min-height: 16px; }
.ctxcot-cupon-msg.ctxcot-ok { color: var(--ctx-ok); }
.ctxcot-cupon-msg.ctxcot-err { color: var(--ctx-error); }

.ctxcot-cta {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 15px 18px;
    border: 0;
    border-radius: 3px;
    background: var(--ctx-cta);
    color: var(--ctx-cta-texto);
    font-size: 17px; font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: filter .15s;
}
.ctxcot-cta:hover { filter: brightness(1.08); color: var(--ctx-cta-texto); }
.ctxcot-cta:disabled { background: #d5dbe1; color: #8b98a5; cursor: not-allowed; }
.ctxcot-nota { margin: 10px 0 0; font-size: 12px; color: var(--ctx-gris); font-weight: 300; line-height: 1.5; }

/* (el modal de resumen de la Etapa 2 se elimino: el CTA ahora envia al carrito) */
