/* === CONTENEDOR PRINCIPAL === */
.carrito-page {
    display: flex;
    flex-direction: column;
    margin-top: -35px;
    gap: 2rem;
    padding: 1rem;
}

/* === TÍTULO === */
.titulo-seccion {
    margin: 2rem auto 1.5rem;
    width: fit-content;
}

/* =======================================================
   🛒  CARRITO — ESTILOS LIMPIOS Y UNIFICADOS
   ======================================================= */

/* === LAYOUT GENERAL === */
.cart-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding: 0 15rem;
    box-sizing: border-box;
}

/* === LISTA PRINCIPAL === */
.cart-list {
    flex: 1 1 60%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* === ITEM === */
.cart-item {
    display: flex;
    gap: 1rem;
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
    align-items: flex-start;
}
.cart-item:hover {
    transform: scale(1.01);
}

/* Imagen */
.cart-item img.cart-thumb {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Info */
.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Nombre */
.cart-item-info h4 {
    margin: 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

/* Meta (color, talla) */
.cart-item-info .meta {
    color: #777;
    font-size: 0.9rem;
    margin: 1px 0 3px !important;
}

/* Cantidad */
.cart-item-info .qty {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    margin-bottom: 3px;
}
.cart-item-info .qty button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: var(--brand-2);
    cursor: pointer;
    transition: background 0.2s;
}
.cart-item-info .qty button:hover {
    background: var(--brand-1);
}
.qty-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 4px;
}

/* Subtotal */
.cart-item-info .subtotal {
    margin-top: 6px;
    font-weight: 600;
    color: var(--brand-2);
}

/* Botón eliminar */
.cart-item-info .remove-item {
    margin-top: 4px;
    align-self: flex-start;
    background: transparent;
    border: none;
    color: #b00;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    text-align: left;
    transition: color 0.2s;
}
.cart-item-info .remove-item:hover {
    color: #d00;
    text-decoration: underline;
}

/* === RESUMEN (lado derecho) === */
.cart-summary {
    flex: 0 0 320px;
    background: #fff;
    border-radius: 14px;
    padding: 1.8rem 1.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-self: flex-start;
    margin-left: auto;
    margin-right: 1rem;
    position: sticky;
    top: 8rem;
}
.cart-summary p {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}
.cart-summary strong {
    color: var(--brand-2);
    font-size: 1.2rem;
}

/* === BOTONES === */
.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.btn-small {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-small:hover {
    background: #f7f7f7;
}
.btn-small.whatsapp {
    background: var(--wa-green);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}
.btn-small.whatsapp:hover {
    background: var(--wa-dark);
}

/* === AVISO === */
.notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f1f9f4;
    border-left: 4px solid var(--wa-green);
    color: #2e7d32;
    font-size: 0.9rem;
    padding: 10px 12px;
    border-radius: 8px;
}
.notice::before {
    content: "ℹ️";
    font-size: 1.1rem;
    opacity: 0.9;
}

/* === VACÍO === */
#essemz-cart-container p {
    text-align: center;
    font-size: 1rem;
    color: #666;
    margin-top: 2rem;
}

/* === ANIMACIÓN === */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

/* === 📱 TABLET 1024px – 601px === */
@media (min-width: 601px) and (max-width: 1024px) {

    /* Título */
    .titulo-seccion {
        font-size: 5.5rem;
        margin-top: 3.5rem;
    }
    .titulo-seccion::after {
        width: 150px;
        height: 3px;
    }

    /* Layout general */
    .cart-layout {
        padding: 0 8rem !important;
        gap: 1rem !important;
    }

    /* Lista de productos */
    .cart-item {
        padding: 1.2rem !important;
        gap: 1.5rem !important;
    }

    .cart-item img.cart-thumb {
        width: 160px;
        height: 160px;
    }

    .cart-item-info h4 {
        font-size: 1.5rem;
    }

    .cart-item-info .meta {
        font-size: 1.5rem;
    }

    .cart-item-info .qty button {
        padding: 6px 11px;
        font-size: 1.5rem;
    }

    .subtotal {
        font-size: 1.3rem;
    }
    
    .remove-item{
        font-size: 3rem;
    }

    /* Resumen a la derecha */
    .cart-summary {
        flex: 0 0 360px !important;
        padding: 2rem 1.8rem !important;
        border-radius: 12px;
    }

    .cart-summary p {
        font-size: 1.15rem;
    }

    .cart-summary strong {
        font-size: 1.35rem;
    }

    .cart-actions .btn-small {
        padding: 1rem 1.4rem;
        font-size: 1.05rem;
    }
    .cart-summary {
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
        width: 100%;
        max-width: 360px;
        margin-bottom: 2rem;
    }

    /* 🔹 Centrar los textos internos */
    .cart-summary p,
    .cart-summary strong {
        text-align: center !important;
        width: 100%;
        display: block;
        font-size: 1.5rem;
    }

    /* 🔹 Botón de Procesar también centrado */
    .cart-summary .btn-small.primary {
        margin: 0 auto !important;
        display: block;
    }
}

/* === 📱 MOBILE ≤600px === */
@media (max-width: 600px) {

    .titulo-seccion {
        font-size: 3.5rem;
        margin-top: 3rem;
    }

    .cart-layout {
        padding: 0 1.5rem;
        flex-direction: column;
        gap: 1.2rem;
    }

    .cart-item {
        flex-direction: row;
        padding: 1.6rem !important;
        border-radius: 14px;
        min-height: 150px;
        align-items: left;
        gap: 0.9rem !important;
    }

    .cart-item img.cart-thumb {
        width: 115px;
        height: 115px;
        border-radius: 8px;
    }

    .cart-item-info{
        flex: 1;
    }
    .cart-item-info h4 {
        font-size: 1rem;
    }

    .cart-item-info .meta {
        font-size: 0.85rem;
    }

    .cart-item-info .qty button {
        padding: 5px 9px;
        font-size: 0.9rem;
    }

    .subtotal {
        font-size: 1rem;
    }

    /* Resumen */
    .cart-summary {
        width: 100%;
        margin: 0 auto;
        margin-bottom: 3rem;
        padding: 1.4rem 1.2rem !important;
        border-radius: 10px;
        position: static !important;
        gap: 1rem !important;
    }

    .cart-summary p {
        font-size: 1rem;
    }

    .cart-summary strong {
        font-size: 1.2rem;
    }

    /* Botones */
    .cart-actions {
        flex-direction: column;
        gap: 0.8rem;
    }

    .cart-actions .btn-small {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .btn-small.whatsapp {
        font-size: 1rem;
        padding: 1rem;
    }
}
