/* =========================================
   ТЪМЕН ЕКРАН И ЗАКЛЮЧВАНЕ НА СКРОЛА
   ========================================= */
.cookie-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px);
    z-index: 99998; opacity: 0; visibility: hidden; transition: all 0.5s ease;
}
.cookie-overlay.show { opacity: 1; visibility: visible; }

body.cookie-locked { overflow: hidden !important; } 
body.cookie-locked *:not(.cookie-banner):not(.cookie-banner *):not(.cookie-overlay):not(.cookie-settings-modal):not(.cookie-settings-modal *) { 
    animation-play-state: paused !important; 
}

/* =========================================
   КРАСИВ СКРОЛБАР ЗА БАНЕРА И МОДАЛА
   ========================================= */
.cookie-banner::-webkit-scrollbar,
.cookie-settings-modal::-webkit-scrollbar { width: 6px; }
.cookie-banner::-webkit-scrollbar-track,
.cookie-settings-modal::-webkit-scrollbar-track { background: #f5f5f5; border-radius: 10px; }
.cookie-banner::-webkit-scrollbar-thumb,
.cookie-settings-modal::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.cookie-banner::-webkit-scrollbar-thumb:hover,
.cookie-settings-modal::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* =========================================
   ОСНОВЕН БАНЕР (Плаващ, широк, ВИНАГИ ДОЛУ)
   ========================================= */
.cookie-banner {
    position: fixed; bottom: -400px; left: 50%; transform: translateX(-50%);
    width: 95%; max-width: 1300px; 
    max-height: 85vh; overflow-y: auto; /* Позволява скролиране, ако текстът е много дълъг */
    background: #fff; box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    border-radius: 20px; padding: 25px 35px;
    display: flex; align-items: center; justify-content: space-between; gap: 40px;
    z-index: 99999; transition: bottom 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #f0f0f0;
}
.cookie-banner.show { bottom: 30px; }

.cookie-content { display: flex; align-items: flex-start; gap: 20px; flex: 1; }
.cookie-icon { font-size: 3rem; color: var(--color-secondary); margin-top: 5px; }
.cookie-text h4 { font-family: var(--font-heading); color: var(--color-primary); margin: 0 0 10px 0; font-size: 1.4rem; }
.cookie-text p { margin: 0; font-size: 0.95rem; color: #555; line-height: 1.6; }
.cookie-text a.orange-link { color: #D2691E; font-weight: 600; text-decoration: none; transition: 0.2s; }
.cookie-text a.orange-link:hover { text-decoration: underline; color: #943b00; }

.cookie-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 280px; flex-shrink: 0; }
.btn-cookie-settings { background: #f5f5f5; color: #555; border: none; padding: 14px 20px; border-radius: 12px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.2s; width: 100%; }
.btn-cookie-settings:hover { background: #e0e0e0; color: #333; }
.btn-accept-cookies { background: var(--color-primary); color: #fff; border: none; padding: 14px 20px; border-radius: 12px; font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: 0.3s; box-shadow: 0 5px 15px rgba(0, 139, 139, 0.2); width: 100%; }
.btn-accept-cookies:hover { background: #007777; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 139, 139, 0.3); }

/* =========================================
   ПРОФЕСИОНАЛЕН МОДАЛ ЗА НАСТРОЙКИ
   ========================================= */
.cookie-settings-modal {
    position: fixed; top: 47%; left: 50%; transform: translate(-50%, -40%) scale(0.95);
    width: 90%; max-width: 500px; 
    max-height: 85vh; overflow-y: auto; /* Скролиране вътре в модала */
    background: #fff; padding: 35px 30px; border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    z-index: 100000; opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.cookie-settings-modal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.cookie-settings-modal h3 { font-family: var(--font-heading); color: var(--color-secondary); margin-bottom: 10px; text-align: center; font-size: 1.6rem; }
.cookie-settings-modal > p { color: #555; font-size: 0.9rem; margin-bottom: 25px; line-height: 1.6; text-align: center; }

.cookie-preference-item { display: flex; justify-content: space-between; align-items: center; background: #fbfbfb; padding: 15px 20px; border-radius: 14px; margin-bottom: 20px; border: 1px solid #eee; gap: 15px; }
.cookie-preference-info h5 { margin: 0 0 5px 0; color: var(--color-primary); font-size: 1.1rem; }
.cookie-preference-info p { margin: 0; font-size: 0.85rem; color: #666; line-height: 1.4; }
.cookie-toggle { background: rgba(0, 139, 139, 0.1); color: var(--color-primary); padding: 6px 12px; border-radius: 20px; font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; gap: 6px; white-space: nowrap; }

.cookie-settings-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px;}
.cookie-settings-actions button { flex: 1; padding: 12px; border-radius: 12px; font-weight: 600; cursor: pointer; transition: 0.2s; border: none; }
.btn-close-settings { background: #f0f0f0; color: #333; }
.btn-close-settings:hover { background: #e0e0e0; }
.btn-delete-cookies { background: #e74c3c; color: #fff; box-shadow: 0 4px 10px rgba(231, 76, 60, 0.2); }
.btn-delete-cookies:hover { background: #c0392b; transform: translateY(-2px); }

/* Оранжеви линкове */
.cookie-text a.orange-link, .cookie-settings-modal a.orange-link { color: #D2691E; font-weight: 600; text-decoration: none; transition: 0.2s; }
.cookie-text a.orange-link:hover, .cookie-settings-modal a.orange-link:hover { text-decoration: underline; color: #943b00; }

/* =========================================
   АДАПТИВНОСТ (ТЕЛЕФОН И ТАБЛЕТ)
   ========================================= */
@media (max-width: 820px) {
    /* Банерът става по-нисък, за да се вижда сайтът, и се скролва вътрешно */
    .cookie-banner { 
        flex-direction: column; 
        padding: 20px 15px; 
        gap: 15px; 
        max-height: 35vh; 
        border-radius: 16px;
    }
    .cookie-banner.show { bottom: 15px; width: 92%; }
    .cookie-content { flex-direction: column; text-align: center; align-items: center; gap: 10px; }
    
    /* Намалени шрифтове за банера */
    .cookie-icon { font-size: 2.2rem; }
    .cookie-text h4 { font-size: 1.15rem; margin-bottom: 5px; }
    .cookie-text p { font-size: 0.85rem; line-height: 1.4; }
    
    .cookie-actions { max-width: 100%; gap: 8px; }
    .btn-cookie-settings, .btn-accept-cookies { padding: 12px 15px; font-size: 0.9rem; }

    /* Настройките стават по-компактни */
    .cookie-settings-modal { 
        width: 95%; 
        padding: 25px 15px; 
        max-height: 80vh; 
        border-radius: 16px; 
    }
    .cookie-settings-modal h3 { font-size: 1.3rem; margin-bottom: 8px; }
    .cookie-settings-modal > p { font-size: 0.85rem; margin-bottom: 15px; line-height: 1.4; }
    
    .cookie-preference-item { flex-direction: column; text-align: center; padding: 12px; gap: 10px; margin-bottom: 15px; }
    .cookie-preference-info h5 { font-size: 1rem; }
    .cookie-preference-info p { font-size: 0.8rem; }
    
    .cookie-settings-actions { flex-direction: column; gap: 8px; }
    .cookie-settings-actions button { width: 100%; padding: 12px; font-size: 0.9rem; }
}