/*
 * FlexCatalog - piezas de concesionario, comunes a todos los skins.
 *
 * Se carga ANTES de la hoja del skin (theme_head()), asi que cualquier skin
 * puede cambiarlas. Solo usa variables que definen todos los skins (--text,
 * --muted, --border, --card) y --primary, que emite theme_head(); el resto
 * lleva un valor de respaldo.
 */

.dealer-page { max-width: 880px; margin: 1.4rem auto 3rem; }
.dealer-page > h1 { font-size: 1.5rem; margin: 0 0 .4rem; }
.dealer-page > .lead { color: var(--muted); margin: 0 0 1.2rem; }

/* ---- Formularios (ficha, buscamos tu auto, vende tu auto) ---- */
.inquiry input[type="email"],
.inquiry input[type="number"],
.inquiry input[type="date"],
.inquiry input[type="datetime-local"],
.inquiry select,
.dealer-form input:not([type="checkbox"]):not([type="radio"]),
.dealer-form select,
.dealer-form textarea {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    color: var(--text);
    background: color-mix(in srgb, var(--card, transparent) 70%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius, 10px);
    padding: .6rem .75rem;
    margin: 0 0 .55rem;
}
.dealer-form textarea { min-height: 84px; resize: vertical; }
.dealer-form input:focus, .dealer-form select:focus, .dealer-form textarea:focus,
.inquiry input[type="email"]:focus, .inquiry input[type="datetime-local"]:focus {
    outline: 2px solid color-mix(in srgb, var(--primary, #0a84ff) 55%, transparent);
    outline-offset: 1px;
}
.dealer-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .9rem; }
.dealer-form .full, .dealer-form fieldset, .dealer-form button[type="submit"] { grid-column: 1 / -1; }
.dealer-form label > span { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 .2rem; }
.dealer-form fieldset { border: 0; padding: 0; margin: .2rem 0 .8rem; }
.dealer-form legend { font-size: .85rem; color: var(--muted); padding: 0; margin: 0 0 .35rem; }
.dealer-form h2 { grid-column: 1 / -1; font-size: 1.02rem; margin: .8rem 0 .5rem; }
@media (max-width: 640px) { .dealer-form { grid-template-columns: 1fr; } }

/* Que pide: pildoras de opcion (radio o casilla). */
.lead-types { display: flex; flex-wrap: wrap; gap: .35rem; border: 0; padding: 0; margin: 0 0 .7rem; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
    display: inline-block; font-size: .82rem; line-height: 1.2;
    padding: .38rem .7rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text);
}
.chip input:checked + span {
    background: var(--primary, #0a84ff); border-color: var(--primary, #0a84ff); color: #fff;
}
.chip input:focus-visible + span { outline: 2px solid var(--primary, #0a84ff); outline-offset: 2px; }
.lead-when label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 .2rem; }
.lead-when[hidden] { display: none !important; }

/* ---- Calculadora de pagos ---- */
.calc, .hours-box {
    margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--border);
}
.calc h2, .hours-box h2 { font-size: 1.02rem; margin: 0 0 .6rem; }
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .6rem; }
.calc-grid label > span { display: block; font-size: .78rem; color: var(--muted); margin: 0 0 .15rem; }
.calc-grid input, .calc-grid select {
    width: 100%; box-sizing: border-box; font: inherit; color: var(--text);
    background: transparent; border: 1px solid var(--border); border-radius: var(--radius, 10px); padding: .45rem .55rem;
}
.calc-result { display: flex; justify-content: space-between; align-items: baseline; margin: .8rem 0 .3rem; }
.calc-result strong { font-size: 1.45rem; color: var(--primary, inherit); }
.calc-note { font-size: .72rem; color: var(--muted); line-height: 1.4; margin: 0 0 .7rem; }

/* ---- Horario ---- */
.hours-box dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .8rem; margin: 0 0 .4rem; font-size: .9rem; }
.hours-box dt { color: var(--muted); }
.hours-box dd { margin: 0; }
.hours-box p { font-size: .85rem; margin: .3rem 0 0; }

/* ---- Equipamiento ---- */
.feature-list { list-style: none; padding: 0; margin: 0; columns: 2 220px; column-gap: 1.4rem; }
.feature-list li { display: flex; gap: .4rem; align-items: center; padding: .22rem 0; break-inside: avoid; }
.feature-list svg { flex: none; color: var(--primary, currentColor); }

/* ---- Ofertas ---- */
.tag.special { background: #e53935; color: #fff; }
.special-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; margin: .5rem 0 .2rem; }
.special-price .was { color: var(--muted); }
.special-price .now { font-size: 1.5rem; color: #e53935; }
.special-price .until { flex-basis: 100%; font-size: .8rem; color: var(--muted); }
.special-price.small { margin: .2rem 0; }
.special-price.small .now { font-size: 1.1rem; }

/* ---- Comparar ---- */
.compare-toggle { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--muted); margin-top: .5rem; cursor: pointer; }
.compare-toggle input { width: auto; margin: 0; }
.compare-bar {
    position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 60;
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: center;
    padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 14px;
    background: var(--card, var(--bg, #fff)); color: var(--text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    max-width: calc(100vw - 2rem);
}
.compare-bar[hidden] { display: none; }
.compare-bar .btn.disabled { opacity: .45; pointer-events: none; }
.compare-wrap { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.compare-table th, .compare-table td { text-align: left; vertical-align: top; padding: .6rem .7rem; border-bottom: 1px solid var(--border); }
.compare-table thead th { vertical-align: bottom; }
.compare-table thead img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius, 10px); margin-bottom: .4rem; }
.compare-table tbody th { color: var(--muted); font-weight: 500; white-space: nowrap; width: 1%; }

@media print { .compare-bar { display: none; } }
