/* ============================================================
   HaccpGo Cookie Banner — GDPR-compliant
   ============================================================ */

.haccp-cookie-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 9999;
    padding: 16px;
    pointer-events: none;
    display: flex;
    justify-content: center;
    transform: translateY(20px);
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
}

.haccp-cookie-banner.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.haccp-cookie-card {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    padding: 22px 26px;
    max-width: 1080px;
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 22px;
    align-items: center;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.haccp-cookie-icon {
    font-size: 38px;
    line-height: 1;
}

.haccp-cookie-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
}

.haccp-cookie-message {
    font-size: 14px;
    line-height: 1.55;
    color: #334155;
    margin: 0;
}

.haccp-cookie-links {
    margin-top: 8px;
    font-size: 13px;
    color: #475569;
    display: flex;
    gap: 8px;
    align-items: center;
}

.haccp-cookie-links a {
    color: #0f172a;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.haccp-cookie-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.haccp-btn {
    border: none;
    cursor: pointer;
    padding: 11px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    font-family: inherit;
}

.haccp-btn:hover {
    transform: translateY(-1px);
}

.haccp-btn-primary {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.28);
}

.haccp-btn-primary:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.4);
}

.haccp-btn-outline {
    background: #fff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.haccp-btn-outline:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.haccp-btn-ghost {
    background: transparent;
    color: #475569;
}

.haccp-btn-ghost:hover {
    background: #f1f5f9;
    color: #0f172a;
}

@media (max-width: 880px) {
    .haccp-cookie-card {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px;
    }
    .haccp-cookie-icon {
        display: none;
    }
    .haccp-cookie-actions {
        justify-content: stretch;
    }
    .haccp-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* ===== Modal di personalizzazione ===== */
.haccp-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}

.haccp-cookie-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.haccp-cookie-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.haccp-cookie-modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 580px;
    width: calc(100% - 32px);
    margin: 5vh auto;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.haccp-cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 26px 18px;
    border-bottom: 1px solid #f1f5f9;
}

.haccp-cookie-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.haccp-cookie-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.haccp-cookie-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.haccp-cookie-modal-body {
    padding: 8px 26px 16px;
    overflow-y: auto;
}

.haccp-cookie-category {
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

.haccp-cookie-category:last-child {
    border-bottom: none;
}

.haccp-cookie-category-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.haccp-cookie-category strong {
    font-size: 15px;
    color: #0f172a;
}

.haccp-cookie-category p {
    margin: 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.55;
}

.haccp-cookie-required {
    background: #ecfdf5;
    color: #047857;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.haccp-cookie-modal-footer {
    padding: 18px 26px;
    background: #f8fafc;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.haccp-cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.haccp-cookie-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: .25s;
}

.haccp-cookie-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: .25s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
}

.haccp-cookie-switch input:checked + .haccp-cookie-slider {
    background: #0f172a;
}

.haccp-cookie-switch input:checked + .haccp-cookie-slider::before {
    transform: translateX(20px);
}
