/* Popup / Modal — mismo diseño que el popup "Venta Especial" de tiidemexico.com.mx.
   Contenido gestionado desde wp-admin → Popup (ver app/_popup.php). */

.tii-popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    background: rgba(20, 20, 20, .55);
    opacity: 0;
    pointer-events: none;
    padding: 16px;
    box-sizing: border-box;
    transition: opacity .3s ease;
}

.tii-popup-overlay.tii-open {
    opacity: 1;
    pointer-events: auto;
}

.tii-popup-card {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    display: flex;
    flex-direction: column;
    transform: translateY(14px) scale(.98);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
}

.tii-popup-overlay.tii-open .tii-popup-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.tii-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: #333;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.tii-popup-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 26px 7px;
    background: var(--tii-accent, #6AD517);
}

.tii-popup-logo {
    width: 80px;
    height: 80px;
    flex: none;
    object-fit: contain;
}

.tii-popup-badge {
    position: relative;
    z-index: 2;
    background: var(--tii-accent2, #FBDA2F);
    color: #222;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .05em;
    padding: 7px 16px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}

.tii-popup-products {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 2px 20px 6px;
    background: var(--tii-accent, #6AD517);
}

.tii-popup-oval {
    position: absolute;
    z-index: 0;
    bottom: 20px;
    left: 50%;
    width: 572px;
    height: 338px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .1);
    transform: translateX(-50%);
}

.tii-popup-product {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tii-popup-product.tii-offset {
    margin-top: 18px;
}

.tii-popup-photo {
    position: relative;
    width: 200px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: radial-gradient(circle at 50% 42%, #fff 55%, #e2e2e2 100%);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .28);
}

.tii-popup-photo-shade {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .1);
}

.tii-popup-photo img {
    position: relative;
    width: 94%;
    height: 94%;
    object-fit: contain;
}

.tii-popup-price-old {
    position: absolute;
    top: 8px;
    right: -6px;
    background: #4a4a4a;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 5px 12px 5px 14px;
    border-radius: 16px 0 0 16px;
    box-shadow: -2px 3px 8px rgba(0, 0, 0, .25);
    text-decoration: line-through;
}

.tii-popup-price-new {
    position: absolute;
    top: 38px;
    right: -6px;
    background: #E01E1E;
    color: #fff;
    font-weight: 800;
    font-size: 17px;
    padding: 6px 14px 6px 16px;
    border-radius: 16px 0 0 16px;
    box-shadow: -2px 3px 8px rgba(0, 0, 0, .3);
}

.tii-popup-model {
    font-weight: 800;
    font-size: 15px;
    color: #fff;
}

.tii-popup-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 26px 34px;
    text-align: center;
}

.tii-popup-title {
    margin: 0;
    font-weight: 800;
    font-size: 21px;
    line-height: 1.15;
    color: #1a1a1a;
}

.tii-popup-sub {
    margin: 0;
    max-width: 520px;
    font-weight: 600;
    font-size: 11px;
    line-height: 1.4;
    color: #555;
}

.tii-popup-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.tii-popup-feature {
    background: var(--tii-accent2, #FBDA2F);
    color: #000;
    font-weight: 800;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 20px;
}

.tii-popup-cta {
    display: block;
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
    margin-top: 8px;
    margin-bottom: 20px;
    padding: 12px 0;
    background: var(--tii-accent, #6AD517);
    color: #111;
    text-decoration: none;
    text-align: center;
    font-weight: 800;
    font-size: 15px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(106, 213, 23, .4);
}

.tii-popup-fine {
    font-size: 9px;
    color: #777;
}

@media (max-width: 640px) {
    .tii-popup-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .tii-popup-card {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(30px);
    }

    .tii-popup-overlay.tii-open .tii-popup-card {
        transform: translateY(0);
    }

    .tii-popup-header {
        padding: 12px 18px 8px;
    }

    .tii-popup-logo {
        width: 52px;
        height: 52px;
    }

    .tii-popup-oval {
        width: min(340px, 100%);
        height: 200px;
        bottom: 14px;
    }

    .tii-popup-photo {
        width: 130px;
        height: 150px;
        border-radius: 12px;
    }

    .tii-popup-photo-shade {
        width: 100px;
        height: 100px;
    }

    .tii-popup-price-old {
        font-size: 10px;
        padding: 4px 9px 4px 10px;
    }

    .tii-popup-price-new {
        top: 32px;
        font-size: 13px;
        padding: 5px 11px 5px 12px;
    }

    .tii-popup-model {
        font-size: 12px;
    }

    .tii-popup-title {
        font-size: 18px;
    }
}
