.hpl-wrapper {
    width: 100%;
    position: relative;
}

.hpl-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: relative;
}

.hpl-item {
    position: relative;
    min-height: 82px;
    cursor: pointer;
    outline: none;
    transition: opacity 220ms ease;
}

.hpl-item.is-hovered,
.hpl-item.is-active,
.hpl-item:focus-within {
    z-index: 30;
}

.hpl-list.has-hover .hpl-item:not(.is-hovered):not(.is-active):not(:focus-within) {
    opacity: 0.28;
}

.hpl-list.has-hover .hpl-item.is-hovered,
.hpl-list.has-hover .hpl-item.is-active,
.hpl-list.has-hover .hpl-item:focus-within {
    opacity: 1;
}

.hpl-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.hpl-number {
    font-size: 12px;
    line-height: 1;
    font-weight: 500;
    flex-shrink: 0;
}

.hpl-line {
    display: block;
    width: 100%;
    height: 1px;
    opacity: 0.9;
}

.hpl-title {
    font-size: 18px;
    line-height: 1.25;
    font-weight: 400;
    transition: opacity 220ms ease, transform 220ms ease;
}

.hpl-popup {
    position: absolute;
    z-index: 20;
    width: min(520px, 92vw);
    min-height: 210px;
    padding: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms ease, transform 220ms ease;
}

/* Posicionamiento inteligente en desktop */
.hpl-item.hpl-open-right .hpl-popup {
    left: calc(100% + 24px);
    right: auto;
}

.hpl-item.hpl-open-left .hpl-popup {
    right: calc(100% + 24px);
    left: auto;
}

.hpl-item.hpl-open-down .hpl-popup {
    top: 0;
    bottom: auto;
    transform: translateY(14px);
}

.hpl-item.hpl-open-up .hpl-popup {
    bottom: 0;
    top: auto;
    transform: translateY(-14px);
}

.hpl-item:hover .hpl-popup,
.hpl-item:focus-within .hpl-popup,
.hpl-item.is-active .hpl-popup,
.hpl-item.is-hovered .hpl-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.hpl-popup-content {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 20px;
    align-items: stretch;
    height: 100%;
}

.hpl-popup-text {
    font-size: 13px;
    line-height: 1.35;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hpl-popup-image {
    width: 100%;
    min-height: 170px;
    overflow: hidden;
}

.hpl-popup-image img {
    width: 100%;
    height: 100%;
    min-height: 170px;
    object-fit: cover;
    display: block;
}

.hpl-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: 22px;
    padding: 10px 24px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    z-index: 0;
    transition: color 0.3s ease-in-out, transform 180ms ease;
}

.hpl-button-text {
    position: relative;
    z-index: 1;
}

/* El levantamiento sutil ocurre siempre, tenga o no activada la mancha */
.hpl-button:hover,
.hpl-button:focus {
    transform: translateY(-1px);
}

/* Círculo que crece desde el punto donde entra el cursor (solo si la animación está activada) */
.hpl-button:not(.hpl-anim-off)::before {
    content: '';
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    width: var(--d, 100px);
    height: var(--d, 100px);
    border-radius: 100%;
    background-color: #2B2421;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease-in-out;
    z-index: 0;
    pointer-events: none;
}

.hpl-button:not(.hpl-anim-off):hover,
.hpl-button:not(.hpl-anim-off):focus {
    color: #D6CEC7;
}

.hpl-button:not(.hpl-anim-off):hover::before,
.hpl-button:not(.hpl-anim-off):focus::before {
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 767px) {
    .hpl-list {
        grid-template-columns: 1fr !important;
        gap: 26px;
    }

    .hpl-item,
    .hpl-list.has-hover .hpl-item,
    .hpl-list.has-hover .hpl-item.is-hovered,
    .hpl-list.has-hover .hpl-item.is-active {
        opacity: 1;
    }

    .hpl-item {
        min-height: auto;
    }

    .hpl-title {
        font-size: 17px;
    }

    .hpl-popup,
    .hpl-item.hpl-open-right .hpl-popup,
    .hpl-item.hpl-open-left .hpl-popup {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100% !important;
        margin-top: 14px;
        transform: translateY(8px);
        display: none;
    }

    .hpl-item:hover .hpl-popup,
    .hpl-item:focus-within .hpl-popup,
    .hpl-item.is-active .hpl-popup,
    .hpl-item.is-hovered .hpl-popup {
        display: block;
        transform: translateY(0);
    }

    .hpl-popup-content {
        grid-template-columns: 1fr;
    }

    .hpl-popup-image,
    .hpl-popup-image img {
        min-height: 190px;
    }
}
