@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* --- GLOBAL VARIABLES --- */
:root {
    --spu-gold: #cda45e;
    --spu-gold-hover: #d9b675;
    --spu-dark: #0c0c0c;     
    --spu-white: #ffffff;
    --spu-input-bg: #f3f4f6; 
    --spu-text: #1f2937;
    --spu-text-muted: #9ca3af;
    --spu-border: #e5e7eb;
    --spu-radius: 16px;
}

/* --- BODY LOCK --- */
html.spu-no-scroll, body.spu-no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
}

/* =========================================
   DESKTOP STYLES
   ========================================= */

#spu-overlay {
    all: initial;
    font-family: 'Inter', sans-serif;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999999;
    display: none;
    align-items: center; justify-content: center;
    box-sizing: border-box;
    padding: 20px;
    overflow: hidden;
}
#spu-overlay * { box-sizing: border-box; }

.spu-modal-wrapper {
    background: var(--spu-white);
    width: 100%; max-width: 1000px;
    height: auto;
    min-height: 500px;
    max-height: 95vh;
    border-radius: var(--spu-radius);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    display: flex;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(205, 164, 94, 0.3); 
    animation: spuFadeIn 0.4s ease-out;
}

@keyframes spuFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Left Side --- */
.spu-visual-side {
    width: 40%;
    background: var(--spu-dark);
    display: flex; flex-direction: column; justify-content: center;
    padding: 50px;
    color: #fff;
    position: relative;
    border-right: 3px solid var(--spu-gold);
    overflow: hidden;
}

#spu-dynamic-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; 
    z-index: 1;
    opacity: 0.6; 
}

/* ტექსტების გაქრობა ფოტოზე (შეკვეთა, კატალოგი და ა.შ.) */
.spu-visual-content { display: none !important; }

.spu-brand-badge {
    text-transform: uppercase; font-size: 11px; letter-spacing: 3px;
    color: var(--spu-gold); margin-bottom: 20px; font-weight: 700;
}
#spu-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 36px; font-weight: 700; line-height: 1.1; margin: 0 0 20px 0; color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); 
}
.spu-desc-text { 
    font-size: 15px; color: #e4e4e7; line-height: 1.6; 
    text-shadow: 0 1px 5px rgba(0,0,0,0.5); 
}
.spu-price-tag {
    font-size: 32px; font-weight: 600; color: var(--spu-gold);
    margin-top: 30px; display: inline-block;
    border: 1px solid rgba(255,255,255,0.1); padding: 10px 30px; border-radius: 50px;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(5px);
}
.spu-visual-bg, .spu-visual-content::before { display: none; }


/* --- Right Side --- */
.spu-form-side {
    width: 60%;
    background: var(--spu-white);
    position: relative;
    display: flex; flex-direction: column;
}

.spu-close-btn {
    position: absolute; top: 25px; right: 25px; z-index: 20;
    background: transparent; border: none; font-size: 28px; color: #999;
    cursor: pointer; line-height: 1; padding:0; transition: 0.2s;
}
.spu-close-btn:hover { color: var(--spu-dark); transform: rotate(90deg); }

.spu-scroll-area {
    padding: 35px 45px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

/* Form Styling */
.spu-head-text h3 { font-size: 24px; margin: 0 0 5px 0; font-weight: 700; color: var(--spu-dark); font-family: 'Montserrat', sans-serif; }
.spu-head-text p { font-size: 13px; color: var(--spu-text-muted); margin: 0 0 20px 0; }

.spu-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.spu-group { display: flex; flex-direction: column; }
.spu-full { grid-column: span 2; }

.spu-label {
    display: block; font-size: 11px; color: var(--spu-text);
    margin-bottom: 5px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
}

.spu-input, input.spu-input {
    width: 100%;
    background: var(--spu-input-bg) !important;
    border: 1px solid transparent !important;
    color: #111 !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    transition: all 0.3s;
    outline: none !important;
    box-shadow: none !important;
    height: 44px !important;
    margin: 0 !important;
}
.spu-input:focus {
    background: #fff !important;
    border-color: var(--spu-gold) !important;
    box-shadow: 0 5px 15px rgba(205, 164, 94, 0.15) !important;
}
.spu-input::placeholder { color: #9ca3af !important; opacity: 1; }

.spu-submit-btn {
    width: 100%;
    background: var(--spu-dark) !important;
    color: #fff !important;
    border: none !important;
    padding: 14px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.spu-submit-btn:hover { background: #333 !important; transform: translateY(-2px); }

/* Layers */
.spu-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--spu-white);
    padding: 60px;
    box-sizing: border-box;
    z-index: 10;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex; flex-direction: column;
}
.spu-layer.active { transform: translateX(0); }

.spu-layer-head { margin-bottom: 30px; border-bottom: 1px solid #eee; padding-bottom: 20px; }
.spu-back-link { color: #666; cursor: pointer; font-size: 14px; margin-bottom: 10px; display: block; font-weight: 600; }
.spu-layer-head h3 { margin: 0; color: #000; font-size: 24px; font-family: 'Montserrat', sans-serif; }

.spu-pay-card {
    background: #fff; border: 2px solid #f3f4f6;
    padding: 20px; border-radius: 12px; color: #333;
    cursor: pointer; display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 15px; transition: 0.2s;
}
.spu-pay-card:hover, .spu-pay-card.selected { border-color: var(--spu-gold); background: #fffbf2; }

/* Status & Loader */
.spu-center-content { align-items: center; justify-content: center; text-align: center; }
.spu-status-icon { font-size: 50px; margin-bottom: 20px; }
.success { color: #10b981; } .error { color: #ef4444; }
.spu-loader {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: rgba(255,255,255,0.95); z-index: 50;
    display: none; align-items: center; justify-content: center;
}
.spu-spinner {
    width: 50px; height: 50px; border: 3px solid #eee;
    border-top-color: var(--spu-gold); border-radius: 50%;
    animation: spuRot 1s infinite linear;
}
@keyframes spuRot { to { transform: rotate(360deg); } }


/* --- Language Switcher --- */
.spu-lang-switcher {
    position: absolute;
    top: 22px;
    right: 70px; 
    display: flex;
    gap: 5px;
    z-index: 20;
    background: #f9fafb;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.spu-lang-btn {
    background: transparent;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #6b7280;
    transition: 0.2s;
}
.spu-lang-btn:hover { color: var(--spu-dark); }
.spu-lang-btn.active {
    background: var(--spu-gold);
    color: #fff;
    box-shadow: 0 2px 4px rgba(205, 164, 94, 0.3);
}


/* =========================================
   MOBILE RESPONSIVE 
   ========================================= */

@media (max-width: 900px) {
    #spu-overlay { 
        padding: 0 !important; 
        display: block; 
        background: #000; 
    } 
    
    .spu-modal-wrapper {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        border-radius: 0 !important;
        border: none !important;
        flex-direction: column !important;
        position: static !important;
        box-shadow: none !important;
        background: #000; 
    }
    
    .spu-visual-side {
        height: 30vh; 
        width: 100%;
        padding: 30px;
        flex: none;
        justify-content: center;
        align-items: flex-start; 
        background: #000;
        border-right: none;
    }

    #spu-dynamic-bg { display: none !important; }
    
    #spu-title { font-size: 32px; margin: 0; color: #fff; }
    .spu-brand-badge { color: #666; margin-bottom: 10px; font-size: 12px; }
    .spu-price-tag { 
        margin-top: 10px; border: none; padding: 0; 
        font-size: 28px; color: var(--spu-gold); 
        background: transparent; backdrop-filter: none;
    }
    .spu-desc-text { display: none; } 

    .spu-form-side { 
        width: 100%; 
        flex: 1; 
        display: flex;
        flex-direction: column;
        background: #ffffff; 
        
        border-top-left-radius: 60px; 
        border-top-right-radius: 0;
        
        margin-top: -40px; 
        z-index: 10;
        position: relative;
        overflow: hidden; 
    }
    
    .spu-close-btn {
        top: 20px; right: 20px; 
        color: #fff; background: rgba(255,255,255,0.1);
        width: 35px; height: 35px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
    }

    .spu-lang-switcher {
        top: 20px;
        right: 65px;
        background: rgba(255,255,255,0.1);
        border: none;
    }
    .spu-lang-btn { color: #ccc; }
    .spu-lang-btn.active { background: #fff; color: #000; }

    .spu-scroll-area { 
        padding: 50px 30px 40px 30px; 
        overflow-y: auto; 
    }
    
    .spu-head-text h3 { font-size: 24px; color: #000; font-weight: 700; margin-bottom: 5px; }
    .spu-head-text p { font-size: 13px; color: #888; margin-bottom: 25px; }

    .spu-fields-grid { grid-template-columns: 1fr; gap: 20px; } 
    
    .spu-input {
        background: #f3f4f6 !important; 
        color: #000 !important;
        border: none !important;
        border-radius: 12px !important;
    }
    .spu-input:focus {
        background: #fff !important;
        box-shadow: 0 0 0 2px #000 !important;
    }

    .spu-submit-btn {
        background: #000 !important; 
        color: #fff !important;
        margin-top: 30px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }
    
    .spu-layer {
        padding: 50px 30px;
        border-top-left-radius: 60px;
        background: #fff;
    }
}