/* ===============================
   MÓDULO PUBLICIDAD PREMIUM - REVISIÓN 2
   =============================== */

.ads-section {
    position: relative;
    margin-top: 24px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(30, 32, 36, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        inset 0 0 0 1px rgba(255, 140, 0, 0.12),
        0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.ads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.ads-title h3 {
    margin: 0;
    font-family: var(--font-heading, "Montserrat", sans-serif);
    font-weight: 800;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    color: var(--text-main);
}

.ads-cta-top {
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    background: rgba(255, 140, 0, 0.15);
    border: 1px solid rgba(255, 140, 0, 0.4);
    color: #ffaa33;
    transition: all 0.3s ease;
}

.ads-cta-top:hover {
    background: rgba(255, 140, 0, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.2);
}

/* CAROUSEL */
.ads-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px 0;
    -webkit-mask-image: linear-gradient(to right, transparent, rgba(0, 0, 0, 1) 5%, rgba(0, 0, 0, 1) 95%, transparent);
    mask-image: linear-gradient(to right, transparent, rgba(0, 0, 0, 1) 5%, rgba(0, 0, 0, 1) 95%, transparent);
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    /* scroll-behavior: smooth; ELIMINADO para arrastre libre */
    scroll-behavior: auto;
}

.ads-carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.ads-carousel-wrapper:active {
    cursor: grabbing;
}

.ads-carousel-track {
    display: flex;
    gap: 20px;
    width: max-content;
    align-items: center;
    /* Manual scroll replaces css animation */
}

.ads-carousel-track:hover {
    animation-play-state: paused;
}

/* Micro Parallax on Hover - Desktop Only */
@media (hover: hover) and (pointer: fine) {
    .ads-section:hover {
        /* Desplaza microscópicamente la sombra de borde y global en desktop */
        box-shadow:
            inset 0 0 0 1px rgba(255, 140, 0, 0.2),
            0 15px 45px rgba(0, 0, 0, 0.4);
        transform: translateY(-2px);
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    }

    .impulsate-wrap:hover {
        box-shadow:
            inset 0 0 0 1px rgba(255, 140, 0, 0.2),
            0 15px 45px rgba(0, 0, 0, 0.4);
        transform: translateY(-2px);
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    }
}

@keyframes scrollAds {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 10px));
    }
}

.ad-card {
    width: 200px;
    height: 90px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    flex-shrink: 0;
    user-select: none;
}

.ad-card:hover {
    transform: scale(1.03) rotate(1deg);
    border-color: rgba(255, 140, 0, 0.4);
    background: rgba(255, 140, 0, 0.08);
    box-shadow:
        inset 0 0 0 1px rgba(255, 140, 0, 0.15),
        0 8px 24px rgba(255, 140, 0, 0.15);
}

.ad-card.is-selected {
    transform: scale(1.08) rotate(0deg);
    border-color: rgba(255, 140, 0, 0.8);
    background: rgba(255, 140, 0, 0.15);
    box-shadow:
        inset 0 0 0 1px rgba(255, 140, 0, 0.3),
        0 10px 30px rgba(255, 140, 0, 0.25);
    z-index: 2;
}

.ad-card__img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    flex-shrink: 0;
}

.ad-card__info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ad-card__title {
    font-weight: 700;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-card__cat {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SHOWCASE */
.ads-showcase {
    background: linear-gradient(135deg, rgba(20, 22, 25, 0.8), rgba(15, 16, 20, 0.9));
    border-radius: 16px;
    border: 0 solid rgba(255, 140, 0, 0.2);
    padding: 0 24px;
    display: flex;
    align-items: flex-end;
    transition: max-height 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2), opacity 0.4s ease, transform 0.4s ease, padding 0.4s ease, margin 0.4s ease, border-width 0.4s;

    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* Initially collapsed */
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    margin-top: -24px;
    /* remove flex gap */
}

.ads-section.is-showcase-open .ads-showcase {
    max-height: 65vh;
    height: 380px;
    padding: 32px 24px 24px;
    border-width: 1px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    margin-top: 0;
}

.ads-showcase::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 0;
}

.showcase-btn-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 99px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 2;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.showcase-btn-close span {
    font-size: 1.1rem;
    line-height: 1;
}

.showcase-btn-close:hover {
    background: rgba(255, 140, 0, 0.4);
    transform: scale(1.05);
}

.detail-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.detail-info h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.detail-info span {
    font-size: 0.85rem;
    color: #ffaa33;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-info span::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #28a745;
    border-radius: 50%;
    box-shadow: 0 0 6px #28a745;
}

.detail-info p {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.detail-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.detail-btn--wsp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
    border-color: rgba(37, 211, 102, 0.3);
}

.detail-btn--wsp:hover {
    background: rgba(37, 211, 102, 0.25);
    transform: translateY(-2px);
}

.detail-btn--call {
    background: rgba(255, 140, 0, 0.15);
    color: #ffaa33;
    border-color: rgba(255, 140, 0, 0.3);
}

.detail-btn--call:hover {
    background: rgba(255, 140, 0, 0.25);
    transform: translateY(-2px);
}

/* IMPÚLSATE NARANJA RENEWAL */
.impulsate-section {
    margin-top: 32px;
}

.impulsate-wrap {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.08), transparent 60%),
        rgba(30, 32, 36, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        inset 0 0 0 1px rgba(255, 140, 0, 0.12),
        0 10px 30px rgba(0, 0, 0, 0.35);
    border-radius: 32px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.impulsate-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 900;
    margin: 0;
    color: #fff;
    letter-spacing: -0.5px;
}

.impulsate-sub {
    font-size: 1.2rem;
    color: #ffaa33;
    font-weight: 700;
    margin: 12px 0 32px 0;
}

.impulsate-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
    display: flex;
    gap: 32px;
    justify-content: center;
    flex-wrap: wrap;
}

.impulsate-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 24px;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.impulsate-icon {
    width: 20px;
    height: 20px;
    color: #ffaa33;
}

.impulsate-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.impulsate-btn {
    padding: 16px 32px;
    border-radius: 16px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.impulsate-btn--primary {
    background: #ff8c00;
    color: #000;
}

.impulsate-btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 140, 0, 0.4);
    background: #ffa500;
}

.impulsate-btn--secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.impulsate-btn--secondary:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* RESPONSIVE & MOBILE FIRST RULES */
@media (max-width: 768px) {
    .ads-carousel-wrapper {
        mask-image: none;
        -webkit-mask-image: none;
    }

    .ads-carousel-track {
        animation: none !important;
        overflow-x: auto;
        padding-bottom: 16px;
        -webkit-overflow-scrolling: touch;
    }

    .ads-carousel-track::-webkit-scrollbar {
        height: 6px;
    }

    .ads-carousel-track::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
    }

    .ads-carousel-track::-webkit-scrollbar-thumb {
        background: rgba(255, 140, 0, 0.4);
        border-radius: 10px;
    }

    .ad-card {
        scroll-snap-align: center;
        width: 240px;
        /* Slightly wider for tap targets */
    }

    .ad-card:hover {
        transform: none;
        /* No tilt on mobile hover */
    }

    .ad-card.is-selected {
        transform: scale(1.05);
    }

    .ads-section.is-showcase-open .ads-showcase {
        max-height: 60vh;
        height: 350px;
        padding: 24px 16px 16px;
    }

    .showcase-btn-close {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .detail-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    .detail-info p {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .detail-actions {
        width: 100%;
        gap: 8px;
    }

    .detail-btn {
        flex: 1;
        justify-content: center;
        padding: 12px;
    }

    .impulsate-wrap {
        padding: 32px 20px;
    }

    .impulsate-benefits {
        flex-direction: column;
        gap: 12px;
    }

    .impulsate-benefits li {
        justify-content: center;
    }

    .impulsate-actions {
        flex-direction: column;
        width: 100%;
    }

    .impulsate-btn {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ads-carousel-track {
        animation: none !important;
        overflow-x: auto;
    }

    .ad-card {
        transition: none !important;
    }

    .ad-card:hover {
        transform: none !important;
    }
}