/* === Benefit Manager — Frontend (colori via CSS vars iniettate da PHP) === */

:root {
    --bm-primary:      #3d9b9b;
    --bm-primary-dark: #2a7070;
}

.bm-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    align-items: center;
}

/* ── Filtro a schede ── */
.bm-filter-btn {
    padding: 8px 20px;
    border: 2px solid var(--bm-primary);
    background: transparent;
    color: var(--bm-primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.bm-filter-btn:hover,
.bm-filter-btn.active {
    background: var(--bm-primary);
    color: #fff;
}

/* ── Filtro a dropdown ── */
.bm-filter-bar--dropdown {
    display: block;
}

.bm-filter-select {
    padding: 9px 36px 9px 14px;
    border: 2px solid var(--bm-primary);
    color: var(--bm-primary);
    background-color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%233d9b9b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.2s ease;
    min-width: 180px;
}

.bm-filter-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(61,155,155,.15);
}

.bm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.bm-flipbox {
    position: relative;
    height: 380px;
    perspective: 1000px;
    cursor: pointer;
}

.bm-flipbox.bm-hidden { display: none; }

.bm-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    text-align: center;
    gap: 12px;
}

.bm-front {
    background-color: var(--bm-primary);
    color: #fff;
    transform: rotateY(0deg);
}

.bm-back {
    background-color: #1a3a3a;
    color: #fff;
    transform: rotateY(180deg);
}

.bm-flipbox:hover .bm-front { transform: rotateY(-180deg); }
.bm-flipbox:hover .bm-back  { transform: rotateY(0deg); }

.bm-logo {
    width: 120px; height: 120px;
    object-fit: contain;
    /* nessun background di default — personalizzabile via Elementor */
}

.bm-logo-back { width: 70px; height: 70px; }

.bm-logo-placeholder {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2);
    width: 100px; height: 100px;
    border-radius: 50%;
    font-size: 36px; font-weight: 700;
}

.bm-title    { margin: 0; font-size: 20px; font-weight: 700; }
.bm-category { font-size: 13px; opacity: 0.8; text-transform: uppercase; letter-spacing: 1px; }
.bm-description { font-size: 15px; line-height: 1.5; opacity: 0.9; margin: 0; }

.bm-maps-btn {
    display: inline-block;
    margin-top: 8px;
    margin-right: 8px;
    padding: 12px 24px;
    border: 2px solid rgba(255,255,255,0.5);
    background: var(--bm-primary);
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.bm-maps-btn:hover {
    background: transparent;
    color: #fff;
}

.bm-phone-btn {
    display: inline-block;
    margin-top: 8px;
    margin-right: 8px;
    padding: 12px 24px;
    border: 2px solid rgba(255,255,255,0.5);
    background: transparent;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.bm-phone-btn:hover {
    background: rgba(255,255,255,0.15);
}

.bm-no-benefits {
    grid-column: 1 / -1;
    text-align: center;
    opacity: 0.6;
    padding: 40px;
}

/* ── Language switcher (tabs) ── */
.bm-lang-switcher {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.bm-lang-btn {
    padding: 8px 20px;
    border: 2px solid var(--bm-primary);
    background: transparent;
    color: var(--bm-primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.bm-lang-btn:hover,
.bm-lang-btn.active {
    background: var(--bm-primary);
    color: #fff;
}

/* ── Language switcher (dropdown) ── */
.bm-lang-area {
    margin-bottom: 16px;
}

.bm-lang-select {
    padding: 9px 36px 9px 14px;
    border: 2px solid var(--bm-primary);
    color: var(--bm-primary);
    background-color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%233d9b9b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.2s ease;
    min-width: 110px;
}

.bm-lang-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(61,155,155,.15);
}

/* ── Combined filter row (lang + categories on one line) ── */
.bm-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.bm-filter-row > .bm-lang-switcher,
.bm-filter-row > .bm-lang-area,
.bm-filter-row > .bm-filter-bar {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.bm-filter-block {
    min-width: 0;
}

.bm-filter-block > .bm-filter-bar,
.bm-filter-block > .bm-comune-filter,
.bm-filter-block > .bm-lang-switcher,
.bm-filter-block > .bm-lang-area {
    margin-bottom: 0;
}

.bm-filter-row__sep {
    width: 1px;
    height: 24px;
    background: rgba(0,0,0,0.15);
    flex-shrink: 0;
    align-self: center;
}

@media (max-width: 768px) {
    .bm-grid { grid-template-columns: 1fr; }

    /* Combined filter row: stack vertically on mobile,
       override any Elementor-generated % widths */
    .bm-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .bm-filter-row > .bm-lang-switcher,
    .bm-filter-row > .bm-lang-area,
    .bm-filter-row > .bm-filter-bar {
        flex: 1 1 auto !important;
        max-width: 100% !important;
        width: 100%;
        min-width: 0;
    }
    /* Repeater blocks stack vertically */
    .bm-filter-block {
        flex: 1 1 auto !important;
        max-width: 100% !important;
        width: 100%;
    }
    /* Separator diventa linea orizzontale */
    .bm-filter-row__sep {
        width: 100%;
        height: 1px;
        align-self: stretch;
    }
    /* Il select dentro il filtro non deve avere min-width fissa su mobile */
    .bm-filter-row .bm-filter-select,
    .bm-filter-row .bm-lang-select {
        min-width: 0;
        width: 100%;
    }
}
