/* =========================================================
   VENTANA AL AÑADIR AL CARRITO
   ========================================================= */

.superop-popup-overlay {
    position: fixed;
    z-index: 2147483600;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.superop-popup-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

html.superop-popup-open,
html.superop-popup-open body {
    overflow: hidden;
}

.superop-popup {
    width: 100%;
    max-width: 760px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    color: #333;
    font-size: 15px;
    line-height: 1.5;
    transform: translateY(-12px);
    transition: transform 180ms ease;
}

.superop-popup-overlay.is-open .superop-popup {
    transform: translateY(0);
}

/* ---------- Cabecera ---------- */

.superop-popup-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 56px 20px 24px;
    border-bottom: 1px solid #e6e6e6;
}

.superop-popup-head h2 {
    margin: 0;
    font-size: 19px;
    line-height: 1.3;
    color: #1c1c1c;
}

/* Marca de verificación dibujada con dos trazos. */
.superop-popup-check {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #46a55a;
    position: relative;
}

.superop-popup-check::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 9px;
    width: 7px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.superop-popup-close {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 34px;
    height: 34px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #777;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.superop-popup-close:hover,
.superop-popup-close:focus {
    background: #f2f2f2;
    color: #111;
}

/* ---------- Cuerpo ---------- */

.superop-popup-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
}

.superop-popup-product {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.superop-popup-image {
    flex: 0 0 96px;
    max-width: 96px;
}

.superop-popup-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px;
}

.superop-popup-info {
    min-width: 0;
}

.superop-popup .superop-popup-name {
    margin: 0 0 6px;
    font-weight: 600;
    line-height: 1.35;
}

.superop-popup .superop-popup-variation,
.superop-popup .superop-popup-qty {
    margin: 0 0 4px;
    color: #666;
    font-size: 14px;
}

.superop-popup .superop-popup-price {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
}

.superop-popup .superop-popup-price del {
    opacity: 0.6;
    font-weight: 400;
}

/* ---------- Resumen ---------- */

.superop-popup-summary {
    padding-left: 24px;
    border-left: 1px solid #e6e6e6;
}

.superop-popup .superop-popup-count {
    margin: 0 0 12px;
    color: #666;
    font-size: 14px;
}

.superop-popup-totals {
    margin: 0;
    padding: 0;
    list-style: none;
}

.superop-popup-totals li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 7px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.superop-popup-totals li.superop-popup-total {
    border-bottom: 0;
    padding-top: 11px;
    font-size: 17px;
    font-weight: 700;
}

/* ---------- Botones ---------- */

.superop-popup-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 24px 24px;
}

.superop-popup .superop-popup-continue,
.superop-popup .superop-popup-action {
    margin: 0;
    cursor: pointer;
}

.superop-popup-loading {
    margin: 0;
    padding: 48px 24px;
    text-align: center;
    color: #666;
}

/* ---------- Móvil ---------- */

@media (max-width: 640px) {
    .superop-popup-body {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 18px;
    }

    .superop-popup-summary {
        padding-left: 0;
        padding-top: 18px;
        border-left: 0;
        border-top: 1px solid #e6e6e6;
    }

    .superop-popup-head {
        padding: 16px 48px 16px 18px;
    }

    .superop-popup-head h2 {
        font-size: 17px;
    }

    .superop-popup-actions {
        padding: 0 18px 18px;
    }

    .superop-popup .superop-popup-continue,
    .superop-popup .superop-popup-action {
        flex: 1 1 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .superop-popup-overlay,
    .superop-popup {
        transition: none;
    }
}
