/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh; /* Fallback */
    height: calc(var(--vh, 1vh) * 100); /* Use custom viewport height variable */
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.popup-container {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 900px; /* Augmenté de 600px à 900px */
    padding: 30px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.popup-title {
    color: var(--color-grenade);
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.popup-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* Disposition en grille pour les écrans larges */
@media (min-width: 769px) {
    .popup-sections-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    /* La première section (cookies) reste sur toute la largeur */
    .popup-sections-container .popup-section:first-child {
        grid-column: 1 / -1;
    }
}

.popup-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popup-section-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--color-blue-dark);
    font-weight: 500;
}

.popup-text {
    margin-bottom: 15px;
    line-height: 1.5;
}

.popup-options {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.popup-button {
    padding: 10px 18px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.popup-button-primary {
    background-color: #f0f0f0;
    color: #333;
    border-color: #ddd;
}

.popup-button-secondary {
    background-color: #f0f0f0;
    color: #333;
    border-color: #ddd;
}

/* Style for selected buttons */
.popup-button-primary.selected {
    background-color: var(--color-grenade);
    color: white;
    border-color: var(--color-grenade);
}

.popup-button-secondary.selected {
    background-color: var(--color-grenade);
    color: white;
    border-color: var(--color-grenade);
}

.popup-button-primary:hover {
    background-color: #e0e0e0;
}

.popup-button-secondary:hover {
    background-color: #e0e0e0;
}

.popup-button-primary.selected:hover {
    background-color: #8a1538;
}

.popup-button-secondary.selected:hover {
    background-color: #8a1538;
}

.popup-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.popup-error {
    color: #d32f2f;
    margin-top: 15px;
    font-weight: 500;
    text-align: center;
    display: none;
}

/* Restricted access screen */
.restricted-access {
    text-align: center;
    padding: 20px;
}

.restricted-access-title {
    color: var(--color-grenade);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.restricted-access-text {
    margin-bottom: 20px;
    line-height: 1.6;
}

.restricted-access-icon {
    font-size: 3rem;
    color: var(--color-grenade);
    margin-bottom: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .popup-overlay {
        align-items: flex-start;
        overflow-y: auto;
        padding: 20px 0;
    }
    
    .popup-container {
        width: 92%;
        padding: 20px 15px;
        margin: 20px auto;
        max-height: calc(100vh - 40px);
        max-height: calc((var(--vh, 1vh) * 100) - 40px); /* Use custom viewport height variable */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        border-radius: 6px; /* Smaller radius on mobile */
    }
    
    .popup-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .popup-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .popup-section-title {
        font-size: 1.1rem;
    }
    
.popup-text {
    margin-bottom: 12px;
    line-height: 1.4;
}
    
    .popup-options {
        flex-direction: column;
        gap: 10px;
        margin-top: 12px;
    }
    
    .popup-actions {
        flex-direction: column;
        margin-top: 20px;
    }
    
    .popup-button {
        width: 100%;
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .popup-error {
        font-size: 0.9rem;
        margin-top: 12px;
    }
    
    .restricted-access-title {
        font-size: 1.5rem;
    }
    
    .restricted-access-text {
        font-size: 0.95rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .popup-overlay {
        padding: 10px 0;
    }
    
    .popup-container {
        width: 95%;
        padding: 15px 12px;
        margin: 10px auto;
    }
    
    .popup-title {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .popup-section {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .popup-section-title {
        font-size: 1rem;
    }
    
    .popup-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .popup-button {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
}
