.nz-iconspace {
    position: relative;
    width: 100%;
    height: var(--nz-space-height, 850px);
    min-height: 320px;
    overflow: hidden;
    isolation: isolate;
    background: var(--nz-space-bg, #fff);
    cursor: default;
}

.nz-iconspace__stage {
    position: absolute;
    inset: 0;
}

.nz-iconspace__item {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: min(var(--nz-item-width, 180px), var(--nz-space-max-width, 360px), 600px);
    max-width: 600px !important;
    text-decoration: none;
    color: inherit;
    will-change: transform, opacity;
    transform-origin: center center;
    z-index: var(--nz-z, 1);
    outline: none;
    pointer-events: auto;
    cursor: pointer;
    touch-action: manipulation;
}

.nz-iconspace__pair {
    position: relative;
    display: block;
    width: 100%;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.10));
    transition: filter 180ms ease;
}

.nz-iconspace__image,
.et_pb_section .nz-iconspace__image,
.et_pb_module .nz-iconspace__image {
    display: block !important;
    width: 100% !important;
    max-width: 600px !important;
    height: auto !important;
    max-height: 600px !important;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.nz-iconspace__item::after {
    content: "";
    position: absolute;
    inset: -14px;
    z-index: -1;
}

.nz-iconspace__item:hover,
.nz-iconspace__item:focus-visible,
.nz-iconspace__item:focus-within {
    z-index: 999 !important;
}

.nz-iconspace__item:hover .nz-iconspace__pair,
.nz-iconspace__item:focus-visible .nz-iconspace__pair,
.nz-iconspace__item:focus-within .nz-iconspace__pair {
    filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.17));
}

/* Imagen secundaria independiente y fija dentro de la caja. */
.nz-iconspace__secondary-preview {
    position: absolute;
    left: 50%;
    bottom: clamp(18px, 3vh, 42px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(var(--nz-secondary-width, 280px), calc(100% - 40px), 900px);
    height: min(var(--nz-secondary-width, 280px), 34vh, 900px);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(-50%, 18px, 0) scale(0.96);
    transition: opacity 180ms ease, transform 220ms ease, visibility 0s linear 220ms;
    pointer-events: none;
    text-decoration: none;
    outline: none;
    cursor: pointer;
}

.nz-iconspace__secondary-preview img,
.et_pb_section .nz-iconspace__secondary-preview img,
.et_pb_module .nz-iconspace__secondary-preview img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 900px !important;
    max-height: 900px !important;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.16));
}

.nz-iconspace__secondary-preview.is-active,
.nz-iconspace__secondary-preview:hover,
.nz-iconspace__secondary-preview:focus-visible,
.nz-iconspace__secondary-preview:focus-within {
    opacity: 1;
    visibility: visible;
    transform: translate3d(-50%, 0, 0) scale(1);
    transition-delay: 0s;
    pointer-events: auto;
}

.nz-iconspace.is-paused .nz-iconspace__item:not(:hover):not(:focus-visible):not(:focus-within) {
    opacity: 0.48 !important;
}

.nz-iconspace-empty {
    padding: 16px;
    border: 1px dashed #bbb;
    background: #fafafa;
}

@media (max-width: 767px) {
    .nz-iconspace {
        /* Respeta la altura indicada en el shortcode también en móvil. */
        height: var(--nz-space-height, 850px);
        min-height: 520px;
    }

    .nz-iconspace__item {
        width: min(var(--nz-item-width, 130px), 44vw, 240px);
    }

    .nz-iconspace__secondary-preview {
        bottom: 18px;
        width: min(var(--nz-secondary-width, 220px), calc(100% - 28px), 900px);
        height: min(var(--nz-secondary-width, 220px), 30vh, 900px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nz-iconspace__item {
        will-change: auto;
    }
}
