/**
 * Moonio Conversion Boost — Styles
 * v1.0.0
 */

/* =============================================
 * 1. EXIT INTENT POPUP
 * ============================================= */
.moonio-exit-popup {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.moonio-exit-popup.visible {
    display: flex;
}

.moonio-exit-popup-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.moonio-exit-popup-content {
    position: relative;
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    animation: moonio-popup-in 0.3s ease;
}

@keyframes moonio-popup-in {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.moonio-exit-popup-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px !important;
    box-shadow: none !important;
    line-height: 1;
}

.moonio-exit-popup-close:hover {
    color: #1a1a2e;
}

.moonio-exit-popup-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.moonio-exit-popup-content h3 {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.moonio-exit-popup-content p {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
}

.moonio-exit-popup-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.moonio-exit-popup-code span {
    background: #f0fdf4;
    border: 2px dashed #2d6b42;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #2d6b42;
}

.moonio-copy-btn {
    background: #e5e7eb !important;
    color: #374151 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
    box-shadow: none !important;
}

.moonio-copy-btn:hover {
    background: #d1d5db !important;
}

.moonio-exit-popup-cta {
    display: inline-block;
    margin-bottom: 12px;
    width: 100%;
    text-align: center;
}

.moonio-exit-popup-small {
    font-size: 12px !important;
    color: #94a3b8 !important;
    margin-bottom: 0 !important;
}

/* =============================================
 * 2. CROSS-SELL GRID
 * ============================================= */
.moonio-cross-sell,
.moonio-cart-cross-sell,
.moonio-recently-viewed {
    margin: 40px 0;
    padding: 0 16px;
}

.moonio-cross-sell h3,
.moonio-cart-cross-sell h3,
.moonio-recently-viewed h3 {
    text-align: center;
    margin-bottom: 24px;
}

.moonio-cross-sell-grid,
.moonio-rv-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.moonio-cross-sell-item,
.moonio-rv-item {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.moonio-cross-sell-item:hover,
.moonio-rv-item:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.moonio-cross-sell-item a,
.moonio-rv-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.moonio-cross-sell-item img,
.moonio-rv-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.moonio-cs-name,
.moonio-rv-name {
    display: block;
    padding: 10px 12px 4px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
    min-height: 36px;
}

.moonio-cs-price,
.moonio-rv-price {
    display: block;
    padding: 0 12px 12px;
    font-size: 14px;
    font-weight: 700;
    color: #2d6b42;
}

@media (max-width: 849px) {
    .moonio-cross-sell-grid,
    .moonio-rv-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* =============================================
 * 3. STICKY HEADER
 * ============================================= */
.header-main.moonio-header-sticky {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
    transition: transform 0.3s ease;
}

.header-main.moonio-header-hidden {
    transform: translateY(-100%);
}

/* Dodaj padding do body gdy header jest sticky */
body.has-sticky-header {
    padding-top: var(--header-height, 70px);
}

/* =============================================
 * 4. STRONA 404
 * ============================================= */
.moonio-404-content {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.moonio-404-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.moonio-404-content h2 {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.moonio-404-content p {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 28px;
}

.moonio-404-search {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.moonio-404-input {
    flex: 1;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
}

.moonio-404-input:focus {
    border-color: #2d6b42 !important;
    outline: none;
}

.moonio-404-btn {
    flex-shrink: 0;
}

.moonio-404-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.moonio-404-links .button {
    background: transparent !important;
    color: #2d6b42 !important;
    border: 1px solid #2d6b42 !important;
    font-size: 13px !important;
}

.moonio-404-links .button:hover {
    background: #2d6b42 !important;
    color: #fff !important;
}

/* =============================================
 * 5. WISHLIST BUTTON
 * ============================================= */
.moonio-wishlist-btn {
    background: transparent !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    color: #64748b !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    box-shadow: none !important;
}

.moonio-wishlist-btn:hover {
    border-color: #f43f5e !important;
    color: #f43f5e !important;
    background: #fff1f2 !important;
}

.moonio-wishlist-btn.wishlisted {
    border-color: #f43f5e !important;
    color: #f43f5e !important;
    background: #fff1f2 !important;
}

.moonio-wishlist-icon {
    font-size: 18px;
    line-height: 1;
}
