/* ============================================================
   Intent Popup — Frontend Styles
   Brand palette: deep navy blue + fresh green (mamadose.com)
   ============================================================ */

:root {
    --ip-blue-deep:   #0b1d3a;
    --ip-blue-mid:    #1a3a72;
    --ip-blue-grad:   linear-gradient(135deg, #0b1d3a 0%, #1a3a72 60%, #1e4f9c 100%);
    --ip-green:       #22c55e;
    --ip-green-hover: #16a34a;
    --ip-green-light: #dcfce7;
    --ip-gold:        #f59e0b;
    --ip-white:       #ffffff;
    --ip-gray-50:     #f8fafc;
    --ip-gray-100:    #f1f5f9;
    --ip-gray-400:    #94a3b8;
    --ip-gray-600:    #475569;
    --ip-gray-900:    #0f172a;
    --ip-overlay:     rgba(8, 15, 35, 0.88);
    --ip-radius:      20px;
    --ip-shadow:      0 25px 60px rgba(0, 0, 0, 0.45), 0 8px 20px rgba(0, 0, 0, 0.25);
    --ip-transition:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Overlay ──────────────────────────────────────────────────────────────── */

#intent-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: var(--ip-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#intent-overlay.ip-active {
    opacity: 1;
    visibility: visible;
}

/* ── Modal card ───────────────────────────────────────────────────────────── */

#intent-modal {
    position: relative;
    display: flex;
    background: var(--ip-white);
    border-radius: var(--ip-radius);
    box-shadow: var(--ip-shadow);
    overflow: hidden;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    transform: translateY(40px) scale(0.95);
    opacity: 0;
    transition: transform 0.45s var(--ip-transition), opacity 0.35s ease;
}

#intent-overlay.ip-active #intent-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ── Close button ─────────────────────────────────────────────────────────── */

#intent-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ip-gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: background 0.2s, color 0.2s, transform 0.2s;
    padding: 0;
    line-height: 1;
}

#intent-close:hover {
    background: var(--ip-gray-900);
    color: var(--ip-white);
    transform: rotate(90deg);
}

/* ── Image column ─────────────────────────────────────────────────────────── */

.ip-image-col {
    position: relative;
    flex: 0 0 240px;
    background: var(--ip-blue-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 320px;
}

.ip-image-col::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(11, 29, 58, 0.55) 100%);
}

.ip-image-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ip-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Ribbon badge */
.ip-ribbon {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    background: var(--ip-gold);
    color: #1a1000;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45);
}

/* ── Content column ───────────────────────────────────────────────────────── */

.ip-content-col {
    flex: 1;
    padding: 34px 32px 28px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Eyebrow */
.ip-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ip-blue-mid);
    margin-bottom: 10px;
}

.ip-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ip-green);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: ip-pulse 1.8s infinite;
    flex-shrink: 0;
}

@keyframes ip-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);  }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);    }
}

/* Headline */
.ip-headline {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--ip-gray-900);
    margin: 0 0 10px;
    letter-spacing: -0.5px;
}

/* Product name */
.ip-product-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ip-blue-mid);
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Product description */
.ip-product-desc {
    font-size: 13px;
    color: var(--ip-gray-600);
    line-height: 1.6;
    margin: 0 0 14px;
}

/* Price row */
.ip-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ip-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--ip-gray-900);
    line-height: 1;
}

.ip-price .woocommerce-Price-amount,
.ip-price bdi {
    font-size: 22px;
    font-weight: 800;
    color: var(--ip-gray-900);
}

.ip-price ins {
    text-decoration: none;
}

.ip-price del {
    font-size: 14px;
    color: var(--ip-gray-400);
    font-weight: 500;
    opacity: 0.7;
    margin-right: 4px;
}

.ip-free-ship-badge {
    font-size: 11px;
    font-weight: 700;
    color: #166534;
    background: var(--ip-green-light);
    border-radius: 20px;
    padding: 4px 10px;
    white-space: nowrap;
}

/* ── CTA button ───────────────────────────────────────────────────────────── */

.ip-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 24px;
    background: var(--ip-green);
    color: var(--ip-white);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.3px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
    text-decoration: none;
    margin-bottom: 10px;
    animation: ip-cta-glow 2.5s ease-in-out infinite;
}

@keyframes ip-cta-glow {
    0%, 100% { box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4); }
    50%       { box-shadow: 0 6px 24px rgba(34, 197, 94, 0.65); }
}

.ip-cta-btn:hover {
    background: var(--ip-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.5);
    animation: none;
    color: var(--ip-white);
    text-decoration: none;
}

.ip-cta-btn:active {
    transform: translateY(0);
}

.ip-cta-btn.ip-loading {
    opacity: 0.75;
    cursor: not-allowed;
    animation: none;
}

.ip-cta-btn.ip-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ip-spin 0.6s linear infinite;
}

.ip-cta-btn.ip-added {
    background: #15803d;
    animation: none;
    box-shadow: none;
}

@keyframes ip-spin {
    to { transform: rotate(360deg); }
}

.ip-cart-icon {
    flex-shrink: 0;
}

/* ── Secondary links ──────────────────────────────────────────────────────── */

.ip-view-link {
    display: block;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--ip-blue-mid);
    text-decoration: none;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 6px;
}

.ip-view-link:hover {
    background: var(--ip-gray-100);
    color: var(--ip-blue-deep);
    text-decoration: none;
}

.ip-dismiss {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: var(--ip-gray-400);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s;
}

.ip-dismiss:hover {
    color: var(--ip-gray-600);
    text-decoration: underline;
}

/* ── No-scroll helper ─────────────────────────────────────────────────────── */

body.ip-no-scroll {
    overflow: hidden;
}

/* ── Checkout prompt state ────────────────────────────────────────────────── */

.ip-checkout-btn {
    background: var(--ip-blue-mid) !important;
    box-shadow: 0 4px 16px rgba(26, 58, 114, 0.4) !important;
    animation: none !important;
}

.ip-checkout-btn:hover {
    background: var(--ip-blue-deep) !important;
    box-shadow: 0 8px 24px rgba(26, 58, 114, 0.5) !important;
}

/* ── Responsive — mobile ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
    #intent-modal {
        flex-direction: column;
        max-height: 92vh;
        border-radius: 16px;
    }

    .ip-image-col {
        flex: 0 0 auto;
        min-height: 200px;
        max-height: 230px;
    }

    .ip-content-col {
        padding: 24px 20px 20px;
    }

    .ip-headline {
        font-size: 21px;
    }

    .ip-cta-btn {
        padding: 13px 20px;
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    #intent-overlay {
        padding: 8px;
        align-items: flex-end;
    }

    #intent-modal {
        border-radius: 16px 16px 0 0;
        max-height: 88vh;
    }

    .ip-image-col {
        min-height: 170px;
        max-height: 190px;
    }
}
