#cookieBanner {
    position: fixed;
    bottom: 4em;
    right: 20px;
    width: 300px;
    background: #fffffe;
    border: 2px solid #000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5em;
    z-index: 99999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#cookieBanner.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.cookie-container {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.cookie-title {
    font-size: 18px;
    margin-bottom: 0.5em;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.cookie-description {
    font-size: 14px;
    line-height: 1.1;
    font-weight: 400;
    color: #666;
    width: 90%;
}

.cookie-description a {
    color: #000;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    margin-top: 0.5em;
}

.cookie-btn {
    padding: 0.6em 1.5em;
    font-size: 14px;
    border: 1px solid #000;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    width: 100%;
    font-weight: 500;
}

.cookie-btn-accept {
    font-weight: 400;
    background: #000;
    color: #fff;
    border: 1px solid #000;
}

.cookie-btn-accept:hover {
    background: #333;
    transform: scale(1.02);
    border-color: #333;
}

.cookie-btn-accept:focus {
    background: #000;
    border: 1.5px solid #000 !important;
}

.cookie-btn-reject {
    border: 1.5px solid #000;
    color: #000;
}

.cookie-btn-reject:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.cookie-btn-settings {
    background: transparent;
    color: #666;
    font-size: 13px;
    text-decoration: none;
    padding: 0.5em;
    border: none;
}

.cookie-btn-settings:hover {
    color: #000;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-btn:focus,
.cookie-btn-accept:focus,
.cookie-btn-reject:focus,
.cookie-btn-settings:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #000 !important;
}

/* Close X button */
.cookie-close-x {
    background-color: #fff;
    position: absolute;
    top: 1em;
    right: 0.75em;
    border: none;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.cookie-close-x:focus,
.settings-close:focus,
.toggle-switch input:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Cookie Settings Modal */
#cookieSettings {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2em;
}

#cookieSettings.show {
    display: flex;
}

.settings-modal {
    background: #fff;
    border: 2px solid #000;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 3em;
    position: relative;
}

.settings-close {
    position: absolute;
    right: 1.5em;
    background: #fff;
    border: none;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.settings-close:hover {
    transform: rotate(90deg);
}

.settings-title {
    font-size: 28px;
    text-transform: uppercase;
    margin-bottom: 1em;
    font-weight: 400;
}

.cookie-category {
    border-bottom: 1px solid #ddd;
    padding: 1.5em 0;
}

.cookie-category:last-child {
    border-bottom: none;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em;
}

.category-title {
    font-size: 18px;
    text-transform: uppercase;
    font-weight: 400;
}

.category-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.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: #ffffff; /* Sfondo bianco */
    border: 1.5px solid #000; /* Bordo nero */
    border-radius: 25px;
    transition: 0.4s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: #000; /* Pallino nero */
    transition: 0.4s;
    border-radius: 50%;
}

/* Stato checked */
input:checked + .toggle-slider {
    background-color: #ffffff;
    border-color: #000;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: #000;
}

/* Stato disabled */
input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

input:disabled + .toggle-slider:before {
    background-color: #666;
}

.settings-actions {
    margin-top: 2em;
    display: flex;
    gap: 1em;
    justify-content: flex-end;
}

/* Small Cookie Notice (after acceptance) */
.cookie-notice-small {
    position: fixed;
    bottom: 4.5em;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 0.6em 1.2em;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    cursor: pointer;
    display: none;
    transition: all 0.2s ease;
}

.cookie-notice-small:hover {
    background: #000;
    transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #cookieBanner {
        width: calc(100% - 40px);
        bottom: 20px;
        left: 20px;
        right: 20px;
        padding: 1.25em;
    }
    
    .cookie-title {
        font-size: 16px;
    }
    
    .cookie-description {
        font-size: 13px;
    }

    .cookie-btn {
        font-size: 13px;
        padding: 0.6em 1em;
    }

    .settings-modal {
        padding: 2em 1.5em;
    }
}

@media (max-width: 480px) {
    #cookieBanner {
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
    }
}
