/* ==========================================================================
   VENTAS DIRECTAS – template-ventas-directas.php
   ========================================================================== */

/* ── Variables locales ─────────────────────────────────────────────── */
#template-ventas-directas {
    --vd-red:    #eb0a1e;   /* Toyota red */
    --vd-dark:   #282830;
    --vd-gray:   #f5f5f5;
    --vd-text:   #555;
    --vd-radius: 4px;
}

/* ── SECCIÓN: DESCRIPCIÓN ──────────────────────────────────────────── */
.vd-descripcion {
    background-color: #fff;
}

.vd-descripcion p {
    color: var(--vd-text);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: .5rem;
}

.vd-descripcion p:first-child {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--vd-dark);
}

/* ── SECCIÓN: CARDS DE OFERTAS ─────────────────────────────────────── */
.vd-ofertas {
    background-color: var(--vd-gray);
}

.vd-ofertas__titulo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--vd-dark);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .5rem;
}

/* Separador rojo estilo Toyota */
.vd-ofertas__separator {
    display: inline-block;
    width: 60px;
    height: 3px;
    background-color: #eb0a1e;
    border-radius: 2px;
    margin-bottom: 2rem;
}

/* ── CARD ─────────────────────────────────────────────────────────── */
.vd-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s ease;
    height: 100%;
}

.vd-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, .14);
}

.vd-card__image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.vd-card__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vd-card__titulo {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #282830;
    margin-bottom: .75rem;
}

/* Texto colapsable */
.vd-card__descripcion {
    font-size: .875rem;
    color: #555;
    line-height: 1.65;
    overflow: hidden;
    max-height: 90px;        /* ~4 líneas */
    transition: max-height .4s ease;
    position: relative;
}

.vd-card__descripcion::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
    transition: opacity .25s;
}

.vd-card__descripcion.expanded {
    max-height: 800px;
}

.vd-card__descripcion.expanded::after {
    opacity: 0;
}

/* Botón toggle */
.vd-card__toggle {
    background: none;
    border: none;
    padding: .4rem 0 .8rem;
    cursor: pointer;
    font-size: .8rem;
    color: #eb0a1e;
    font-weight: 600;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.vd-card__toggle .toggle-label-less {
    display: none;
}

.vd-card__toggle.active .toggle-label-more {
    display: none;
}

.vd-card__toggle.active .toggle-label-less {
    display: inline;
}

/* Footer de la card: zona de acción siempre al fondo ─────────────── */
/*
 * .vd-card__footer ocupa el espacio sobrante y alinea el botón abajo.
 * Si no hay botón el espacio igual se reserva → todas las cards tienen
 * la misma altura y el slider queda sin desalineamientos.
 */
.vd-card__footer {
    margin-top: auto;         /* empuja el footer siempre al fondo */
    padding-top: 1rem;
    min-height: 50px;         /* altura mínima aunque no haya botón */
    display: flex;
    align-items: flex-end;
}

/* Botón de link */
.vd-card__link.btn-vd {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    background-color: transparent;
    border: 2px solid #eb0a1e;
    color: #eb0a1e;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color .2s, color .2s;
}

.vd-card__link.btn-vd:hover {
    background-color: #eb0a1e;
    color: #fff;
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   SLIDER SWIPER (> 3 cards)
   ═══════════════════════════════════════════════════════════════════════ */
.vd-cards-slider-wrap {
    position: relative;
    padding: 0 50px 50px;   /* espacio para las flechas laterales */
}

.vd-cards-swiper {
    overflow: hidden;
    padding-bottom: 10px;
}

.vd-cards-swiper .swiper-slide {
    display: flex;
    height: auto;             /* slides misma altura */
    padding: 0 10px;
    box-sizing: border-box;
}

.vd-cards-swiper .swiper-slide .vd-card {
    width: 100%;
}

/* Flechas de navegación */
.vd-swiper-prev,
.vd-swiper-next {
    color: #eb0a1e;
    top: 50%;
    transform: translateY(-60%);   /* compensa la paginación inferior */
}

.vd-swiper-prev::after,
.vd-swiper-next::after {
    font-size: 1.4rem;
    font-weight: 900;
}

.vd-swiper-prev {
    left: 0;
}

.vd-swiper-next {
    right: 0;
}

/* Paginación (dots) */
.vd-swiper-pagination {
    bottom: 0;
}

.vd-swiper-pagination .swiper-pagination-bullet {
    background: #ccc;
    opacity: 1;
}

.vd-swiper-pagination .swiper-pagination-bullet-active {
    background: #eb0a1e;
}

/* ═══════════════════════════════════════════════════════════════════════
   CARRUSEL MOBILE (Bootstrap – ≤ 3 cards)
   ═══════════════════════════════════════════════════════════════════════ */
.vd-cards-mobile-carousel {
    padding: 0 15px 50px;
}

.vd-cards-mobile-carousel .carousel-inner {
    overflow: visible;    /* que se vea el box-shadow de las cards */
}

.vd-cards-mobile-carousel .carousel-item {
    padding: 0 5px 10px;
}

.vd-cards-mobile-carousel .vd-card {
    margin: 0 auto;
    max-width: 420px;
}

/* Indicadores del carrusel mobile */
.vd-mobile-indicators {
    bottom: 0;
}

.vd-mobile-indicators li {
    background-color: #ccc;
    border-radius: 50%;
    width: 10px;
    height: 10px;
}

.vd-mobile-indicators li.active {
    background-color: #eb0a1e;
}

/* Controles del carrusel mobile */
.vd-cards-mobile-carousel .carousel-control-prev,
.vd-cards-mobile-carousel .carousel-control-next {
    width: 40px;
    color: #eb0a1e;
    filter: none;
    opacity: 1;
}

.vd-cards-mobile-carousel .carousel-control-prev-icon,
.vd-cards-mobile-carousel .carousel-control-next-icon {
    background-color: #eb0a1e;
    border-radius: 50%;
    padding: 12px;
    background-size: 55%;
}

/* ── SECCIÓN: FORMULARIO ───────────────────────────────────────────── */
.vd-formulario {
    background-color: #fff;
}

.vd-formulario__titulo {
    font-size: 1.75rem;
    font-weight: 700;
    color: #282830;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.vd-formulario__wrapper {
    text-align: left;
}

/* CF7 overrides dentro de la sección */
.vd-formulario .wpcf7-form input[type="text"],
.vd-formulario .wpcf7-form input[type="email"],
.vd-formulario .wpcf7-form input[type="tel"],
.vd-formulario .wpcf7-form select,
.vd-formulario .wpcf7-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: .6rem .9rem;
    font-size: .9rem;
    color: #282830;
    margin-bottom: .75rem;
    transition: border-color .2s;
}

.vd-formulario .wpcf7-form input:focus,
.vd-formulario .wpcf7-form select:focus,
.vd-formulario .wpcf7-form textarea:focus {
    outline: none;
    border-color: #eb0a1e;
}

.vd-formulario .wpcf7-form input[type="submit"] {
    background-color: #eb0a1e;
    color: #fff;
    border: none;
    padding: .75rem 2.5rem;
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color .2s;
}

.vd-formulario .wpcf7-form input[type="submit"]:hover {
    background-color: #c20017;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .vd-cards-slider-wrap {
        padding: 0 40px 50px;
    }
}

@media (max-width: 767px) {
    .vd-card__image img {
        height: 180px;
    }
    .vd-ofertas__titulo,
    .vd-formulario__titulo {
        font-size: 1.35rem;
    }
    /* En mobile el slider Swiper también se activa con 1 slide visible */
    .vd-cards-slider-wrap {
        padding: 0 10px 50px;
    }
    .vd-swiper-prev { left: -5px; }
    .vd-swiper-next { right: -5px; }
}


/* ── SECCIÓN: DESCRIPCIÓN ──────────────────────────────────────────── */
.vd-descripcion {
    background-color: #fff;
}

.vd-descripcion p {
    color: var(--vd-text);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: .5rem;
}

.vd-descripcion p:first-child {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--vd-dark);
}

/* ── SECCIÓN: CARDS DE OFERTAS ─────────────────────────────────────── */
.vd-ofertas {
    background-color: var(--vd-gray);
}

.vd-ofertas__titulo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--vd-dark);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .5rem;
}

/* Separador rojo estilo Toyota */
.vd-ofertas__separator {
    display: inline-block;
    width: 60px;
    height: 3px;
    background-color: var(--vd-red);
    border-radius: 2px;
    margin: auto;
}

/* ── CARD ─────────────────────────────────────────────────────────── */
.vd-card {
    background: #fff;
    border-radius: var(--vd-radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s ease;
}

.vd-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, .14);
}

.vd-card__image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.vd-card__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vd-card__titulo {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--vd-dark);
    margin-bottom: .75rem;
}

/* Texto colapsable */
.vd-card__descripcion {
    font-size: .875rem;
    color: var(--vd-text);
    line-height: 1.65;
    overflow: hidden;
    max-height: 90px;        /* Muestra ~4 líneas */
    transition: max-height .35s ease;
    position: relative;
}

.vd-card__descripcion::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
    transition: opacity .25s;
}

.vd-card__descripcion.expanded {
    max-height: 600px;
}

.vd-card__descripcion.expanded::after {
    opacity: 0;
}

/* Botón toggle */
.vd-card__toggle {
    background: none;
    border: none;
    padding: .4rem 0 .8rem;
    cursor: pointer;
    font-size: .8rem;
    color: var(--vd-red);
    font-weight: 600;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.vd-card__toggle .toggle-label-less {
    display: none;
}

.vd-card__toggle.active .toggle-label-more {
    display: none;
}

.vd-card__toggle.active .toggle-label-less {
    display: inline;
}

/* Botón de link */
.vd-card__link.btn-vd {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: auto;
    padding: .55rem 1.1rem;
    background-color: transparent;
    border: 2px solid var(--vd-red);
    color: var(--vd-red);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    border-radius: var(--vd-radius);
    text-decoration: none;
    transition: background-color .2s, color .2s;
    align-self: flex-start;
}

.vd-card__link.btn-vd:hover {
    background-color: var(--vd-red);
    color: #fff;
    text-decoration: none;
}

/* ── SECCIÓN: FORMULARIO ───────────────────────────────────────────── */
.vd-formulario {
    background-color: #fff;
}

.vd-formulario__titulo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--vd-dark);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.vd-formulario__wrapper {
    text-align: left;
}

/* CF7 overrides dentro de la sección */
.vd-formulario .wpcf7-form input[type="text"],
.vd-formulario .wpcf7-form input[type="email"],
.vd-formulario .wpcf7-form input[type="tel"],
.vd-formulario .wpcf7-form select,
.vd-formulario .wpcf7-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: var(--vd-radius);
    padding: .6rem .9rem;
    font-size: .9rem;
    color: var(--vd-dark);
    margin-bottom: .75rem;
    transition: border-color .2s;
}

.vd-formulario .wpcf7-form input:focus,
.vd-formulario .wpcf7-form select:focus,
.vd-formulario .wpcf7-form textarea:focus {
    outline: none;
    border-color: var(--vd-red);
}

.vd-formulario .wpcf7-form input[type="submit"] {
    background-color: var(--vd-red);
    color: #fff;
    border: none;
    padding: .75rem 2.5rem;
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-radius: var(--vd-radius);
    cursor: pointer;
    transition: background-color .2s;
}

.vd-formulario .wpcf7-form input[type="submit"]:hover {
    background-color: #c20017;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .vd-card__image img {
        height: 180px;
    }
    .vd-ofertas__titulo,
    .vd-formulario__titulo {
        font-size: 1.35rem;
    }
}
