/**
 * Cookie Consent Styles
 * Stili per banner e modal cookie conforme GDPR
 */

/* ===== BANNER COOKIE ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background-color: #ffffff;
    border-top: 3px solid #1697c7;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    max-width: 100%;
}

.cookie-banner-visible {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cookie-banner-text h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: #000;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cookie-banner-text p {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.cookie-banner-links {
    margin-top: 10px;
}

.cookie-banner-links a {
    color: #1697c7;
    text-decoration: underline;
    font-size: 0.9rem;
}

.cookie-banner-links a:hover {
    color: #0d6d8f;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== PULSANTI COOKIE ===== */
.cookie-btn {
    padding: 10px 20px;
    border: 2px solid #333;
    background-color: transparent;
    color: #333;
    font-family: 'Syne', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    min-width: 120px;
}

.cookie-btn:hover {
    background-color: #333;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cookie-btn:focus {
    outline: 3px solid #1697c7;
    outline-offset: 2px;
}

.cookie-btn-accept {
    background-color: #1697c7;
    border-color: #1697c7;
    color: #fff;
}

.cookie-btn-accept:hover {
    background-color: #0d6d8f;
    border-color: #0d6d8f;
    color: #fff;
}

.cookie-btn-reject {
    background-color: transparent;
    border-color: #333;
    color: #333;
}

.cookie-btn-reject:hover {
    background-color: #333;
    color: #fff;
}

.cookie-btn-customize {
    background-color: transparent;
    border-color: #666;
    color: #666;
}

.cookie-btn-customize:hover {
    background-color: #666;
    color: #fff;
}

.cookie-btn-primary {
    background-color: #1697c7;
    border-color: #1697c7;
    color: #fff;
}

.cookie-btn-secondary {
    background-color: transparent;
    border-color: #666;
    color: #666;
}

.cookie-btn-secondary:hover {
    background-color: #666;
    color: #fff;
}

/* ===== MODAL PREFERENZE ===== */
.cookie-preferences-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-preferences-modal.cookie-modal-visible {
    opacity: 1;
    visibility: visible;
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.cookie-modal-content {
    position: relative;
    background-color: #ffffff;
    border-radius: 8px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    z-index: 1;
}

.cookie-preferences-modal.cookie-modal-visible .cookie-modal-content {
    transform: scale(1);
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #e0e0e0;
}

.cookie-modal-header h2 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #000;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cookie-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.cookie-modal-close:hover {
    color: #000;
    background-color: #f5f5f5;
}

.cookie-modal-close:focus {
    outline: 3px solid #1697c7;
    outline-offset: 2px;
}

.cookie-modal-body {
    padding: 30px;
}

.cookie-modal-intro {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.cookie-category {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.cookie-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
}

.cookie-category-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 8px 0;
}

.cookie-category-header p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.cookie-category-services {
    margin-top: 15px;
    padding-left: 20px;
}

.cookie-services-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.cookie-category-services ul {
    list-style: disc;
    margin: 0;
    padding-left: 20px;
}

.cookie-category-services li {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.cookie-modal-links {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.cookie-modal-links a {
    color: #1697c7;
    text-decoration: underline;
    font-size: 0.9rem;
}

.cookie-modal-links a:hover {
    color: #0d6d8f;
}

.cookie-modal-footer {
    display: flex;
    gap: 12px;
    padding: 25px 30px;
    border-top: 2px solid #e0e0e0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ===== TOGGLE SWITCH ===== */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #1697c7;
}

.cookie-toggle input:focus + .cookie-toggle-slider {
    outline: 3px solid #1697c7;
    outline-offset: 2px;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-toggle-disabled .cookie-toggle-slider {
    background-color: #1697c7;
    cursor: not-allowed;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .cookie-banner-content {
        padding: 20px;
    }
    
    .cookie-banner-text h3 {
        font-size: 1.2rem;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
        min-width: auto;
    }
    
    .cookie-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .cookie-modal-header {
        padding: 20px;
    }
    
    .cookie-modal-header h2 {
        font-size: 1.5rem;
    }
    
    .cookie-modal-body {
        padding: 20px;
    }
    
    .cookie-category-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
        padding: 20px;
    }
    
    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }
}

/* ===== ACCESSIBILITÀ ===== */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-preferences-modal,
    .cookie-modal-content,
    .cookie-toggle-slider,
    .cookie-toggle-slider:before {
        transition: none;
    }
}

/* Focus visible per tastiera */
.cookie-btn:focus-visible,
.cookie-modal-close:focus-visible,
.cookie-toggle input:focus-visible + .cookie-toggle-slider {
    outline: 3px solid #1697c7;
    outline-offset: 2px;
}
