/**
 * gdpr.css - GDPR Cookie Consent Banner & Preferences Modal
 * Holiday Lights Decor - Multi-Franchise Template
 * 
 * Always loaded via footer.php (lightweight, ~5KB)
 * Works with gdpr.js for cookie consent management.
 * 
 * @version 10.0.0 (INTERSTATE)
 */


/* ==========================================================================
   COOKIE CONSENT BANNER — Bottom bar
   ========================================================================== */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #1a1a2e;
    color: #fff;
    padding: 1.25rem 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.cookie-banner.is-visible {
    transform: translateY(0);
}

.cookie-banner-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner-text p {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin: 0;
}

.cookie-banner-text a {
    color: var(--gold, #FFD700);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner-text a:hover {
    color: #fff;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: var(--primary, #62a340);
    color: #fff;
}

.cookie-btn-accept:hover {
    background: #4d8232;
}

.cookie-btn-reject {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.cookie-btn-reject:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.cookie-btn-settings {
    background: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.6rem 0.75rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-btn-settings:hover {
    color: #fff;
}


/* ==========================================================================
   PREFERENCES MODAL — Granular cookie control
   ========================================================================== */

.cookie-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.cookie-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cookie-modal-header {
    padding: 1.5rem 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cookie-modal-header h2 {
    font-size: 1.2rem;
    color: var(--text, #1a1a2e);
    margin: 0;
}

.cookie-modal-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    font-size: 1.5rem;
    transition: color 0.2s;
}

.cookie-modal-close:hover {
    color: #333;
}

.cookie-modal-body {
    padding: 1rem 1.5rem;
}

.cookie-modal-body > p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

/* Cookie Category */
.cookie-category {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    background: #fafafa;
    cursor: default;
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-info h3 {
    font-size: 0.92rem;
    color: var(--text, #1a1a2e);
    margin: 0 0 0.15rem;
}

.cookie-category-info p {
    font-size: 0.78rem;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: var(--primary, #62a340);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(20px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background: var(--primary, #62a340);
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-category-tag {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.cookie-category-tag.required {
    background: #e5e7eb;
    color: #6b7280;
}

/* Modal Footer */
.cookie-modal-footer {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}

.cookie-modal-footer .cookie-btn-accept {
    padding: 0.65rem 1.5rem;
}

.cookie-modal-footer .cookie-btn-save {
    background: var(--text, #1a1a2e);
    color: #fff;
    padding: 0.65rem 1.5rem;
}

.cookie-modal-footer .cookie-btn-save:hover {
    opacity: 0.85;
}


/* ==========================================================================
   COOKIE SETTINGS TRIGGER — Persistent footer link
   ========================================================================== */

.cookie-settings-trigger {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-settings-trigger:hover {
    color: var(--primary, #62a340);
}


/* ==========================================================================
   FORM CONSENT CHECKBOX
   ========================================================================== */

.form-consent {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.form-consent input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary, #62a340);
}

.form-consent label {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.5;
    cursor: pointer;
}

.form-consent label a {
    color: var(--primary, #62a340);
    text-decoration: underline;
}


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

@media (max-width: 768px) {
    .cookie-banner-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .cookie-banner-actions {
        width: 100%;
        justify-content: center;
    }
    
    /* Sit above mobile bottom menu */
    .cookie-banner {
        bottom: calc(var(--mobile-menu-height, 70px) + env(safe-area-inset-bottom, 0px));
    }
    
    .cookie-modal {
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .cookie-banner-actions {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
    }
    
    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }
}