/* ============================================
   publivoceCookie - Cookie Consent Banner
   ============================================ */

#publivoce-cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#publivoce-cookie-overlay.visible {
    opacity: 1;
    visibility: visible;
}

#publivoce-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    padding: 24px 30px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #333;
    max-height: 85vh;
    overflow-y: auto;
    border-top: 4px solid #667eea;
    box-sizing: border-box;
}
#publivoce-cookie-banner.visible {
    transform: translateY(0);
}

@media (min-width: 992px) {
    #publivoce-cookie-banner.banner-box {
        left: 20px;
        right: auto;
        bottom: 20px;
        max-width: 480px;
        border-radius: 15px;
        border-top: none;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
}

.pcc-content {
    max-width: 1200px;
    margin: 0 auto;
}

.pcc-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.pcc-title::before {
    content: "🍪";
    font-size: 1.2em;
}

.pcc-text {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #4a4a4a;
}

.pcc-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.pcc-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    text-align: center;
    line-height: 1.2;
}

.pcc-btn-accept {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}
.pcc-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.pcc-btn-reject {
    background: white;
    color: #495057;
    border-color: #dee2e6;
}
.pcc-btn-reject:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.pcc-btn-preferences {
    background: white;
    color: #667eea;
    border-color: #667eea;
}
.pcc-btn-preferences:hover {
    background: #667eea;
    color: white;
}

.pcc-links {
    text-align: center;
    font-size: 0.85em;
    color: #6c757d;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}
.pcc-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    margin: 0 10px;
}
.pcc-links a:hover {
    text-decoration: underline;
}

/* Modale preferenze */
#publivoce-cookie-preferences {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#publivoce-cookie-preferences.visible {
    display: flex;
}

.pcc-modal-box {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: pccModalIn 0.3s ease;
}

@keyframes pccModalIn {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.pcc-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}
.pcc-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #fff;
}
.pcc-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8em;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.2s;
}
.pcc-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pcc-modal-body {
    padding: 20px 25px;
}

.pcc-pref-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 18px 0;
    border-bottom: 1px solid #f1f3f5;
}
.pcc-pref-item:last-child {
    border-bottom: none;
}

.pcc-pref-info {
    flex: 1;
}
.pcc-pref-title {
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 5px 0;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pcc-pref-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pcc-pref-badge.always {
    background: #d4edda;
    color: #155724;
}
.pcc-pref-desc {
    font-size: 0.85em;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
}

/* Toggle switch */
.pcc-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
    margin-top: 5px;
}
.pcc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.pcc-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}
.pcc-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.pcc-switch input:checked + .pcc-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.pcc-switch input:checked + .pcc-slider:before {
    transform: translateX(22px);
}
.pcc-switch input:disabled + .pcc-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.pcc-modal-footer {
    padding: 18px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}
.pcc-modal-footer .pcc-btn {
    flex: 0 1 auto;
    min-width: 120px;
    padding: 10px 20px;
}

@media (max-width: 768px) {
    #publivoce-cookie-banner {
        padding: 20px;
    }
    .pcc-buttons {
        flex-direction: column;
    }
    .pcc-btn {
        width: 100%;
        min-width: auto;
    }
    .pcc-links a {
        display: block;
        margin: 5px 0;
    }
    .pcc-modal-footer {
        flex-direction: column-reverse;
    }
    .pcc-modal-footer .pcc-btn {
        width: 100%;
    }
}