/**
 * Íconos & Beneficios — front styles
 * Z Digital · Creative Elements widget
 */

.zib {
    --zib-cols-d: 4;
    --zib-cols-t: 2;
    --zib-cols-m: 1;
    --zib-icon-color: #22a45d;
    --zib-icon-hover: var(--zib-icon-color);
    --zib-divider: #e2e5e9;
    width: 100%;
}

.zib-inner {
    box-sizing: border-box;
}

.zib-title {
    margin: 0 0 28px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

/* ---- grid ---- */

.zib-grid {
    display: grid;
    grid-template-columns: repeat(var(--zib-cols-d), minmax(0, 1fr));
    gap: 24px;
}

/* Vertical dividers between blocks. Each block casts a 1px line on its right
   edge; the grid clips the line of the last column so no trailing divider. */
.zib--divider .zib-grid {
    overflow: hidden;
}

.zib--divider .zib-item {
    box-shadow: 1px 0 0 var(--zib-divider);
}

/* ---- block ---- */

.zib-item {
    display: flex;
    gap: 16px;
    padding: 12px;
    box-sizing: border-box;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    transition: transform .25s ease, box-shadow .25s ease;
}

a.zib-item {
    cursor: pointer;
}

.zib--icon-top .zib-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.zib--icon-left .zib-item {
    flex-direction: row;
    align-items: flex-start;
}

/* ---- icon ---- */

.zib-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--zib-item-icon, var(--zib-icon-color));
    font-size: 40px;
    line-height: 1;
    box-sizing: border-box;
    transition: color .25s ease, transform .25s ease, background-color .25s ease;
}

.zib-icon i {
    display: inline-block;
    line-height: 1;
}

.zib-icon svg {
    width: 40px;
    height: 40px;
    fill: currentColor;
}

.zib-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

/* ---- body ---- */

.zib-body {
    min-width: 0;
}

.zib-item-title {
    display: block;
    margin: 0 0 6px;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.25;
    text-transform: uppercase;
}

.zib-text {
    margin: 0;
    color: #5b6169;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

/* ---- button ---- */

.zib-btn-wrap {
    display: block;
    margin-top: 14px;
}

.zib-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.zib-btn--primary {
    background-color: #22a45d;
    border-color: #22a45d;
    color: #fff;
}

.zib-btn--primary:hover {
    background-color: #1c8a4e;
    border-color: #1c8a4e;
}

.zib-btn--secondary {
    background-color: transparent;
    border-color: #22a45d;
    color: #22a45d;
}

.zib-btn--secondary:hover {
    background-color: #22a45d;
    color: #fff;
}

.zib-btn--link {
    padding-left: 0;
    padding-right: 0;
    background: transparent;
    border-color: transparent;
    color: #22a45d;
}

.zib-btn--link .zib-btn-arrow {
    transition: transform .2s ease;
}

.zib-btn--link:hover .zib-btn-arrow {
    transform: translateX(4px);
}

/* ======================================================================
 * HOVER EFFECTS
 * ====================================================================== */

.zib--hover-lift .zib-item:hover {
    transform: translateY(-6px);
}

.zib--hover-grow .zib-item:hover {
    transform: scale(1.03);
}

.zib--hover-shadow .zib-item:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}

.zib--hover-zoom-icon .zib-item:hover .zib-icon {
    transform: scale(1.15);
}

/* Icon changes to hover colour on any hover effect when a hover colour is set */
.zib-item:hover .zib-icon {
    color: var(--zib-item-icon, var(--zib-icon-hover));
}

/* ======================================================================
 * ENTRANCE ANIMATION (added by JS when the block scrolls into view)
 * ====================================================================== */

.zib--anim .zib-item {
    opacity: 0;
    transition: opacity .6s ease, transform .6s ease;
    will-change: opacity, transform;
}

.zib--anim.zib-inview .zib-item {
    opacity: 1;
    transform: none;
}

/* per-variant start states — set via data-entrance on the root */
.zib--anim[data-entrance="fade-up"] .zib-item {
    transform: translateY(28px);
}

.zib--anim[data-entrance="fade-down"] .zib-item {
    transform: translateY(-28px);
}

.zib--anim[data-entrance="zoom"] .zib-item {
    transform: scale(.9);
}

/* If JS is unavailable, never leave content hidden */
.no-js .zib--anim .zib-item,
.zib--anim.zib-inview .zib-item {
    opacity: 1;
}

.zib-empty {
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    font-size: 14px;
    text-align: center;
}

/* ---- responsive ---- */

@media (max-width: 1024px) {
    .zib-grid {
        grid-template-columns: repeat(var(--zib-cols-t), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .zib-grid {
        grid-template-columns: repeat(var(--zib-cols-m), minmax(0, 1fr));
    }

    /* dividers look odd when stacked to 1 column → drop them */
    .zib--divider .zib-item {
        box-shadow: none;
    }
}
