/* 
 * CSS del Banner (Premium Customizer) 
 * Le variabili CSS (--gdpr-*) sono iniettate in inline style da class-gdpr-frontend.php
 */

:root {
    /* Fallback nativo nel caso non ci siano variabili iniettate */
    --gdpr-bg: #ffffff;
    --gdpr-text: #333333;
    --gdpr-link: #0073aa;
    --gdpr-btn-acc-bg: #0073aa;
    --gdpr-btn-acc-tx: #ffffff;
    --gdpr-btn-den-bg: #e2e8f0;
    --gdpr-btn-den-tx: #334155;
    --gdpr-btn-prf-bg: #ffffff;
    --gdpr-btn-prf-tx: #0073aa;
    --gdpr-tog-bg: #0073aa;
    --gdpr-tog-in: #cccccc;
    --gdpr-rad: 12px;
    --gdpr-btn-rad: 6px;
    --gdpr-font: 14px;
    --gdpr-width: 526px;
    --gdpr-padding: 20px;
    --gdpr-bw: 1px;
    --gdpr-bc: rgba(255, 255, 255, 0.2);
    --gdpr-overlay: rgba(0, 0, 0, 0.6);
    --gdpr-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.gdpr-pro-hidden {
    display: none !important;
}

/* Soft Wall Overlay */
#gdpr-pro-soft-wall {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--gdpr-overlay);
    z-index: 999998;
    backdrop-filter: blur(3px);
}

/* Banner Base */
.gdpr-pro-banner {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--gdpr-text);
    font-size: var(--gdpr-font);
}

/* Posizionamento */
.gdpr-pro-banner.gdpr-pos-bottom {
    bottom: 0; left: 0; right: 0;
    width: 100%;
}
.gdpr-pro-banner.gdpr-pos-bottom-left {
    bottom: 20px; left: 20px;
    width: 100%; max-width: var(--gdpr-width);
}
.gdpr-pro-banner.gdpr-pos-bottom-right {
    bottom: 20px; right: 20px;
    width: 100%; max-width: var(--gdpr-width);
}
.gdpr-pro-banner.gdpr-pos-center {
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; max-width: var(--gdpr-width);
}

/* Animazioni */
.gdpr-pro-banner.gdpr-anim-fade {
    animation: gdprFadeIn 0.5s ease-out forwards;
}
.gdpr-pro-banner.gdpr-anim-slide.gdpr-pos-bottom,
.gdpr-pro-banner.gdpr-anim-slide.gdpr-pos-bottom-left,
.gdpr-pro-banner.gdpr-anim-slide.gdpr-pos-bottom-right {
    animation: gdprSlideUp 0.5s ease-out forwards;
}
.gdpr-pro-banner.gdpr-anim-slide.gdpr-pos-center {
    animation: gdprPopUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes gdprFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes gdprSlideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes gdprPopUp { from { transform: translate(-50%, -40%) scale(0.8); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

/* Glass Panel e Aspetto */
.gdpr-pro-glass-panel {
    background: var(--gdpr-bg);
    border-radius: var(--gdpr-rad);
    box-shadow: var(--gdpr-shadow);
    padding: var(--gdpr-padding);
    border: var(--gdpr-bw) solid var(--gdpr-bc);
    position: relative;
}

/* Bottone chiusura */
.gdpr-pro-close {
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 28px;
    line-height: 1;
    padding: 10px 15px;
    cursor: pointer;
    color: var(--gdpr-text);
    opacity: 0.6;
    z-index: 10;
    transition: opacity 0.2s;
}
.gdpr-pro-close:hover { opacity: 1; }

.gdpr-pro-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 40px;
    margin-bottom: 15px;
}

.gdpr-pro-header.gdpr-has-logo {
    /* Manteniamo le stesse proprietà, l'ancoraggio è assoluto per il logo */
}

.gdpr-pro-logo-container {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.gdpr-pro-logo {
    max-width: 120px;
    max-height: 40px;
    display: block;
    margin: 0;
}

.gdpr-pro-title-container {
    text-align: center;
}

.gdpr-pro-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.gdpr-pro-text {
    margin: 0 0 20px 0;
    line-height: 1.5;
}
.gdpr-pro-text a {
    color: var(--gdpr-link);
    text-decoration: underline;
}

/* Pulsanti */
.gdpr-pro-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
    width: 100%;
}

.gdpr-pro-btn {
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: var(--gdpr-btn-rad);
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
    white-space: nowrap;
}
.gdpr-pro-btn:hover {
    transform: scale(1.02);
}

.gdpr-active-btn {
    box-shadow: 0 0 0 2px #10b981; /* Verde per indicare selezione attiva */
    transform: scale(1.02);
}

/* !important su questi 3 blocchi: il banner viene inserito su siti con temi/page builder
   arbitrari (qui Elementor) che spesso applicano un reset globale ai bottoni, tipo
   "button { border: 0 }" con specificità più alta della nostra o con !important esso
   stesso. Quel reset sovrascriveva silenziosamente SOLO il bordo (non sfondo/testo, che
   usano proprietà diverse e infatti funzionavano), lasciando il colore del bordo scelto
   nel Wizard privo di qualunque effetto visibile pur essendo corretto lato PHP/CSS.
   Ridichiariamo l'intera proprietà "border" (non solo border-color, altrimenti un
   "border-width: 0" del tema lascerebbe comunque zero pixel di bordo) con !important, così
   vince sempre sul reset del tema. */
.gdpr-pro-btn-primary {
    background-color: var(--gdpr-btn-acc-bg) !important;
    color: var(--gdpr-btn-acc-tx) !important;
    border: 1px solid var(--gdpr-btn-acc-bd) !important;
}

.gdpr-pro-btn-secondary {
    background-color: var(--gdpr-btn-den-bg) !important;
    color: var(--gdpr-btn-den-tx) !important;
    border: 1px solid var(--gdpr-btn-den-bd) !important;
}

.gdpr-pro-btn-text {
    background-color: var(--gdpr-btn-prf-bg) !important;
    color: var(--gdpr-btn-prf-tx) !important;
    border: 1px solid var(--gdpr-btn-prf-bd) !important;
}


/* Categorie: accordion (testo descrittivo chiuso di default) per ridurre l'altezza del
   pannello Preferenze, che con tutte le descrizioni sempre visibili diventava enorme. Solo
   riga titolo + interruttore restano sempre visibili; il testo si apre cliccando sul titolo,
   NON sull'interruttore (i due elementi sono fratelli, non annidati, quindi cliccare
   l'interruttore non apre/chiude mai la descrizione, ed espandere la descrizione non
   modifica mai il consenso). Vedi gdpr-pro-cat-title-row in banner.js per il click handler. */
.gdpr-pro-category {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.gdpr-pro-category:last-child {
    border-bottom: none;
    margin-bottom: 15px;
}
.gdpr-pro-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}
.gdpr-pro-cat-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}
.gdpr-pro-cat-title-row strong {
    font-size: 0.95em;
}
.gdpr-pro-cat-chevron {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    color: var(--gdpr-text, #64748b);
    opacity: 0.6;
    font-size: 1.1em;
    line-height: 1;
}
.gdpr-pro-cat-chevron::after {
    content: '+';
}
.gdpr-pro-category.gdpr-pro-cat-open .gdpr-pro-cat-chevron::after {
    content: '\2212'; /* segno meno */
}
.gdpr-pro-cat-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.gdpr-pro-category.gdpr-pro-cat-open .gdpr-pro-cat-body {
    max-height: 200px;
}
.gdpr-pro-cat-body p {
    margin: 0 0 10px 26px;
    font-size: 0.85em;
    opacity: 0.8;
}

/* Slider iOS style Toggle */
.gdpr-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.gdpr-switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.gdpr-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--gdpr-tog-in);
    transition: .4s;
    border-radius: 34px;
}
.gdpr-slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .gdpr-slider {
    background-color: var(--gdpr-tog-bg);
}
input:focus + .gdpr-slider {
    box-shadow: 0 0 1px var(--gdpr-tog-bg);
}
input:checked + .gdpr-slider:before {
    transform: translateX(24px);
}

/* Floating Badge */
.gdpr-pro-floating-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: var(--gdpr-bg);
    color: var(--gdpr-link);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    box-shadow: var(--gdpr-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999997; /* Just below the soft wall and banner */
    transition: all 0.3s ease;
}
.gdpr-pro-floating-badge:hover {
    transform: scale(1.1);
}
.gdpr-pro-badge-icon {
    width: 24px;
    height: 24px;
}
input:disabled + .gdpr-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Accordion Styling for Policy Documents */
.gdpr-document {
    font-family: inherit;
    color: inherit;
    line-height: 1.6;
}

/* Dimensioni fisse per le pagine legali generate (Privacy Policy, Cookie Policy, Termini,
   Imprint): senza queste regole titoli e testo ereditano la tipografia del tema del sito
   (spesso enorme, es. con page builder come Elementor dove un h2 può superare i 40px),
   rendendo questi documenti sproporzionati rispetto al resto del sito. !important necessario
   per lo stesso motivo dei pulsanti del banner: molti temi impostano la tipografia con
   selettori più specifici dei nostri. Titoli sempre entro i 25px, testo sempre a 16px,
   indipendentemente dal tema — non solo di default, ma sempre, perché il tema potrebbe
   comunque provare a riapplicare la propria tipografia dopo un aggiornamento.
*/
.gdpr-document,
.gdpr-document p,
.gdpr-document li,
.gdpr-document td,
.gdpr-document th,
.gdpr-document span,
.gdpr-document a,
.gdpr-document label,
.gdpr-document strong,
.gdpr-document div {
    font-size: 16px !important;
    line-height: 1.6 !important;
}

.gdpr-document h1,
.gdpr-document h2 {
    font-size: 25px !important;
    line-height: 1.3 !important;
    margin-top: 2em;
    margin-bottom: 1em;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 0.5em;
}

.gdpr-document h3 {
    font-size: 20px !important;
    line-height: 1.3 !important;
    margin-top: 1.5em;
}

.gdpr-document h4,
.gdpr-document h5,
.gdpr-document h6 {
    font-size: 16px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
}

.gdpr-dropdown {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gdpr-dropdown summary {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    background: #f1f5f9;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gdpr-dropdown summary::-webkit-details-marker {
    display: none;
}

.gdpr-dropdown summary::after {
    content: '+';
    font-size: 1.5em;
    color: #64748b;
    transition: transform 0.3s ease;
}

.gdpr-dropdown[open] summary::after {
    content: '-';
    transform: rotate(180deg);
}

.gdpr-dropdown summary h3 {
    margin: 0 !important;
    font-size: 1.1em;
    color: #1e293b;
}

.gdpr-dropdown > p, 
.gdpr-dropdown > ul, 
.gdpr-dropdown > h4, 
.gdpr-dropdown > h5 {
    padding-left: 20px;
    padding-right: 20px;
}

.gdpr-dropdown > h4 {
    margin-top: 15px;
    margin-bottom: 5px;
    color: #334155;
}

.gdpr-dropdown > h5 {
    margin-top: 10px;
    margin-bottom: 2px;
    color: #475569;
}

.gdpr-subtitle {
    font-weight: bold;
    color: #475569;
    margin-bottom: 5px;
    margin-top: 15px;
}


/* Mobile Badge Visibility Settings */
.gdpr-hide-always {
    display: none !important;
}

@media (max-width: 768px) {
    .gdpr-pro-floating-badge.gdpr-hide-mobile {
        display: none !important;
    }
    
    .gdpr-pro-glass-panel {
        max-height: 85vh;
        overflow-y: auto;
    }
    
    /* Responsive Header */
    .gdpr-pro-header {
        flex-direction: column;
        justify-content: flex-start;
        height: auto;
    }
    
    .gdpr-pro-logo-container {
        position: static;
        transform: none;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .gdpr-pro-logo {
        margin: 0 auto;
    }
    
    /* Responsive Buttons */
    .gdpr-pro-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .gdpr-pro-btn {
        width: 100%;
    }
    
    /* Responsive Banner Dimensions */
    .gdpr-pro-banner {
        max-width: calc(100% - 30px) !important;
        left: 15px !important;
        right: 15px !important;
        bottom: 15px !important;
    }
    
    .gdpr-pro-banner.gdpr-pos-center {
        top: 50% !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        left: 50% !important;
        width: 90% !important;
    }
}

/* ====================================================
   FORMATTAZIONE PAGINE LEGALI (.my-gdpr-pro-document)
==================================================== */
.my-gdpr-pro-document {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    color: #334155 !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    max-width: 1100px;
    margin: 0 auto;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-align: left !important;
}
.my-gdpr-pro-document h2 { font-size: 26px !important; border-bottom: 2px solid #e2e8f0 !important; padding-bottom: 10px !important; margin-top: 1.5em !important; margin-bottom: 0.8em !important; color: #0f172a !important; font-weight: 600 !important; }
.my-gdpr-pro-document h3 { font-size: 20px !important; margin-top: 1.5em !important; margin-bottom: 0.8em !important; color: #0f172a !important; font-weight: 600 !important; }
.my-gdpr-pro-document p, .my-gdpr-pro-document li { margin-bottom: 1.2em !important; font-size: 16px !important; }
.my-gdpr-pro-document ul { list-style-type: disc !important; padding-left: 24px !important; margin-bottom: 1.2em !important; }

/* Accordion Cookie */
.gdpr-cookie-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #f8fafc;
}
.gdpr-cookie-accordion summary {
    padding: 15px;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.gdpr-cookie-accordion summary::-webkit-details-marker {
    display: none;
}
.gdpr-acc-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}
.gdpr-acc-cat {
    font-size: 12px;
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
    color: #475569;
}
.gdpr-cookie-accordion[open] summary {
    border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
}
.gdpr-acc-body {
    padding: 15px;
    background: #fff;
    font-size: 15px !important;
}

/* Inline Toggles */
.gdpr-inline-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}
.gdpr-inline-switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.gdpr-inline-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 26px;
}
.gdpr-inline-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
.gdpr-inline-switch input:checked + .gdpr-inline-slider {
    background-color: #10b981;
}
.gdpr-inline-switch input:disabled + .gdpr-inline-slider {
    background-color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}
.gdpr-inline-switch input:checked + .gdpr-inline-slider:before {
    transform: translateX(24px);
}

/* Disabilita Scroll Dietro Soft Wall */
body.gdpr-pro-noscroll {
    overflow: hidden !important;
}

/* ====================================================
   FORMATTAZIONE PAGINE LEGALI (.my-gdpr-pro-document)
   Forza uno stile standard, leggibile, pulito e 
   indipendente dalle regole del tema attivo.
==================================================== */

.my-gdpr-pro-document {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    color: #334155 !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    max-width: 1100px;
    margin: 40px auto;
    padding: 40px;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    text-align: left !important;
}

.my-gdpr-pro-document h1,
.my-gdpr-pro-document h2,
.my-gdpr-pro-document h3,
.my-gdpr-pro-document h4 {
    color: #0f172a !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    margin-top: 1.8em !important;
    margin-bottom: 0.8em !important;
    line-height: 1.3 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.my-gdpr-pro-document h2 { 
    font-size: 26px !important; 
    border-bottom: 2px solid #e2e8f0 !important; 
    padding-bottom: 10px !important; 
    margin-top: 0 !important; 
}
.my-gdpr-pro-document h3 { font-size: 20px !important; }
.my-gdpr-pro-document p { 
    margin-bottom: 1.2em !important; 
    font-size: 16px !important; 
}
.my-gdpr-pro-document ul,
.my-gdpr-pro-document ol { 
    margin-bottom: 1.2em !important; 
    padding-left: 24px !important; 
    list-style-position: outside !important;
}
.my-gdpr-pro-document ul { list-style-type: disc !important; }
.my-gdpr-pro-document ol { list-style-type: decimal !important; }
.my-gdpr-pro-document li { 
    margin-bottom: 0.5em !important; 
    font-size: 16px !important; 
}
.my-gdpr-pro-document strong { 
    color: #1e293b !important; 
    font-weight: 600 !important;
}
.my-gdpr-pro-document em { 
    color: #64748b !important; 
    font-style: italic !important;
}
.my-gdpr-pro-document a { 
    color: #2563eb !important; 
    text-decoration: underline !important; 
    box-shadow: none !important;
}
.my-gdpr-pro-document a:hover { 
    color: #1d4ed8 !important; 
}
.my-gdpr-pro-document .gdpr-pro-btn {
    display: inline-block !important;
    margin-top: 20px !important;
    font-size: 14px !important;
    padding: 10px 20px !important;
}

/* Responsive per le pagine legali */
@media (max-width: 768px) {
    .my-gdpr-pro-document {
        padding: 20px;
        margin: 20px auto;
        font-size: 15px !important;
    }
    .my-gdpr-pro-document h2 { font-size: 22px !important; }
    .my-gdpr-pro-document h3 { font-size: 18px !important; }
    .my-gdpr-pro-document p, 
    .my-gdpr-pro-document li { font-size: 15px !important; }
}

