.alice-3d-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 150px;
    min-height: 54px;

    padding: 0 24px;
    margin-left: 14px;

    background: #ffffff !important;
    color: #9b1747 !important;

    border: 2px solid #9b1747 !important;
    border-radius: 999px !important;

    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;

    white-space: nowrap;

    cursor: pointer;

    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.alice-3d-button:hover {
    background: #9b1747 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}


/* Modal */

.alice-3d-modal {
    position: fixed;
    inset: 0;

    z-index: 999999;

    display: none;

    align-items: center;
    justify-content: center;

    overscroll-behavior: contain;
}

.alice-3d-modal.active {
    display: flex;
}

.alice-3d-modal-overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.65);

    touch-action: none;
}

.alice-3d-modal-content {
    position: relative;

    z-index: 2;

    width: min(92vw, 700px);
    height: min(88vh, 700px);

    background: #ffffff;

    border-radius: 20px;

    overflow: hidden;

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.25);

    overscroll-behavior: contain;
    touch-action: none;
}

#alice-3d-frame {
    display: block;

    width: 100%;
    height: 100%;

    border: 0;

    pointer-events: auto !important;
    touch-action: none !important;

    position: relative;
    z-index: 5;

    overscroll-behavior: contain;
}

.alice-3d-close {
    position: absolute;

    top: 12px;
    right: 12px;

    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: #ffffff;

    color: #9b1747;

    font-size: 30px;
    line-height: 1;

    cursor: pointer;

    box-shadow:
        0 3px 12px
        rgba(0, 0, 0, 0.20);
}


/* Bloquear página cuando el modal está abierto */

html.alice-3d-open,
body.alice-3d-open {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}


/* Tablet / móvil */

@media (max-width: 768px) {

    /*
     * Permitimos que el formulario de compra se acomode
     * en varias filas.
     */
    form.cart {
        display: flex !important;
        flex-wrap: wrap !important;

        align-items: center !important;

        width: 100% !important;

        gap: 10px !important;

        box-sizing: border-box !important;
    }


    /*
     * Selector de cantidad.
     */
    form.cart .quantity {
        flex: 0 0 auto !important;

        margin: 0 !important;
    }


    /*
     * Botón Añadir al carrito.
     */
    form.cart .single_add_to_cart_button {
        flex: 1 1 0 !important;

        min-width: 0 !important;

        margin: 0 !important;

        white-space: nowrap !important;
    }


    /*
     * Botón Ver en 3D.
     *
     * Lo mandamos a una nueva fila para evitar
     * que se salga de la pantalla.
     */
    form.cart .alice-3d-button {
        display: flex !important;

        flex: 0 0 100% !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        min-height: 50px !important;

        margin: 4px 0 0 0 !important;

        padding: 0 18px !important;

        box-sizing: border-box !important;

        align-items: center !important;
        justify-content: center !important;

        font-size: 16px !important;

        white-space: nowrap !important;

        transform: none !important;
    }


    /* Modal */

    .alice-3d-modal {
        padding: 12px;
    }

    .alice-3d-modal-content {
        width: 100%;
        height: 78vh;

        max-width: none;

        border-radius: 16px;

        touch-action: auto;
    }

    #alice-3d-frame {
        pointer-events: auto;
        touch-action: auto;
    }

    .alice-3d-close {
        top: 8px;
        right: 8px;

        width: 38px;
        height: 38px;

        font-size: 26px;
    }

}