/*
 * Cookie Consent — sviluppato da Francesco Saviano (FS.Digital) — https://francescosaviano.digital
 * Banner cookie sobrio e professionale, responsive.
 */

.cc-hidden {
    display: none !important;
}

.cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    box-sizing: border-box;
    background: #1f1f1f;
    color: #f0f0f0;
    box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.35);
    font-size: 14px;
    line-height: 1.5;
    padding: 18px 20px;
}

.cc-banner.cc-pos-bottom {
    bottom: 0;
}

.cc-banner.cc-pos-top {
    top: 0;
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.cc-banner *,
.cc-banner *::before,
.cc-banner *::after {
    box-sizing: border-box;
}

.cc-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.cc-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cc-content {
    flex: 1 1 460px;
    min-width: 260px;
}

.cc-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.cc-text {
    margin: 0;
    color: #d8d8d8;
}

.cc-link {
    color: #ffffff;
    text-decoration: underline;
    white-space: nowrap;
}

.cc-link:hover,
.cc-link:focus {
    color: #cccccc;
}

.cc-links {
    margin: 8px 0 0;
    font-size: 13px;
    color: #b8b8b8;
}

.cc-links .cc-link {
    white-space: nowrap;
}

.cc-sep {
    margin: 0 8px;
    color: #6a6a6a;
}

.cc-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.cc-btn {
    display: inline-block;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    text-align: center;
}

.cc-btn:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.cc-btn-primary {
    background: #f0f0f0;
    color: #1f1f1f;
    border-color: #f0f0f0;
}

.cc-btn-primary:hover,
.cc-btn-primary:focus {
    background: #ffffff;
    border-color: #ffffff;
}

.cc-btn-secondary {
    background: transparent;
    color: #f0f0f0;
    border-color: #6a6a6a;
}

.cc-btn-secondary:hover,
.cc-btn-secondary:focus {
    border-color: #f0f0f0;
    color: #ffffff;
}

/* Pannello preferenze */
.cc-prefs {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #3a3a3a;
}

.cc-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.cc-cat {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 12px 14px;
}

.cc-cat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    cursor: pointer;
    font-weight: 600;
    color: #ffffff;
}

.cc-cat-head input[disabled] {
    cursor: not-allowed;
}

.cc-toggle {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
}

.cc-cat-name {
    font-size: 14px;
}

.cc-cat-desc {
    margin: 0;
    font-size: 13px;
    color: #b8b8b8;
}

.cc-prefs-actions {
    margin-top: 16px;
    text-align: right;
}

/* Link "Настройки cookie" nel footer: revoca/modifica del consenso in ogni momento */
.cc-reopen-wrap {
    text-align: center;
    padding: 8px 12px;
}

.cc-reopen-link {
    display: inline-block;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.85;
}

.cc-reopen-link:hover,
.cc-reopen-link:focus {
    opacity: 1;
}

/* Responsive: stack verticale su mobile */
@media (max-width: 767px) {
    .cc-banner {
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
        max-height: 88vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cc-main {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cc-content {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Pulsanti: "Настройки" a tutta riga in alto, "Отклонить" e "Принять" 50/50 sotto */
    .cc-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .cc-actions .cc-btn {
        width: 100%;
        padding: 12px 14px;
    }

    .cc-actions .cc-btn[data-cc-action="prefs"] {
        grid-column: 1 / -1;
    }

    .cc-cat-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cc-prefs-actions {
        text-align: center;
    }

    .cc-prefs-actions .cc-btn {
        width: 100%;
    }
}

/* Schermi molto stretti (<360px): pulsanti tutti a tutta larghezza */
@media (max-width: 359px) {
    .cc-actions {
        grid-template-columns: 1fr;
    }
}
