/* =====================================
   MODAL HUANCA - PRODUCTO AGREGADO
   ===================================== */

/* Contenedor general del modal (BASE = MÓVIL) */
.huanca-carrito-pop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-end; /* móvil: bottom sheet */
    justify-content: center;
    z-index: 999999;
    font-family: inherit;
}

.huanca-carrito-pop.is-visible {
    display: flex;
}

/* Overlay */
.huanca-carrito-pop .huanca-carrito-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

/* Caja del modal */
.huanca-carrito-pop .huanca-carrito-container {
    position: relative;
    width: 100%;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 18px 18px 0 0;
    padding: 12px 16px 18px;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.25);
    animation: huanca-carrito-slide-up 0.25s ease-out forwards;
    box-sizing: border-box;
}

/* Handle bar (solo móvil) */
.huanca-carrito-pop .huanca-carrito-handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #d0d0d0;
    margin: 4px auto 10px;
}

/* Botón cerrar (X) */
.huanca-carrito-pop .huanca-carrito-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

/* Header: check + texto */
.huanca-carrito-pop .huanca-carrito-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.huanca-carrito-pop .huanca-carrito-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #00c853;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.huanca-carrito-pop .huanca-carrito-title {
    font-size: 15px;
    font-weight: 600;
    color: #11a045;
}

/* Cuerpo del modal */
.huanca-carrito-pop .huanca-carrito-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* =====================================
   BLOQUE PRODUCTO + CANTIDAD (BASE MÓVIL)
   ===================================== */

.huanca-carrito-pop .huanca-carrito-product {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f4f4f4;
    border-radius: 8px;
    padding: 8px 10px;
}

/* Parte izquierda: imagen + info */
.huanca-carrito-pop .huanca-carrito-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.huanca-carrito-pop .huanca-carrito-img-wrap {
    width: 52px;
    height: 52px;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.huanca-carrito-pop .huanca-carrito-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.huanca-carrito-pop .huanca-carrito-info {
    flex: 1;
}

.huanca-carrito-pop .huanca-carrito-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #222222;
}

.huanca-carrito-pop .huanca-carrito-price-block {
    margin-top: 2px;
}

.huanca-carrito-pop .huanca-carrito-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

/* Fila P. lista */
.huanca-carrito-pop .huanca-carrito-label-lista {
    font-size: 12px;
    color: #777777;
}

.huanca-carrito-pop .huanca-carrito-price-lista {
    font-size: 12px;
    color: #999999;
    text-decoration: line-through;
}

/* Fila Online */
.huanca-carrito-pop .huanca-carrito-label-online {
    font-size: 12px;
    color: #d32f2f;
    font-weight: 600;
}

.huanca-carrito-pop .huanca-carrito-price-online {
    font-size: 14px;
    color: #d32f2f;
    font-weight: 700;
}

/* Cantidad (BASE: debajo del producto en móvil) */
.huanca-carrito-pop .huanca-carrito-qty-wrapper {
    margin-left: 0;
    margin-top: 4px;
}

.huanca-carrito-pop .huanca-carrito-qty-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    background: #e7e7e7;
    border-radius: 999px;
    padding: 4px 10px;
}

.huanca-carrito-pop .huanca-carrito-qty-btn {
    border-radius: 26px;
    border: 1px solid #d0d0d0;
    background: #ffffff;
    font-size: 18px;
    line-height: 1;
    padding-left: 16px;
    padding-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.huanca-carrito-pop .huanca-carrito-qty-value {
    min-width: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.huanca-carrito-pop .huanca-carrito-max-text {
    margin-top: 4px;
    text-align: right;
    font-size: 11px;
    color: #777777;
}

/* Aviso amarillo */
.huanca-carrito-pop .huanca-carrito-warning {
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fbfbfb;
}

.huanca-carrito-pop .huanca-carrito-warning-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffb300;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.huanca-carrito-pop .huanca-carrito-warning-text {
    font-size: 12px;
    color: #555555;
}

/* Footer: botones (BASE = columna, móvil) */
.huanca-carrito-pop .huanca-carrito-footer {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Botón principal: Ir al Carro */
.huanca-carrito-pop .huanca-carrito-go-cart {
    display: block;
    text-align: center;
    padding: 11px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    background: #a70236;
    color: #ffffff;
}

/* Seguir comprando */
.huanca-carrito-pop .huanca-carrito-keep {
    border: none;
    background: transparent;
    color: #111111;
    font-size: 14px;
    font-weight: 400;
    text-decoration: underline;
    align-self: center;
    cursor: pointer;
}

/* Animación de entrada */
@keyframes huanca-carrito-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Bloquear scroll del body cuando el modal está abierto */
body.huanca-carrito-open {
    overflow: hidden;
}

/* =====================================
   ESCRITORIO (>= 768px)
   ===================================== */

@media (min-width: 768px) {

    /* Modal centrado */
    .huanca-carrito-pop {
        align-items: center;
    }

    .huanca-carrito-pop .huanca-carrito-container {
        max-width: 640px;
        border-radius: 12px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    }

    .huanca-carrito-pop .huanca-carrito-handle {
        display: none;
    }

    /* Producto: fila horizontal rectangular */
    .huanca-carrito-pop .huanca-carrito-product {
        flex-direction: row;
        align-items: center;
    }

    .huanca-carrito-pop .huanca-carrito-qty-wrapper {
        margin-left: auto;
        margin-top: 0;
    }

    /* Footer: botones en horizontal, Ir al Carro a la derecha */
    .huanca-carrito-pop .huanca-carrito-footer {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        gap: 16px;
    }

    .huanca-carrito-pop .huanca-carrito-keep {
        order: 1;              /* Izquierda */
        align-self: center;
    }

    .huanca-carrito-pop .huanca-carrito-go-cart {
        order: 2;              /* Derecha */
        min-width: 180px;
    }

}
