/* =====================================================
   COOPVITA - Banner e Modal de Consentimento de Cookies
   ===================================================== */

#coopvita-cookie-banner,
#coopvita-cookie-modal {
    font-family: 'Inter', system-ui, sans-serif;
    color: #1f2937;
    box-sizing: border-box;
}

#coopvita-cookie-banner *,
#coopvita-cookie-modal * {
    box-sizing: border-box;
}

/* ---------- Banner ---------- */
#coopvita-cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    background: #ffffff;
    border: 1px solid rgba(0, 102, 51, 0.15);
    border-radius: 16px;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 20px 22px;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: coopvita-cookie-rise 0.35s ease-out;
}

@keyframes coopvita-cookie-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

#coopvita-cookie-banner[hidden] { display: none; }

#coopvita-cookie-banner .ccb-text {
    font-size: 14px;
    line-height: 1.55;
    color: #374151;
    margin: 0;
}

#coopvita-cookie-banner .ccb-text strong {
    color: #111827;
    font-weight: 700;
}

#coopvita-cookie-banner .ccb-text a {
    color: #006633;
    text-decoration: underline;
    font-weight: 600;
}

#coopvita-cookie-banner .ccb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.ccb-btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 11px 18px;
    border-radius: 9999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
    line-height: 1;
}

.ccb-btn:focus-visible {
    outline: 2px solid #006633;
    outline-offset: 2px;
}

.ccb-btn-primary {
    background: #006633;
    color: #ffffff;
}
.ccb-btn-primary:hover { background: #00502a; }

.ccb-btn-secondary {
    background: #ffffff;
    color: #006633;
    border-color: #006633;
}
.ccb-btn-secondary:hover { background: #f0f7f3; }

.ccb-btn-tertiary {
    background: transparent;
    color: #374151;
    border-color: #d1d5db;
}
.ccb-btn-tertiary:hover { background: #f3f4f6; color: #111827; }

@media (min-width: 768px) {
    #coopvita-cookie-banner {
        flex-direction: row;
        align-items: center;
        gap: 28px;
        padding: 22px 28px;
        bottom: 24px;
        left: 24px;
        right: 24px;
    }
    #coopvita-cookie-banner .ccb-text { flex: 1; }
}

/* ---------- Modal ---------- */
#coopvita-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 14, 10, 0.55);
    backdrop-filter: blur(2px);
    animation: coopvita-cookie-fade 0.2s ease-out;
}

#coopvita-cookie-modal[hidden] { display: none; }

@keyframes coopvita-cookie-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#coopvita-cookie-modal .ccm-card {
    background: #ffffff;
    border-radius: 18px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.35);
    padding: 28px;
    position: relative;
}

#coopvita-cookie-modal .ccm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

#coopvita-cookie-modal h2 {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

#coopvita-cookie-modal .ccm-intro {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 20px;
}

#coopvita-cookie-modal .ccm-close {
    background: transparent;
    border: 0;
    color: #6b7280;
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
#coopvita-cookie-modal .ccm-close:hover { background: #f3f4f6; color: #111827; }
#coopvita-cookie-modal .ccm-close:focus-visible {
    outline: 2px solid #006633;
    outline-offset: 2px;
}

#coopvita-cookie-modal .ccm-option {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
}

#coopvita-cookie-modal .ccm-option .ccm-info { flex: 1; min-width: 0; }
#coopvita-cookie-modal .ccm-option h3 {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
}
#coopvita-cookie-modal .ccm-option p {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* Toggle switch */
.ccm-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.ccm-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.ccm-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 9999px;
    transition: background-color 0.2s;
}
.ccm-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 9999px;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.ccm-switch input:checked + .ccm-slider { background: #006633; }
.ccm-switch input:checked + .ccm-slider::before { transform: translateX(20px); }
.ccm-switch input:focus-visible + .ccm-slider {
    outline: 2px solid #006633;
    outline-offset: 2px;
}
.ccm-switch input:disabled + .ccm-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

#coopvita-cookie-modal .ccm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 480px) {
    #coopvita-cookie-banner .ccb-actions,
    #coopvita-cookie-modal .ccm-actions {
        justify-content: stretch;
    }
    #coopvita-cookie-banner .ccb-actions .ccb-btn,
    #coopvita-cookie-modal .ccm-actions .ccb-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}
