/* =================================================================
   CSS COOKIES SIMPLE - BOUTONS VERTICAUX SUR PETITS ÉCRANS
   Solution simple: vertical dès que l'écran devient trop petit
   ================================================================= */

/* Bandeau cookies principal */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--warm-white);
    border-top: 3px solid var(--primary-green);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    padding: 20px;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 8px;
}

.cookie-description {
    color: var(--charcoal);
    line-height: 1.5;
    margin-bottom: 10px;
}

.cookie-link {
    color: var(--secondary-green);
    text-decoration: underline;
    font-size: 0.9em;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.cookie-btn {
    padding: 12px 18px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-accept {
    background: var(--primary-green);
    color: white;
}

.btn-accept:hover {
    background: var(--secondary-green);
}

.btn-refuse {
    background: var(--light-gray);
    color: var(--charcoal);
    border: 1px solid var(--earth-brown);
}

.btn-refuse:hover {
    background: var(--primary-beige);
}

.btn-customize {
    background: transparent;
    color: var(--secondary-green);
    border: 1px solid var(--secondary-green);
}

.btn-customize:hover {
    background: var(--secondary-green);
    color: white;
}

/* Modal de personnalisation */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal.show {
    display: flex;
}

.modal-content {
    background: var(--warm-white);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 15px;
    padding: 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--charcoal);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: var(--light-gray);
}

.modal-title {
    color: var(--primary-green);
    font-size: 1.4em;
    margin-bottom: 20px;
    font-weight: 600;
    padding-right: 40px;
}

.cookie-category {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--primary-beige);
    border-radius: 10px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-title {
    font-weight: 600;
    color: var(--charcoal);
    font-size: 1.1em;
}

.category-required {
    background: var(--earth-brown);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.category-description {
    color: var(--earth-brown);
    font-size: 0.95em;
    line-height: 1.4;
    margin-bottom: 15px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--light-gray);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent-green);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch.disabled .toggle-slider {
    background-color: var(--earth-brown);
    cursor: not-allowed;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Notification de sauvegarde */
.cookie-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-green);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10002;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.cookie-notification.show {
    transform: translateX(0);
}

/* Icônes */
.cookie-icon {
    font-size: 1em;
    margin-right: 4px;
    flex-shrink: 0;
}

/* ===================================================================
   RESPONSIVE MOBILE - SIMPLE ET PROPRE
   =================================================================== */

/* Tablettes */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 15px;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .cookie-text {
        min-width: auto;
    }

    .cookie-buttons {
        justify-content: center;
        width: 100%;
        gap: 10px;
    }

    .cookie-btn {
        flex: 1;
        min-width: 100px;
        max-width: 140px;
        padding: 10px 12px;
        font-size: 0.85em;
    }

    .modal-content {
        margin: 10px;
        padding: 20px;
        max-height: 90vh;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .modal-buttons .cookie-btn {
        max-width: none;
        flex: none;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* SMARTPHONES - BOUTONS EN VERTICAL (simple et propre) */
@media (max-width: 480px) {
    .cookie-banner {
        padding: 12px;
    }
    
    .cookie-content {
        gap: 12px;
    }

    .cookie-title {
        font-size: 1em;
    }

    .cookie-description {
        font-size: 0.9em;
    }

    /* BOUTONS EN VERTICAL pour tous les smartphones */
    .cookie-buttons {
        flex-direction: column; /* VERTICAL */
        gap: 10px;
        width: 100%;
    }

    .cookie-btn {
        width: 100%; /* Pleine largeur */
        max-width: none;
        min-width: auto;
        padding: 12px 20px;
        font-size: 0.9em;
        flex: none;
        min-height: 44px; /* Zone de touch recommandée */
    }

    .cookie-icon {
        font-size: 1em;
        margin-right: 6px;
    }

    .modal-content {
        margin: 8px;
        padding: 15px;
        border-radius: 10px;
    }

    .modal-title {
        font-size: 1.2em;
        padding-right: 30px;
    }

    .modal-close {
        width: 25px;
        height: 25px;
        font-size: 20px;
        top: 10px;
        right: 15px;
    }
}

/* Très petits écrans */
@media (max-width: 320px) {
    .cookie-banner {
        padding: 10px;
    }

    .cookie-btn {
        padding: 10px 15px;
        font-size: 0.85em;
        min-height: 40px;
    }

    .cookie-title {
        font-size: 0.95em;
    }

    .cookie-description {
        font-size: 0.85em;
    }
}

/* Amélioration UX tactile */
@media (max-width: 480px) {
    .cookie-btn {
        touch-action: manipulation;
    }

    .modal-close {
        touch-action: manipulation;
        min-width: 44px;
        min-height: 44px;
    }

    .toggle-switch {
        transform: scale(1.2);
        margin: 5px;
    }
}

/* Notification responsive */
@media (max-width: 480px) {
    .cookie-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
        font-size: 0.9em;
    }

    .cookie-notification.show {
        transform: translateY(0);
    }
}

/* Mode paysage mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content {
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .cookie-banner {
        padding: 8px;
    }
    
    .cookie-btn {
        padding: 8px 15px;
        font-size: 0.85em;
        min-height: 36px;
    }
}