/* 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;
    transition: background-color .2s ease, transform .2s ease;
}

.tii-popup-close:hover,
.tii-popup-close:focus-visible {
    background: #fff;
    color: #111;
    transform: scale(1.08);
}

/* CMY ink motif (printing-themed, brand-fixed — not tied to the per-campaign
   accent color fields, which still drive the badge/features/CTA below): one
   predominant flat color filling the area, with the other two inks as solid
   triangular blocks cut into the top-right and bottom-left corners — hard,
   crisp edges between the three colors, no gradient/blur blending. Which of
   the three is dominant rotates weekly (see --tii-ink-* vars, set inline by
   PHP), the other two always fill the two corner triangles.

   The two triangles stay flat/static; the movement lives in a dedicated
   .tii-popup-ink-scan layer instead — a single thin, faint diagonal band of
   light (not a repeating stripe pattern) that sweeps across once and loops,
   like a scanner. It sits below the two triangles (z-index) so they mask it
   out over their own area and it only ever reads in the exposed dominant-
   color strip between them, and it starts/ends fully off the visible area
   so the loop reset is invisible. */
.tii-popup-ink {
    position: relative;
    z-index: 0;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    background: var(--tii-ink-dominant, #EC008C);
}

.tii-popup-ink-scan {
    position: absolute;
    z-index: -1;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg, transparent 40%, rgba(255, 255, 255, .16) 44%, rgba(255, 255, 255, .16) 56%, transparent 60%);
    transform: rotate(25deg) translateX(-60%);
    animation: tii-popup-ink-scan 3.2s linear infinite;
    pointer-events: none;
}

@keyframes tii-popup-ink-scan {
    to { transform: rotate(25deg) translateX(60%); }
}

@media (prefers-reduced-motion: reduce) {
    .tii-popup-ink-scan {
        animation: none;
    }
}

.tii-popup-ink::before,
.tii-popup-ink::after {
    content: '';
    position: absolute;
    z-index: 0;
    width: 34%;
    height: 34%;
}

.tii-popup-ink::before {
    top: 0;
    right: 0;
    background: var(--tii-ink-corner1, #FFE900);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.tii-popup-ink::after {
    bottom: 0;
    left: 0;
    background: var(--tii-ink-corner2, #00AEEF);
    clip-path: polygon(0 100%, 0 0, 100% 100%);
}

.tii-popup-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 26px 7px;
}

.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;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 2px 20px 6px;
}

.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;
}

/* overflow:hidden lives on .tii-popup-photo-mask (below), not here — the price
   tags need to hang slightly past the box's right edge (see their negative
   `right` offset) without getting clipped, which happened on mobile where the
   narrower box cropped them almost entirely. */
.tii-popup-photo {
    position: relative;
    width: 200px;
    height: 220px;
    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-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: inherit;
}

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

.tii-popup-photo::after {
    content: '';
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 8%;
    width: 55%;
    height: 12px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, .4) 0%, rgba(0, 0, 0, 0) 75%);
    transform: translateX(-50%) scale(1);
    animation: tii-popup-shadow 5s ease-in-out infinite;
    pointer-events: none;
}

.tii-popup-photo img {
    position: relative;
    z-index: 2;
    width: 94%;
    height: 94%;
    object-fit: contain;
    animation: tii-popup-float 5s ease-in-out infinite;
}

@keyframes tii-popup-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes tii-popup-shadow {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: .55; }
    50% { transform: translateX(-50%) scale(.78); opacity: .3; }
}

@media (prefers-reduced-motion: reduce) {
    .tii-popup-photo img,
    .tii-popup-photo::after {
        animation: none;
    }
}

.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;
}

/* Same pill + trailing black circle-arrow format used by the other CTA buttons
   across the site (e.g. .tii-conversion__button in the conversion-landing
   block): label left-aligned, round icon on the right. */
.tii-popup-cta {
    display: inline-flex;
    max-width: 100%;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 20px;
    padding: 6px 6px 6px 24px;
    background: var(--tii-accent, #6AD517);
    color: #111;
    text-decoration: none;
    font-weight: 800;
    font-size: 15px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(106, 213, 23, .4);
    transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
}

.tii-popup-cta::after {
    content: "→";
    display: grid;
    flex: none;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 17px;
    line-height: 1;
    transition: transform .2s ease;
}

.tii-popup-cta:hover,
.tii-popup-cta:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(106, 213, 23, .5);
}

.tii-popup-cta:hover::after,
.tii-popup-cta:focus-visible::after {
    transform: translateX(3px);
}

.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-ink {
        border-radius: 24px 24px 0 0;
    }

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

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

    .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;
    }
}
