/* ── AC Popular Carousel ─────────────────────────────────────── */

/* Título (Elementor heading) que precede al carrusel */
.elementor-widget-heading:has(+ .elementor-widget-shortcode .ac-popcar) .elementor-heading-title {
    margin-bottom: 2rem;
}

/* Wrapper: relative para posicionar flechas, sin overflow hidden */
.ac-popcar {
    position: relative;
    width: 100%;
}

/* ── Swiper ── */
.ac-popcar__swiper {
    overflow: hidden;
    padding: 4px;
}

.ac-popcar__list {
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: stretch;
    /* Curva de easing más suave para el cambio de slide */
    transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

/* ── Card ── */
.ac-popcar__item {
    height: auto;
    display: flex;
}

.ac-popcar__card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.ac-popcar__card:hover {
    box-shadow: 0 12px 32px rgba(10, 30, 51, 0.16);
    transform: translateY(-4px);
}

/* ── Badge de descuento — ESTAMPA circular ── */
.ac-popcar__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    font-family: Catamaran, sans-serif;
    color: #fff;
    line-height: 1;
    pointer-events: none;
}

/* Sello circular con -XX% / Descuento (homologado con .onsale global) */
.ac-popcar__badge--discount {
    width: 62px;
    height: 62px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 0;
    background: radial-gradient(circle at 30% 30%, #EE7A5D 0%, #C84A2C 75%);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow:
        0 0 0 1.5px #C84A2C,
        0 8px 22px rgba(228, 106, 75, 0.45),
        inset 0 -6px 12px rgba(0, 0, 0, 0.12);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transform: rotate(-12deg);
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Brillo decorativo arriba del sello */
.ac-popcar__badge--discount::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 12px;
    width: 16px;
    height: 6px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    filter: blur(1px);
    pointer-events: none;
}

.ac-popcar__card:hover .ac-popcar__badge--discount {
    transform: rotate(-6deg) scale(1.06);
}

.ac-popcar__badge-pct {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
}

.ac-popcar__badge-label {
    font-size: 7.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 2px;
    opacity: 0.95;
}

/* Fallback "Oferta" cuando no se puede calcular el % — sello sin número */
.ac-popcar__badge--sale {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: radial-gradient(circle at 30% 30%, #EE7A5D 0%, #C84A2C 75%);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow:
        0 0 0 1.5px #C84A2C,
        0 6px 18px rgba(228, 106, 75, 0.4);
    transform: rotate(-12deg);
}

/* ── Imagen ── */
.ac-popcar__img-wrap {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #f4f4f4;
    flex-shrink: 0;
}

.ac-popcar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.ac-popcar__card:hover .ac-popcar__img {
    transform: scale(1.06);
}

/* Overlay "Ver producto" */
.ac-popcar__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    background: linear-gradient(to top, rgba(10, 30, 51, 0.55) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ac-popcar__card:hover .ac-popcar__overlay {
    opacity: 1;
}

.ac-popcar__overlay-text {
    font-family: Catamaran, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 6px 16px;
    border-radius: 3px;
    backdrop-filter: blur(4px);
}

/* ── Body del card ── */
.ac-popcar__body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* Título — legible
   Selector calificado con `.ac-popcar` (especificidad 0,2,0) para vencer la
   regla global del tema `.elementor-kit-37 h2` (0,1,1) que de otra forma
   impone el tamaño de heading h2 del kit de Elementor sobre nuestro h2. */
.ac-popcar .ac-popcar__title {
    margin: 0;
    font-family: Catamaran, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    min-height: 2.7em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ac-popcar .ac-popcar__title a {
    color: #0A1E33;
    text-decoration: none;
    font: inherit;
    transition: color 0.2s;
}

.ac-popcar .ac-popcar__title a:hover {
    color: #E46A4B;
}

/* ── Precio: layout limpio con tachado y precio nuevo destacado ── */
.ac-popcar__price {
    font-family: Catamaran, sans-serif;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin: 2px 0 0;
    line-height: 1.2;
}

/* Precio normal (sin oferta) */
.ac-popcar__price > .woocommerce-Price-amount,
.ac-popcar__price > bdi {
    font-size: 18px;
    font-weight: 700;
    color: #0A1E33;
}

/* Precio anterior (tachado) */
.ac-popcar__price del {
    order: 2;
    font-size: 13px;
    font-weight: 500;
    color: #9aa3ad;
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

.ac-popcar__price del .woocommerce-Price-amount {
    color: inherit;
}

/* Precio actual (oferta) */
.ac-popcar__price ins {
    order: 1;
    text-decoration: none;
    font-size: 19px;
    font-weight: 800;
    color: #E46A4B;
    letter-spacing: -0.01em;
}

.ac-popcar__price ins .woocommerce-Price-amount {
    color: inherit;
}

/* CTA */
.ac-popcar__cta {
    display: block;
    margin-top: auto;
    padding: 10px 0;
    font-family: Catamaran, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    color: #0A1E33;
    border: 1.5px solid #0A1E33;
    border-radius: 4px;
    transition: background 0.22s ease, color 0.22s ease;
}

.ac-popcar__cta:hover,
.ac-popcar__cta:focus,
a.ac-popcar__cta:hover,
a.ac-popcar__cta:focus {
    background: #0A1E33 !important;
    color: #fff !important;
}

/* ── Flechas ─────────────────────────────────────────────────── */
.ac-popcar__arrow {
    position: absolute;
    /* Centradas verticalmente en el área de imagen (aprox 75% de aspect 3:4) */
    top: calc(37.5% - 24px);
    z-index: 20;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    padding: 0;
    color: #0A1E33;
    transition: background 0.22s, color 0.22s, box-shadow 0.22s, transform 0.15s;
    outline: none;
}

.ac-popcar__arrow:hover {
    background: #E46A4B;
    color: #fff;
    box-shadow: 0 6px 20px rgba(228, 106, 75, 0.4);
    transform: scale(1.08);
}

.ac-popcar__arrow:focus-visible {
    outline: 2px solid #E46A4B;
    outline-offset: 2px;
}

.ac-popcar__arrow svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ac-popcar__arrow--prev {
    left: -24px;
}

.ac-popcar__arrow--next {
    right: -24px;
}

/* Si el container no permite overflow, fallback dentro del swiper */
@media (max-width: 1480px) {
    .ac-popcar__arrow--prev { left: 0; }
    .ac-popcar__arrow--next { right: 0; }
}
@media (hover: none) {
    .ac-popcar__arrow { display: none; }
}

/* ── Dots ────────────────────────────────────────────────────── */
.ac-popcar__dots {
    margin-top: 24px !important;
    position: static !important;
    display: flex !important;
    justify-content: center;
    gap: 8px;
    bottom: auto !important;
}

.ac-popcar__dots .swiper-pagination-bullet {
    width: 7px;
    height: 7px;
    background: #ccc;
    opacity: 1;
    margin: 0 !important;
    transition: background 0.2s, width 0.2s, border-radius 0.2s;
    border-radius: 4px;
}

.ac-popcar__dots .swiper-pagination-bullet-active {
    background: #E46A4B;
    width: 22px;
    border-radius: 4px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 767px) {
    .ac-popcar__arrow {
        width: 38px;
        height: 38px;
        top: calc(37.5% - 19px);
    }

    .ac-popcar__arrow svg {
        width: 16px;
        height: 16px;
    }

    .ac-popcar__arrow--prev { left: 0; }
    .ac-popcar__arrow--next { right: 0; }

    .ac-popcar__body {
        padding: 12px 12px 14px;
        gap: 6px;
    }

    .ac-popcar .ac-popcar__title {
        font-size: 14px;
    }

    .ac-popcar__price > .woocommerce-Price-amount,
    .ac-popcar__price > bdi {
        font-size: 16px;
    }

    .ac-popcar__price ins {
        font-size: 17px;
    }

    .ac-popcar__price del {
        font-size: 12px;
    }

    .ac-popcar__cta {
        font-size: 11px;
        padding: 13px 0;
        min-height: 44px;
    }

    .ac-popcar__badge--discount {
        width: 54px;
        height: 54px;
    }

    .ac-popcar__badge-pct {
        font-size: 15px;
    }

    .ac-popcar__badge-label {
        font-size: 7px;
    }
}
