/*
 * ═══════════════════════════════════════════════════════════════════════════════
 * Lavisa Destinations Theme — DEAL MODAL POLISH (3.1.15)
 * ═══════════════════════════════════════════════════════════════════════════════
 *
 * @file        assets/css/ldt-enhanced-deal-modal-polish.css
 * @package     Lavisa_Destinations_Theme
 * @since       3.1.15
 * @depends     ALL prior enhanced CSS (loads after modal-polish at end of chain)
 *
 * Visual styling for the JS-injected #ldt-deal-modal that opens when a user
 * clicks any .ldt-deal card. Mirrors the attraction-modal pattern (3.1.10-
 * 3.1.14) so deals and attractions feel like siblings:
 *
 *   • Z-index 999999 (escapes WP admin bar — same lesson as 3.1.12)
 *   • Flex-column layout with image at top + body that scrolls (3.1.11)
 *   • Multi-layer brand-blue shadow + dark backdrop with blur
 *   • Image: 200px, full-width, rounded top corners, with floating discount chip
 *   • Type pill (uses inline gradient bg from JS based on deal_type_color)
 *   • Countdown pill (red-tinted when expiring)
 *   • Bigger title (24px / 800 weight)
 *   • Destination link below title with map-pin emoji
 *   • Price row: from-price (brand blue 800), original (strikethrough gray),
 *     savings (green pill)
 *   • Description with comfortable line-height
 *   • Details rows (Valid / Type / etc.) with brand-blue label dividers
 *   • Terms accordion with smooth open/close
 *   • Brand-gradient "Book Now" CTA with hover lift + arrow shift
 *   • Close button: white-glass circle, accent on hover with 90° rotate
 *   • Mobile (≤768px): tighter dimensions
 *   • Reduced motion: all transforms disabled
 *
 * Modal markup is injected by ldt-deal-modal.js — no PHP partial edit.
 *
 * ═══════════════════════════════════════════════════════════════════════════════
 */


/* ═══════════════════════════════════════════════════════════════════════════════
 * 0. Z-INDEX + STACKING — sit above WP admin bar (lesson from 3.1.12)
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

body .ldt-deal-modal[aria-hidden="false"] {
    display: flex;
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 1. OVERLAY — dark with backdrop-blur
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 12, 30, 0.68);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 2. CONTENT — flex column, image stays put, body scrolls
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__content {
    position: relative;
    background: #ffffff;
    border-radius: 1.5rem;
    max-width: 720px;
    width: 92vw;
    max-height: 86vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 32px 80px -20px rgba(0, 53, 128, 0.55),
        0 12px 24px rgba(0, 0, 0, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.50) inset;
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 3. CLOSE BUTTON — white-glass circle, accent hover with 90° rotate
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ldt-primary, #003580);
    border: 1px solid rgba(0, 53, 128, 0.16);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.20),
        0 0 0 1px rgba(255, 255, 255, 0.40) inset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    transition:
        background 220ms cubic-bezier(0.22, 1, 0.36, 1),
        color 220ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) and (pointer: fine) {
    body .ldt-deal-modal__close:hover {
        background: linear-gradient(135deg, #ff9d1a 0%, #ff8c00 100%);
        color: #ffffff;
        border-color: transparent;
        transform: rotate(90deg);
    }
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 4. MEDIA HEADER — image stays put with rounded top corners
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__media {
    position: relative;
    flex: 0 0 200px;
    height: 200px;
    overflow: hidden;
}

body .ldt-deal-modal__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

body .ldt-deal-modal__media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.00) 50%,
        rgba(0, 0, 0, 0.35) 100%
    );
    pointer-events: none;
}

/* Floating discount chip on the image */
body .ldt-deal-modal__discount {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.005em;
    box-shadow:
        0 6px 16px rgba(239, 68, 68, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.20) inset;
    z-index: 2;
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 5. BODY — scrollable area
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 22px 28px 24px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 53, 128, 0.30) transparent;
}

body .ldt-deal-modal__body::-webkit-scrollbar {
    width: 6px;
}
body .ldt-deal-modal__body::-webkit-scrollbar-thumb {
    background: rgba(0, 53, 128, 0.30);
    border-radius: 3px;
}
body .ldt-deal-modal__body::-webkit-scrollbar-track {
    background: transparent;
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 6. TOPBAR — type pill (left) + countdown (right)
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

body .ldt-deal-modal__type {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 9999px;
    color: #ffffff;
    font-weight: 800;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

body .ldt-deal-modal__countdown {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 9999px;
    background: rgba(0, 53, 128, 0.06);
    border: 1px solid rgba(0, 53, 128, 0.14);
    color: var(--ldt-gray-700, #334155);
    font-size: 12.5px;
    font-weight: 600;
}

body .ldt-deal-modal__countdown.is-urgent {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.35);
    color: #b91c1c;
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 7. TITLE + DESTINATION
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: var(--ldt-dark, #1e293b);
    margin: 0 0 4px;
}

body .ldt-deal-modal__dest {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ldt-primary, #003580);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 14px;
    transition: color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) and (pointer: fine) {
    body .ldt-deal-modal__dest:hover {
        color: var(--ldt-accent, #ff8c00);
    }
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 8. PRICE ROW — from / original (strikethrough) / savings pill
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 16px;
}

body .ldt-deal-modal__price-from {
    font-size: 26px;
    font-weight: 800;
    color: var(--ldt-primary, #003580);
    letter-spacing: -0.015em;
}
body .ldt-deal-modal__price-from:empty {
    display: none;
}

body .ldt-deal-modal__price-orig {
    font-size: 14px;
    font-weight: 600;
    color: var(--ldt-gray-400, #94a3b8);
    text-decoration: line-through;
}
body .ldt-deal-modal__price-orig:empty {
    display: none;
}

body .ldt-deal-modal__savings {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.32);
    color: #047857;
    font-size: 12px;
    font-weight: 700;
}
body .ldt-deal-modal__savings:empty {
    display: none;
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 9. DESCRIPTION
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ldt-gray-700, #334155);
    margin: 0 0 16px;
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 10. DETAILS ROWS — Valid / Type / etc.
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__details {
    border-top: 1px solid rgba(0, 53, 128, 0.12);
    margin-bottom: 16px;
    padding-top: 4px;
}

body .ldt-deal-modal__detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 53, 128, 0.08);
    font-size: 13.5px;
}

body .ldt-deal-modal__detail-row:last-child {
    border-bottom: none;
}

body .ldt-deal-modal__detail-row > *:first-child {
    color: var(--ldt-primary, #003580);
    font-weight: 700;
}

body .ldt-deal-modal__detail-row > *:last-child {
    color: var(--ldt-gray-700, #334155);
    text-align: right;
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 11. TERMS ACCORDION
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__terms-wrap {
    border-top: 1px solid rgba(0, 53, 128, 0.12);
    margin-bottom: 18px;
    padding-top: 10px;
}

body .ldt-deal-modal__terms-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--ldt-primary, #003580);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    transition: color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

body .ldt-deal-modal__terms-toggle[aria-expanded="true"] span {
    transform: rotate(180deg);
    display: inline-block;
}

body .ldt-deal-modal__terms-toggle span {
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) and (pointer: fine) {
    body .ldt-deal-modal__terms-toggle:hover {
        color: var(--ldt-accent-dark, #e07a00);
    }
}

body .ldt-deal-modal__terms {
    margin-top: 10px;
    padding: 14px;
    background: rgba(0, 53, 128, 0.04);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ldt-gray-700, #334155);
    white-space: pre-wrap;
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 12. CTA BUTTON — brand-gradient pill with hover lift + arrow shift
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal-modal__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #003580 0%, #0057b8 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.005em;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow:
        0 6px 18px rgba(0, 53, 128, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.18) inset;
    transition:
        transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

body .ldt-deal-modal__cta-arrow {
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
    font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
    body .ldt-deal-modal__cta:hover {
        transform: translateY(-2px);
        box-shadow:
            0 12px 28px rgba(0, 53, 128, 0.55),
            0 0 0 1px rgba(255, 255, 255, 0.25) inset;
        filter: brightness(1.08);
    }

    body .ldt-deal-modal__cta:hover .ldt-deal-modal__cta-arrow {
        transform: translateX(3px);
    }

    [dir="rtl"] body .ldt-deal-modal__cta:hover .ldt-deal-modal__cta-arrow,
    .ldt-rtl body .ldt-deal-modal__cta:hover .ldt-deal-modal__cta-arrow {
        transform: translateX(-3px);
    }
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 13. MOBILE — tighter dimensions
 * ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    body .ldt-deal-modal__content {
        max-width: 96vw;
        max-height: 92vh;
        border-radius: 1.25rem;
    }

    body .ldt-deal-modal__media,
    body .ldt-deal-modal__media img {
        flex: 0 0 160px !important;
        height: 160px !important;
    }

    body .ldt-deal-modal__body {
        padding: 18px 20px 20px;
    }

    body .ldt-deal-modal__title {
        font-size: 20px;
    }

    body .ldt-deal-modal__price-from {
        font-size: 22px;
    }

    body .ldt-deal-modal__close {
        width: 32px;
        height: 32px;
        top: 10px;
        right: 10px;
    }

    body .ldt-deal-modal__cta {
        padding: 11px 20px;
        font-size: 13.5px;
        width: 100%;
        justify-content: center;
    }

    body .ldt-deal-modal__topbar {
        margin-bottom: 10px;
    }

    body .ldt-deal-modal__price-row .ldt-deal-modal__savings {
        margin-left: 0;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 14. CARD CLICKABLE INDICATOR — subtle visual hint that the whole card is clickable
 * ═══════════════════════════════════════════════════════════════════════════════ */

body .ldt-deal[data-ldt-deal-wired="1"] {
    cursor: pointer;
    transition:
        transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

@media (hover: hover) and (pointer: fine) {
    body .ldt-deal[data-ldt-deal-wired="1"]:hover {
        transform: translateY(-2px);
        box-shadow:
            0 12px 28px rgba(0, 53, 128, 0.18),
            0 4px 8px rgba(0, 0, 0, 0.06) !important;
    }
}

body .ldt-deal[data-ldt-deal-wired="1"]:focus-visible {
    outline: 3px solid var(--ldt-accent, #ff8c00);
    outline-offset: 3px;
}


/* ═══════════════════════════════════════════════════════════════════════════════
 * 15. REDUCED MOTION
 * ═══════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    body .ldt-deal-modal__close,
    body .ldt-deal-modal__cta,
    body .ldt-deal-modal__cta-arrow,
    body .ldt-deal-modal__terms-toggle span,
    body .ldt-deal-modal__dest,
    body .ldt-deal[data-ldt-deal-wired="1"] {
        transition: none !important;
    }

    body .ldt-deal-modal__close:hover,
    body .ldt-deal-modal__cta:hover,
    body .ldt-deal[data-ldt-deal-wired="1"]:hover {
        transform: none !important;
    }

    body .ldt-deal-modal__cta:hover .ldt-deal-modal__cta-arrow {
        transform: none !important;
    }
}


/* ─── END OF ldt-enhanced-deal-modal-polish.css ───────────────────────────── */
