/* Cookie Consent Banner - GDPR Compliant */

/* Overlay per modale preferenze */
.cookie-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.cookie-overlay.active {
    display: block;
}

/* Banner principale */
.cookie-consent-banner {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 1200px;
    width: calc(100% - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    padding: 30px;
    animation: slideUp 0.5s ease;
}

.cookie-consent-banner.active {
    display: block;
}

/* Header del banner */
.cookie-banner-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.cookie-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #D4AF37 0%, #c19b2e 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.cookie-banner-title {
    flex: 1;
}

.cookie-banner-title h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #1a1a1a;
    font-family: 'Gloock', serif;
}

.cookie-banner-title p {
    margin: 5px 0 0;
    font-size: 0.9rem;
    color: #666;
}

/* Contenuto */
.cookie-banner-content {
    margin-bottom: 25px;
}

.cookie-banner-text {
    color: #333;
    line-height: 1.6;
    margin-bottom: 15px;
}

.cookie-banner-text strong {
    color: #D4AF37;
}

.cookie-banner-link {
    color: #D4AF37;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.cookie-banner-link:hover {
    color: #c19b2e;
    text-decoration: underline;
}

/* Pulsanti azioni */
.cookie-banner-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.cookie-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #D4AF37 0%, #c19b2e 100%);
    color: white;
}

.cookie-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.cookie-btn-secondary {
    background: white;
    color: #333;
    border: 2px solid #D4AF37;
}

.cookie-btn-secondary:hover {
    background: #f8f8f8;
}

.cookie-btn-text {
    background: transparent;
    color: #666;
    padding: 12px 20px;
}

.cookie-btn-text:hover {
    color: #D4AF37;
    background: transparent;
}

/* Modale Preferenze */
.cookie-preferences-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 700px;
    width: calc(100% - 40px);
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    overflow: hidden;
    animation: scaleIn 0.3s ease;
}

.cookie-preferences-modal.active {
    display: block;
}

/* Header modale */
.cookie-modal-header {
    background: linear-gradient(135deg, #D4AF37 0%, #c19b2e 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-family: 'Gloock', serif;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.cookie-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Corpo modale */
.cookie-modal-body {
    padding: 30px;
    max-height: calc(80vh - 180px);
    overflow-y: auto;
}

.cookie-category {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    transition: border-color 0.3s ease;
}

.cookie-category:hover {
    border-color: #D4AF37;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cookie-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-category-title h4 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.1rem;
}

.cookie-category-badge {
    background: #e0e0e0;
    color: #666;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cookie-category-badge.required {
    background: #D4AF37;
    color: white;
}

.cookie-category-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.cookie-category-details {
    font-size: 0.85rem;
    color: #999;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.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: linear-gradient(135deg, #D4AF37 0%, #c19b2e 100%);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Footer modale */
.cookie-modal-footer {
    padding: 20px 30px;
    background: #f8f8f8;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-consent-banner {
        bottom: 10px;
        width: calc(100% - 20px);
        padding: 20px;
    }

    .cookie-banner-header {
        flex-direction: column;
        text-align: center;
    }

    .cookie-banner-title h3 {
        font-size: 1.2rem;
    }

    .cookie-banner-actions {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
    }

    .cookie-preferences-modal {
        width: calc(100% - 20px);
        max-height: 90vh;
    }

    .cookie-modal-body {
        padding: 20px;
        max-height: calc(90vh - 180px);
    }

    .cookie-modal-footer {
        flex-direction: column;
    }

    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .cookie-banner-title h3 {
        font-size: 1.1rem;
    }

    .cookie-category {
        padding: 15px;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

