/* Card presentation; listing layout and controls stay in the widget. */
.item-tool,
.item-tool *,
.item-tool *::before,
.item-tool *::after {
    box-sizing: border-box;
}

.item-tool {
    color: var(--bivb-color-text);
    font-family: var(--bivb-font-family-base-stack);
}

.item-tool[hidden] {
    display: none !important;
}

.bivb-tools__item-link:focus-visible,
.bivb-tools__action:focus-visible {
    outline: var(--bivb-control-focus-width) solid var(--bivb-color-primary);
    outline-offset: var(--bivb-control-focus-offset);
}

.bivb-tools__item {
    isolation: isolate;
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 8.75em;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8125em;
    padding: 1.25em 1.1875em;
    border: 1px solid var(--bivb-color-border-soft);
    border-radius: var(--bivb-radius-6);
    background: var(--bivb-color-surface);
}

.bivb-tools__item[hidden] {
    display: none;
}

.bivb-tools__item-body {
    display: grid;
    min-width: 0;
    grid-template-columns: 60px minmax(0, 1fr);
    align-items: center;
    gap: 0.9375em;
    color: var(--bivb-color-text);
}

.item-tool > .bivb-tools__item-link {
    position: absolute;
    z-index: 1;
    inset: 0;
    border-radius: inherit;
}

.bivb-tools__item:has(.bivb-tools__item-link:hover) .bivb-tools__item-title {
    color: var(--bivb-color-primary);
}

.bivb-tools__icon {
    display: grid;
    width: 60px;
    height: 60px;
    padding: 0;
    place-items: center;
    overflow: hidden;
    border-radius: var(--bivb-radius-full);
    background: transparent;
}

.bivb-tools__icon img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
}

.bivb-tools__content {
    display: grid;
    min-width: 0;
    gap: 0.1875em;
}

.bivb-tools__item-title {
    font-size: 1.125em;
    font-weight: var(--bivb-font-weight-medium);
    line-height: 1.25;
}

.bivb-tools__description {
    color: var(--bivb-color-text-muted);
    font-size: 0.875em;
    line-height: 1.3;
}

.item-tool > .bivb-tools__action {
    position: relative;
    z-index: 2;
    display: inline-grid;
    width: 1.875em;
    height: 1.875em;
    place-items: center;
    padding: 0;
    border: 0;
    appearance: none;
    background: transparent;
    font: inherit;
    line-height: 0;
    cursor: pointer;
}

.bivb-tools__action > img {
    pointer-events: none;
    display: block;
    width: 100%;
    height: 100%;
}

.bivb-tools__new {
    position: absolute;
    top: -0.5em;
    left: -0.5em;
    z-index: 1;
    padding: 0.25em 0.625em;
    border-radius: var(--bivb-radius-4);
    background: var(--bivb-color-accent);
    color: var(--bivb-color-text-inverse);
    font-size: 0.625em;
    font-weight: var(--bivb-font-weight-semibold);
    text-transform: uppercase;
}

/* phone */
@media (max-width: 767px) {
    .bivb-tools__item {
        min-height: 7.5em;
        padding: 0.9375em;
    }

    .bivb-tools__item-body {
        gap: 0.75em;
    }

    .bivb-tools__icon {
        width: 60px;
        height: 60px;
    }

    .bivb-tools__action {
        margin-right: 0;
    }
}

/* mobile and tablet */
@media (max-width: 1023px) {

    .bivb-tools__item {
        border-color: var(--bivb-color-border-soft);
        border-radius: var(--bivb-radius-6);
    }
}

.bivb-tools__item-body--without-icon {
    grid-template-columns: minmax(0, 1fr);
}

/* Tool compatibility uses the explicit product threshold: <= 1024px. */
@media (max-width: 1024px) {
    .bivb-tools__item[data-bivb-tool-availability="desktop-only"] {
        border-color: var(--bivb-color-border-soft);
        background: var(--bivb-color-surface-muted);
    }

    .bivb-tools__item[data-bivb-tool-availability="desktop-only"] .bivb-tools__icon img {
        filter: grayscale(1);
        opacity: 0.85;
    }

    .bivb-tools__item[data-bivb-tool-availability="desktop-only"] :is(.bivb-tools__item-title, .bivb-tools__description) {
        color: var(--bivb-color-text-muted);
    }
}

/* desktop */
@media (min-width: 1025px) {
    .bivb-tools__action {
        align-self: start;
    }
}
