/* =========================================
   COOKIES: Consent Banner & Modal
   ========================================= */

/* Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #222;
    border-top: 1px solid var(--accent-color);
    
    /* FIX: Add spacing for mobile safe areas (iPhone home bar) */
    padding: 20px 30px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    
    z-index: 99999; /* Increased to beat everything else */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.4s ease-out;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-content p {
    font-size: 0.9rem;
    color: #ccc;
    margin-right: 20px;
}

.cookie-actions {
    display: flex;
    gap: 15px;
}

/* Cookie Buttons */
.cookie-btn {
    font-family: var(--font-main);
    font-size: 0.85rem;
    padding: 10px 20px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.cookie-btn.solid {
    background: var(--accent-color);
    color: #fff;
    border: 1px solid var(--accent-color);
}
.cookie-btn.solid:hover { background: #c55610; }

.cookie-btn.outline {
    background: transparent;
    color: #ccc;
    border: 1px solid #555;
}
.cookie-btn.outline:hover {
    border-color: #fff;
    color: #fff;
}

/* Modal Overlay */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cookie-modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.cookie-modal-box {
    background: #333;
    width: 90%;
    max-width: 500px;
    border: 1px solid #555;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { text-transform: uppercase; font-size: 1rem; color: #fff; }

.close-icon {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
}
.close-icon:hover { color: #fff; }

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}
.cookie-option:last-child { border-bottom: none; }

.option-info h4 { font-size: 0.95rem; color: #fff; margin-bottom: 5px; }
.option-info p { font-size: 0.8rem; color: #aaa; }

.modal-footer { padding: 20px; border-top: 1px solid #444; }
.full-width { width: 100%; }

/* Toggles */
.option-toggle { position: relative; width: 50px; height: 26px; }
.option-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #555; transition: .4s; border-radius: 34px;
}
.toggle-slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px; left: 4px; bottom: 4px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .toggle-slider { background-color: var(--accent-color); }
input:checked + .toggle-slider:before { transform: translateX(24px); }
.toggle-slider.disabled { background-color: #333; border: 1px solid #444; cursor: not-allowed; }
.toggle-slider.disabled:before { background-color: #666; }

/* Responsive Cookies */
@media (max-width: 768px) {
    .cookie-banner { 
        flex-direction: column; 
        gap: 15px; 
        text-align: center; 
        
        /* Ensure it doesn't take up 50% of the screen on small phones */
        max-height: 50vh; 
        overflow-y: auto;
    }
    .cookie-actions { width: 100%; justify-content: center; }
    .cookie-content p { margin-right: 0; }
}