/**
 * Cookie Banner Styles - Gestion du consentement RGPD
 * Piment Fort Belgique - Grainothèque
 */

/* ========================================
   Banner de consentement (bas de page)
   ======================================== */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #fff6ef 0%, #ffe8dc 100%);
    border-top: 3px solid var(--pf-red, #DA5E46);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 999998;
    padding: 20px;
    animation: slideUp 0.5s ease;
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-icon {
    font-size: 48px;
    line-height: 1;
    flex-shrink: 0;
}

.cookie-biscuit { display:inline-block; }
.cookie-chili { display:inline-block; margin-left:8px; transform-origin:center; animation: chiliShake 2s ease-in-out infinite; }

@keyframes chiliShake {
    0% { transform: rotate(0deg) translateY(0); }
    25% { transform: rotate(-8deg) translateY(-2px); }
    50% { transform: rotate(0deg) translateY(0); }
    75% { transform: rotate(8deg) translateY(-2px); }
    100% { transform: rotate(0deg) translateY(0); }
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-text h3 {
    margin: 0 0 8px 0;
    color: var(--pf-deep-red, #B03A2E);
    font-size: 18px;
    font-weight: 600;
}

.cookie-text p {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-actions .btn {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-actions .btn-primary {
    background: var(--pf-red, #DA5E46);
    color: white;
}

.cookie-actions .btn-primary:hover {
    background: var(--pf-deep-red, #B03A2E);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(218, 94, 70, 0.3);
}

.cookie-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.cookie-actions .btn-secondary:hover {
    background: #5a6268;
}

.cookie-actions .btn-link {
    background: transparent;
    color: var(--pf-red, #DA5E46);
    text-decoration: underline;
    padding: 10px 15px;
}

.cookie-actions .btn-link:hover {
    color: var(--pf-deep-red, #B03A2E);
}

/* ========================================
   Modal de personnalisation
   ======================================== */

.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal.active {
    display: flex;
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.cookie-modal-content {
    position: relative;
    background: white;
    border-radius: 18px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cookie-modal-header {
    padding: 25px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #fff6ef 0%, #ffe8dc 100%);
}

.cookie-modal-header h2 {
    margin: 0;
    color: var(--pf-deep-red, #B03A2E);
    font-size: 24px;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cookie-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.cookie-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.cookie-intro {
    margin: 0 0 25px 0;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid var(--pf-red, #DA5E46);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

.cookie-category {
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: var(--pf-red, #DA5E46);
    box-shadow: 0 4px 12px rgba(218, 94, 70, 0.1);
}

.cookie-category.cookie-disabled {
    opacity: 0.6;
    background: #f8f9fa;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
}

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

.cookie-category-info h3 {
    margin: 0 0 8px 0;
    color: var(--pf-deep-red, #B03A2E);
    font-size: 18px;
}

.cookie-category-desc {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.cookie-details {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.cookie-details strong {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    color: #333;
}

.cookie-details ul {
    margin: 5px 0;
    padding-left: 20px;
}

.cookie-details li {
    margin: 3px 0;
}

.cookie-details code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--pf-red, #DA5E46);
}

/* ========================================
   Switch toggle pour les cookies
   ======================================== */

.cookie-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.cookie-switch input[type="checkbox"] {
    display: none;
}

.cookie-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 26px;
    transition: background 0.3s ease;
}

.cookie-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-switch input[type="checkbox"]:checked + .cookie-slider {
    background: var(--pf-red, #DA5E46);
}

.cookie-switch input[type="checkbox"]:checked + .cookie-slider::before {
    transform: translateX(24px);
}

.cookie-switch input[type="checkbox"]:disabled + .cookie-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-status {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    min-width: 80px;
}

/* ========================================
   Footer du modal
   ======================================== */

.cookie-modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f8f9fa;
}

.cookie-modal-footer .btn {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cookie-modal-footer .btn-primary {
    background: var(--pf-red, #DA5E46);
    color: white;
}

.cookie-modal-footer .btn-primary:hover {
    background: var(--pf-deep-red, #B03A2E);
}

.cookie-modal-footer .btn-secondary {
    background: #6c757d;
    color: white;
}

.cookie-modal-footer .btn-secondary:hover {
    background: #5a6268;
}

.cookie-modal-footer .btn-link {
    background: transparent;
    color: var(--pf-red, #DA5E46);
    text-decoration: none;
    border: 1px solid var(--pf-red, #DA5E46);
}

.cookie-modal-footer .btn-link:hover {
    background: var(--pf-red, #DA5E46);
    color: white;
}

/* ========================================
   Animations
   ======================================== */

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   Responsive (mobile)
   ======================================== */

@media (max-width: 768px) {
    .cookie-banner {
        padding: 15px;
    }
    
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cookie-icon {
        font-size: 36px;
    }
    
    .cookie-text {
        min-width: 100%;
    }
    
    .cookie-text h3 {
        font-size: 16px;
    }
    
    .cookie-text p {
        font-size: 13px;
    }
    
    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .cookie-modal {
        padding: 10px;
    }
    
    .cookie-modal-content {
        max-height: 95vh;
    }
    
    .cookie-modal-header {
        padding: 20px;
    }
    
    .cookie-modal-header h2 {
        font-size: 20px;
    }
    
    .cookie-modal-body {
        padding: 20px;
    }
    
    .cookie-category-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .cookie-switch {
        align-self: flex-start;
    }
    
    .cookie-modal-footer {
        flex-wrap: wrap;
        justify-content: stretch;
    }
    
    .cookie-modal-footer .btn {
        flex: 1 1 auto;
        min-width: 120px;
    }
}
