/* NBH Benefits Block frontend styles
   Copyright (c) Revisol Technologies Kft
*/

.nbhbb-block {
    --nbhbb-surface: #fcf8f2;
    --nbhbb-surface-2: #fffdf9;
    --nbhbb-border: #e6d7bf;
    --nbhbb-border-strong: #d8c19a;
    --nbhbb-title: #5b3a1f;
    --nbhbb-text: #6b5a47;
    --nbhbb-muted: #8a7a66;
    --nbhbb-olive: #8d9a4a;
    --nbhbb-gold: #c7a764;
    --nbhbb-gold-dark: #a98746;
    --nbhbb-tooltip-bg: #fffdf9;
    --nbhbb-tooltip-shadow: 0 18px 36px rgba(86, 66, 39, 0.18);

    width: 100%;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.nbhbb-block,
.nbhbb-block * {
    box-sizing: border-box;
}

.nbhbb-head {
    margin: 0 0 16px;
}

.nbhbb-title {
    margin: 0 0 6px;
    color: var(--nbhbb-title);
    font-size: 32px;
    line-height: 1.14;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.nbhbb-subtitle {
    margin: 0;
    color: var(--nbhbb-muted);
    font-size: 15px;
    line-height: 1.55;
}

.nbhbb-grid {
    display: grid;
    grid-template-columns: repeat(var(--nbhbb-cols-desktop, 2), minmax(0, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.nbhbb-item {
    min-width: 0;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.nbhbb-item:hover,
.nbhbb-item:focus-within {
    z-index: 9999;
}

.nbhbb-item-inner {
    position: relative;
    z-index: 1;
    overflow: visible;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-height: 112px;
    padding: 20px 52px 18px 22px;
    border: 1px solid var(--nbhbb-border);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--nbhbb-surface-2) 0%, var(--nbhbb-surface) 100%);
    box-shadow: 0 2px 8px rgba(98, 74, 44, 0.03);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.nbhbb-item-inner:hover,
.nbhbb-item-inner:focus-within {
    border-color: var(--nbhbb-border-strong);
    box-shadow: 0 10px 22px rgba(98, 74, 44, 0.08);
    transform: translateY(-1px);
    isolation: isolate;
}

.nbhbb-icon-wrap {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border: 1px solid #dcc59b;
    border-radius: 999px;
    background: linear-gradient(180deg, #fffdf9 0%, #f6e8cb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.nbhbb-icon {
    display: block;
    max-height: 100% !important;
    max-width: 100% !important;
    object-fit: contain;
    transform: scale(1.16);
    transform-origin: center;
    filter: contrast(1.16) saturate(1.18) brightness(1.02);
}

.nbhbb-content {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

.nbhbb-line {
    display: block;
    width: 100%;
}

.nbhbb-item-title {
    display: block;
    color: var(--nbhbb-title);
    font-size: 16px;
    line-height: 1.28;
    font-weight: 500;
    letter-spacing: -0.01em;
    max-width: 220px;
}

.nbhbb-help {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    z-index: 20;
}

.nbhbb-help:hover,
.nbhbb-help:focus-within,
.nbhbb-help.is-open {
    z-index: 100000;
}

.nbhbb-help-button {
    appearance: none;
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 999px;
    border: 1px solid var(--nbhbb-gold);
    background: #faf1dd;
    color: #8f7440;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.18s ease;
    position: relative;
    z-index: 100001;
}

.nbhbb-help-button:hover,
.nbhbb-help-button:focus {
    background: #f5e6c7;
    color: #6f5629;
    border-color: var(--nbhbb-gold-dark);
    outline: none;
}

.nbhbb-tooltip {
    position: absolute;
    right: 0;
    left: auto;
    top: calc(100% + 10px);
    z-index: 100002;
    min-width: 220px;
    max-width: 300px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--nbhbb-tooltip-bg);
    border: 1px solid var(--nbhbb-border);
    box-shadow: var(--nbhbb-tooltip-shadow);
    color: var(--nbhbb-text);
    font-size: 13px;
    line-height: 1.55;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    pointer-events: none;
    text-align: left;
}

.nbhbb-tooltip::before {
    content: "";
    position: absolute;
    right: 10px;
    left: auto;
    top: -7px;
    width: 12px;
    height: 12px;
    transform: rotate(45deg);
    background: var(--nbhbb-tooltip-bg);
    border-left: 1px solid var(--nbhbb-border);
    border-top: 1px solid var(--nbhbb-border);
}

.nbhbb-help:hover .nbhbb-tooltip,
.nbhbb-help:focus-within .nbhbb-tooltip,
.nbhbb-help.is-open .nbhbb-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nbhbb-block button,
.nbhbb-block button:hover,
.nbhbb-block button:focus {
    font-family: inherit;
}

@media (max-width: 991px) {
    .nbhbb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .nbhbb-title {
        font-size: 28px;
    }

    .nbhbb-item-inner {
        min-height: 92px;
        padding: 14px 40px 14px 14px;
        gap: 12px;
        align-items: center;
    }

    .nbhbb-icon-wrap {
        width: 52px;
        height: 52px;
        flex: 0 0 52px;
    }

    .nbhbb-icon {
        width: 30px;
        height: 30px;
        max-width: 30px !important;
        max-height: 30px !important;
        transform: scale(1.05);
    }

    .nbhbb-item-title {
        font-size: 14px;
        line-height: 1.2;
        max-width: none;
    }

    .nbhbb-help {
        top: 8px;
        right: 8px;
    }

    .nbhbb-help-button {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
        font-size: 12px;
    }
}

@media (max-width: 767px) {
    .nbhbb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .nbhbb-item-inner {
        min-height: 74px;
        padding: 10px 34px 10px 10px;
        gap: 10px;
        border-radius: 14px;
        align-items: center;
    }

    .nbhbb-icon-wrap {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }

    .nbhbb-icon {
        width: 24px;
        height: 24px;
        max-width: 24px !important;
        max-height: 24px !important;
        transform: scale(1);
    }

    .nbhbb-content {
        padding-top: 0;
        justify-content: center;
    }

    .nbhbb-item-title {
        font-size: 13px;
        line-height: 1.15;
        max-width: none;
    }

    .nbhbb-help {
        top: 6px;
        right: 6px;
    }

    .nbhbb-help-button {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        font-size: 11px;
    }

    .nbhbb-tooltip {
        right: 0;
        left: auto;
        min-width: 170px;
        max-width: min(220px, calc(100vw - 24px));
        font-size: 12px;
        line-height: 1.4;
        padding: 10px 12px;
    }

    .nbhbb-tooltip::before {
        right: 8px;
        left: auto;
    }
}