/* VESSANO Cookie Banner Styles */
/* Brand colors: --sand: #F0DBC7, --accent: #8E2F22, --bg-light: #FBF6F2, --ink-light: #301D09 */

.vessano-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-light);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vessano-cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5rem;
}

.cookie-banner-text {
    flex: 1;
    max-width: 60%;
}

.cookie-banner-title {
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.cookie-banner-description {
    line-height: 1.5;
    margin: 0;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Bottoni del banner ora usano le classi generiche del tema (btn-primary/btn-secondary) definite in main.css */

/* Cookie Settings Modal */
.vessano-cookie-settings {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10005;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.vessano-cookie-settings.show {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.cookie-settings-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-light);
    border-radius: var(--container-border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vessano-cookie-settings.show .cookie-settings-modal {
    transform: translate(-50%, -50%) scale(1);
}

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem 2rem;
}

.cookie-settings-title {
    font-weight: 600;
    color: var(--ink-light);
    margin: 0;
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--ink-light);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cookie-settings-close:hover {
  background: rgba(142, 47, 34, 0.1);
  transform: rotate(90deg);
  color: var(--accent);
}

.cookie-settings-content {
    padding: 2rem;
    max-height: 50vh;
    overflow-y: auto;
}

.cookie-settings-description {
    line-height: 1.6;
    margin: 0 0 2rem 0;
}

.cookie-category {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--container-border);
    transition: all 0.3s ease;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cookie-category h3 {
    font-weight: 500;
    margin: 0;
}

.cookie-category-description {
    line-height: 1.5;
    margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    cursor: pointer;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    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%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .toggle-slider {
    background: #8E2F22;
}

.cookie-toggle input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.cookie-toggle input:disabled + .toggle-slider {
    background: #8E2F22;
    opacity: 0.7;
    cursor: not-allowed;
}

.cookie-toggle input:disabled + .toggle-slider:before {
    transform: translateX(26px);
}

.cookie-settings-actions {
    padding: 1.5rem 2rem 2rem 2rem;
    border-top: 1px solid rgba(142, 47, 34, 0.1);
    background: #FBF6F2;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Azioni modal: i bottoni usano le classi generiche del tema */

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .cookie-banner-text {
        max-width: 100%;
        order: 1;
    }

    .cookie-banner-title {
        margin-bottom: 0.75rem;
    }

    .cookie-banner-actions {
        order: 2;
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    /* I bottoni ereditano il layout responsive dalle classi generiche */

    .cookie-settings-modal {
        width: 95%;
        max-height: 85vh;
        margin: 0 auto;
    }

    .cookie-settings-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }

    .cookie-settings-content {
        padding: 1.25rem;
    }

    .cookie-category {
        padding: 1.25rem;
    }

    .cookie-settings-actions {
        padding: 1.25rem 1.5rem 1.5rem 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .vessano-cookie-banner {
        border-top-width: 2px;
        left: 0;
        right: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .cookie-banner-content {
        padding: 2rem;
        gap: 3rem;
        width: 100%;
        box-sizing: border-box;
    }

    .cookie-banner-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .cookie-btn {
        width: 100%;
        padding: 0.75rem;
        box-sizing: border-box;
    }

    .cookie-settings-modal {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        max-height: 90vh;
        border-radius: var(--container-border-radius);
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        box-sizing: border-box;
    }

    .vessano-cookie-settings.show .cookie-settings-modal {
        transform: translate(-50%, -50%) scale(1);
    }

    .cookie-settings-header {
        padding: 1rem 1rem 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        box-sizing: border-box;
    }

    .cookie-settings-close {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        width: 32px;
        height: 32px;
    }

    .cookie-settings-title {
        margin-right: 2.5rem;
        padding-right: 0.5rem;
    }

    .cookie-settings-content {
        padding: 0.75rem 1rem;
        max-height: 60vh;
        box-sizing: border-box;
    }

    .cookie-category {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        box-sizing: border-box;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .cookie-toggle {
        align-self: flex-end;
    }

    .cookie-settings-actions {
        padding: 0.75rem 1rem 1rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
        box-sizing: border-box;
    }

    /* I bottoni della modal mantengono comportamento da tema */
}

/* Smooth scrollbar for settings content */
.cookie-settings-content::-webkit-scrollbar {
    width: 6px;
}

.cookie-settings-content::-webkit-scrollbar-track {
    background: rgba(240, 219, 199, 0.3);
    border-radius: 3px;
}

.cookie-settings-content::-webkit-scrollbar-thumb {
    background: rgba(142, 47, 34, 0.5);
    border-radius: 3px;
}

.cookie-settings-content::-webkit-scrollbar-thumb:hover {
    background: rgba(142, 47, 34, 0.7);
}

/* Animation for banner entrance */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Focus styles for accessibility */
.cookie-settings-close:focus,
.cookie-toggle:focus-within {
    outline: 2px solid #8E2F22;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .vessano-cookie-banner {
        border-top-width: 4px;
    }
    
    /* Rimosso: i bottoni ereditano stili dal tema */
    
    .cookie-category {
        border-width: 2px;
    }
}