/**
 * Gapli Exit Intent Popup — Styles
 * Profesjonalny, responsywny popup z glassmorphism i animacjami.
 */

/* Overlay */
.gapli-exit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.gapli-exit-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Content Card */
.gapli-exit-popup__content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: gapliPopupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gapliPopupSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.gapli-exit-popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.gapli-exit-popup__close:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #1f2937;
    transform: rotate(90deg);
}

/* Header */
.gapli-exit-popup__header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    padding: 28px 24px 20px;
    text-align: center;
    color: #ffffff;
}

.gapli-exit-popup__icon {
    font-size: 40px;
    margin-bottom: 8px;
    animation: gapliCartBounce 2s ease-in-out infinite;
}

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

.gapli-exit-popup__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.gapli-exit-popup__subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.85);
}

/* Products */
.gapli-exit-popup__products {
    padding: 16px 20px;
}

.gapli-exit-popup__product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.gapli-exit-popup__product:last-of-type {
    border-bottom: none;
}

.gapli-exit-popup__product-img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f9fafb;
}

.gapli-exit-popup__product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #f3f4f6;
}

.gapli-exit-popup__product-info {
    flex: 1;
    min-width: 0;
}

.gapli-exit-popup__product-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gapli-exit-popup__product-meta {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

.gapli-exit-popup__product-qty {
    color: #9ca3af;
}

.gapli-exit-popup__total {
    padding: 12px 0 0;
    border-top: 2px solid #e5e7eb;
    text-align: right;
    font-size: 15px;
    color: #1f2937;
}

/* Coupon Section */
.gapli-exit-popup__coupon {
    padding: 12px 20px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    margin: 0 20px;
    border-radius: 10px;
    text-align: center;
}

.gapli-exit-popup__coupon-text {
    margin: 0 0 6px;
    font-size: 13px;
    color: #92400e;
}

.gapli-exit-popup__coupon-code {
    background: #ffffff;
    border: 2px dashed #f59e0b;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 18px;
    font-weight: 700;
    color: #d97706;
    letter-spacing: 2px;
    display: inline-block;
}

/* Actions */
.gapli-exit-popup__actions {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gapli-exit-popup__cta {
    display: block;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff !important;
    text-align: center;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.gapli-exit-popup__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff !important;
}

.gapli-exit-popup__dismiss {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.gapli-exit-popup__dismiss:hover {
    color: #6b7280;
}

/* RODO consent on checkout */
.gapli-cr-consent-row {
    margin-top: 12px !important;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.gapli-cr-consent-text {
    font-size: 13px;
    color: #4b5563;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .gapli-exit-popup__content {
        max-width: 100%;
        border-radius: 16px;
    }

    .gapli-exit-popup__header {
        padding: 24px 20px 16px;
    }

    .gapli-exit-popup__title {
        font-size: 18px;
    }

    .gapli-exit-popup__icon {
        font-size: 32px;
    }

    .gapli-exit-popup__cta {
        padding: 12px 20px;
        font-size: 15px;
    }
}
