*{

box-sizing:border-box;

}



body{

margin:0;

background:#fffaf5;

font-family:Arial, sans-serif;

}



/* VOLVER */

.volver-carrito-header {
    position: absolute;
    top: 50%;
    left: 25px;

    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #e71968;
    color: white;

    font-size: 19px;
    text-decoration: none;

    box-shadow: 0 4px 10px rgba(231, 25, 104, 0.25);

    transform: translateY(-50%);

    transition:
        background-color 0.3s,
        color 0.3s,
        transform 0.3s;
}

.volver-carrito-header:hover {
    background: #ffd83d;
    color: #111;
    transform: translateY(-50%) scale(1.08);
}

.btn-seguir-comprando {
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: #e71968;
    color: white;
    border-radius: 25px;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(231, 25, 104, 0.2);
    transition:
        background-color 0.3s,
        color 0.3s,
        transform 0.3s;
}



.btn-seguir-comprando:hover {
    background: #ffd83d;
    color: #111;
    transform: translateY(-2px);
}

/* CONTENEDOR */

.carrito-container {
    width: 92%;
    max-width: 1180px;
    margin: 30px auto 60px;
}



/* TITULO */

.titulo-carrito {
    text-align: center;
}

.titulo-carrito h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 32px;
    margin: 0 0 28px;
}

.icono-titulo-carrito {
    width: 45px;
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffd83d;
    color: #222;
    font-size: 22px;
}




/* VACIO */


.carrito-vacio{

background:white;

border:3px solid #ffd83d;

border-radius:30px;

padding:50px;

max-width:550px;

margin:40px auto;

text-align:center;

}



.carrito-vacio h2{

font-size:30px;

}



.btn-explorar-productos {
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px auto 0;
    padding: 14px 30px;
    background: #e71968;
    color: white;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s, transform 0.3s;
}

.btn-explorar-productos:hover {
    background: #ffd83d;
    color: #111;
    transform: translateY(-2px);
}





/* PRODUCTOS Y RESUMEN */

.carrito-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    align-items: start;
}

.lista-productos-carrito {
    min-width: 0;
    background: white;
    border: 2px solid #ffd83d;
    border-radius: 20px;
    padding: 22px;
}

.encabezado-productos {
    margin: 0;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
    font-size: 20px;
    color: #222;
}

.producto-carrito {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 0;
    border-bottom: 1px solid #eee;
}

.producto-carrito:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.producto-carrito img {
    width: 110px;
    height: 135px;
    flex-shrink: 0;
    object-fit: contain;
    background: #fffaf5;
    border-radius: 12px;
}

.info-carrito {
    flex: 1;
    min-width: 0;
}

.info-carrito h3 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.info-carrito p {
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.5;
}

.total-carrito {
    min-width: 0;
    background: white;
    border: 2px solid #ffd83d;
    border-radius: 20px;
    padding: 24px;
    text-align: left;
}

.titulo-resumen {
    margin: 0 0 22px;
    font-size: 22px;
    color: #222;
}

.resumen-compra p {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 16px 0;
    font-size: 14px;
    color: #555;
}

.resumen-compra p strong {
    flex-shrink: 0;
    color: #222;
}

.resumen-compra hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.resumen-compra h2 {
    margin: 0 0 22px;
    font-size: 23px;
    line-height: 1.4;
    color: #222;
}

.total-carrito form {
    margin: 0;
}

.total-carrito .btn-comprar {
    width: 100%;
    border: none;
    background: #e71968;
    color: white;
    padding: 14px 20px;
    border-radius: 25px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    transition:
        background-color 0.2s,
        color 0.2s,
        transform 0.2s;
}

.total-carrito .btn-comprar:hover {
    background: #ffd83d;
    color: #111;
    transform: translateY(-2px);
}

.total-carrito .btn-comprar:focus-visible {
    outline: 3px solid #222;
    outline-offset: 3px;
}


.info-carrito .variante-carrito {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 8px 0 14px;
    color: #666;
    font-size: 14px;
}

.variante-carrito strong {
    color: #444;
    font-weight: 600;
}

/* DISTRIBUCIÓN INTERNA DEL PRODUCTO */

.info-carrito {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "nombre subtotal"
        "variante subtotal"
        "precio subtotal"
        "acciones acciones";
    column-gap: 16px;
    align-items: start;
}

.info-carrito h3 {
    grid-area: nombre;
    margin: 0 0 6px;
}

.info-carrito .variante-carrito {
    grid-area: variante;
    margin: 0 0 10px;
}

.info-carrito .precio-producto {
    grid-area: precio;
    margin: 0;
    color: #e71968;
    font-size: 18px;
    font-weight: bold;
}

.precio-producto-anterior {
    display: inline-block;
    margin-right: 8px;
    color: #777;
    font-size: 13px;
    font-weight: 500;
    text-decoration: line-through;
}

.precio-producto-actual {
    display: inline-block;
    color: #e71968;
}

.info-carrito .subtotal-producto {
    grid-area: subtotal;
    margin: 0;
    text-align: right;
    color: #222;
    font-size: 17px;
    font-weight: bold;
}

.subtotal-producto span {
    display: block;
    margin-bottom: 5px;
    color: #777;
    font-size: 12px;
    font-weight: normal;
}

/* ACCIONES ABAJO A LA DERECHA */

.acciones-producto {
    grid-area: acciones;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
}

.acciones-producto .cantidad-carrito {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.acciones-producto .btn-cantidad {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    background: #fffaf5;
    color: #222;
    font-family: inherit;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.acciones-producto .btn-cantidad:hover {
    background: #ffd83d;
    border-color: #ffd83d;
}

.acciones-producto .cantidad-numero {
    min-width: 24px;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
}

.acciones-producto .btn-eliminar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #e71968;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.acciones-producto .btn-eliminar:hover {
    background: #fff0f5;
}

.acciones-producto button:focus-visible {
    outline: 2px solid #e71968;
    outline-offset: 3px;
}

.acciones-producto button:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* TALLA Y COLOR CON FONDO AMARILLO SUAVE */

.info-carrito .variante-carrito {
    width: fit-content;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 20px;
    background: #fff5dd;
    color: #333;
    font-size: 14px;
}

.variante-carrito strong {
    color: #222;
}

/* PRECIOS MÁS VISIBLES */

.info-carrito .precio-producto {
    font-size: 21px;
}

.info-carrito .subtotal-producto {
    font-size: 20px;
}

.subtotal-producto span {
    font-size: 13px;
}

/* CONTADOR CON BORDE AMARILLO */

.acciones-producto .cantidad-carrito {
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid #ffd83d;
    border-radius: 30px;
    background: white;
}

.acciones-producto .cantidad-carrito::before {
    content: "Cantidad";
    margin: 0 6px;
    color: #222;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
}

.acciones-producto .btn-cantidad {
    width: 36px;
    height: 36px;
    border: 1px solid #ffd83d;
    background: white;
    font-size: 21px;
}

.acciones-producto .btn-cantidad:hover {
    background: #ffd83d;
}

/* PAPELERA CIRCULAR */

.acciones-producto .btn-eliminar {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid #ffd83d;
    border-radius: 50%;
    background: white;
    color: #222;
    font-size: 19px;
}

.acciones-producto .btn-eliminar:hover {
    background: #e71968;
    border-color: #e71968;
    color: white;
}

/* Oculta el texto visualmente y conserva
   el nombre del botón para lectores de pantalla. */

.acciones-producto .btn-eliminar span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}


.seleccionar-todos {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}

#seleccionar-todos,
.seleccionar-producto {
    width: 22px;
    height: 22px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #e71968;
    cursor: pointer;
}

#seleccionar-todos:focus-visible,
.seleccionar-producto:focus-visible {
    outline: 2px solid #e71968;
    outline-offset: 4px;
}

@media (max-width: 600px) {
    .seleccionar-todos {
        font-size: 17px;
    }

    .producto-carrito {
        gap: 10px;
    }
}



/* AJUSTES EN CELULAR */

@media (max-width: 600px) {
    .acciones-producto .cantidad-carrito::before {
        content: none;
    }

    .info-carrito .precio-producto {
        font-size: 18px;
    }

    .info-carrito .subtotal-producto {
        font-size: 16px;
    }
}

/* ENLACES AL PRODUCTO */

.enlace-imagen-carrito {
    display: block;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
}

.enlace-imagen-carrito img {
    display: block;
    transition: opacity 0.2s;
}

.enlace-imagen-carrito:hover img {
    opacity: 0.85;
}

.enlace-nombre-carrito {
    color: inherit;
    font: inherit;
    text-decoration: none;
}

.enlace-nombre-carrito:hover {
    color: #e71968;
    text-decoration: none;
}


.enlace-imagen-carrito:focus-visible,
.enlace-nombre-carrito:focus-visible {
    outline: 2px solid #e71968;
    outline-offset: 3px;
}

/* CORAZÓN SIN FUNCIÓN POR AHORA */

/* BOTÓN DE FAVORITOS DEL CARRITO */

.acciones-producto .btn-favorito-carrito {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #e71968;
    font-size: 21px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.13);
    transition:
        background-color 0.2s,
        color 0.2s,
        transform 0.2s;
}

.acciones-producto .btn-favorito-carrito:hover {
    background: #e71968;
    color: #ffffff;
    transform: translateY(-1px);
}

.acciones-producto .btn-favorito-carrito.es-favorito {
    background: #ffffff;
    color: #e71968;
}

.acciones-producto .btn-favorito-carrito.es-favorito:hover {
    background: #ffffff;
    color: #c91458;
}

/* COMPRAR SIN ARTÍCULOS SELECCIONADOS */

.total-carrito .btn-comprar:disabled {
    background: #e5e5e5;
    color: #777;
    cursor: not-allowed;
    transform: none;
}

/* ACOMODO EN CELULARES */

@media (max-width: 600px) {
    .info-carrito {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "nombre"
            "variante"
            "precio"
            "subtotal"
            "acciones";
    }

    .info-carrito .subtotal-producto {
        margin-top: 10px;
        text-align: left;
        font-size: 15px;
    }

    .subtotal-producto span {
        display: inline;
        margin-right: 5px;
    }

    .acciones-producto {
        justify-content: flex-start;
        gap: 10px;
        margin-top: 14px;
    }
}


@media (max-width: 900px) {
    .carrito-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .lista-productos-carrito,
    .total-carrito {
        padding: 16px;
    }

    .producto-carrito {
        gap: 12px;
    }

    .producto-carrito img {
        width: 85px;
        height: 110px;
    }

    .info-carrito h3 {
        font-size: 16px;
    }
}

/* ==========================================
   MODAL COMPRA REALIZADA
========================================== */

.modal-compra {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.55);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;

    animation: aparecerFondo 0.3s ease;
}


/* CAJA */

.compra-contenido {
    background: white;

    width: 90%;
    max-width: 400px;

    padding: 35px;

    border-radius: 20px;

    text-align: center;

    animation: aparecerCompra 0.5s ease;
}


/* CHECK */

.check-compra {
    width: 85px;
    height: 85px;

    margin: 0 auto 20px;

    border-radius: 50%;

    background: #28a745;
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 50px;
    font-weight: bold;

    animation: checkAnimacion 0.6s ease;
}


.compra-contenido h2 {
    margin-bottom: 10px;
}


.compra-contenido p {
    color: #666;
    margin-bottom: 25px;
}


.compra-contenido button {
    border: none;

    background: #ffed00;

    padding: 12px 30px;

    border-radius: 8px;

    font-weight: bold;

    cursor: pointer;
}


.compra-contenido button:hover {
    background: #f78fb3;
}

/* ==========================================
   CONTROL DE CANTIDAD
========================================== */

.cantidad-carrito {
    display: flex;
    align-items: center;
    gap: 12px;

    margin: 12px 0;
}




/* NÚMERO */

.cantidad-numero {
    min-width: 25px;

    text-align: center;

    font-size: 17px;

    font-weight: bold;
}



/* ==========================================
   ANIMACIONES
========================================== */

@keyframes aparecerFondo {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


@keyframes aparecerCompra {

    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


@keyframes checkAnimacion {

    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}


.cerrando {
    animation: cerrarModal 0.3s forwards;
}


@keyframes cerrarModal {

    to {
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .header-top:has(.volver-carrito-header) {
    padding-left: 65px;
}

    .volver-carrito-header {
        left: 10px;
        width: 38px;
        height: 38px;
        font-size: 17px;
    }
}




/* ==================================================
   CARRITO RUBAN — AJUSTES EXCLUSIVOS PARA CELULAR
================================================== */
@media (max-width: 600px) {
    :root {
        --ruban-fucsia: #ef0c6f;
        --ruban-borde: #e8ebf0;
        --ruban-crema: #fff7e9;
    }

    body {
        background: #fffdfb;
    }

    .carrito-container {
        width: calc(100% - 22px);
        margin: 18px auto 48px;
    }

    .titulo-carrito h1 {
        justify-content: center;
        gap: 9px;
        margin-bottom: 18px;
        font-size: 25px;
    }

    .icono-titulo-carrito {
        width: 35px;
        height: 35px;
        font-size: 15px;
    }

    .lista-productos-carrito {
        overflow: visible;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .encabezado-productos {
        display: flex;
        align-items: center;
        min-height: 60px;
        padding: 13px 14px;
        border: 1px solid #f3e8c9;
        border-radius: 14px;
        background: linear-gradient(100deg, #fff8e8, #fffdf8);
        font-size: 16px;
    }

    .seleccionar-todos {
        gap: 10px;
        font-size: inherit;
    }

    #seleccionar-todos,
    .seleccionar-producto {
        width: 18px;
        height: 18px;
        accent-color: var(--ruban-fucsia);
    }

    .producto-carrito {
        align-items: flex-start;
        gap: 10px;
        margin: 13px 0;
        padding: 12px 10px;
        border: 1px solid var(--ruban-borde);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 3px 11px rgba(15, 23, 42, .035);
    }

    .producto-carrito:last-child {
        padding-bottom: 12px;
        border-bottom: 1px solid var(--ruban-borde);
    }

    .producto-carrito img {
        width: 88px;
        height: 120px;
        border-radius: 11px;
        background: #fff8f2;
        object-fit: cover;
    }

    .producto-carrito > .seleccionar-producto {
        margin-top: 4px;
    }

    .info-carrito {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "nombre"
            "variante"
            "precio"
            "subtotal"
            "acciones";
        row-gap: 4px;
    }

    .info-carrito h3 {
        padding-right: 2px;
        margin-bottom: 1px;
        font-size: 14px;
        line-height: 1.27;
    }

    .info-carrito .variante-carrito {
        gap: 4px;
        margin-bottom: 1px;
        padding: 0;
        background: transparent;
        font-size: 11px;
    }

    .variante-carrito span:not([aria-hidden="true"]) {
        padding: 5px 7px;
        border-radius: 999px;
        background: var(--ruban-crema);
        white-space: nowrap;
    }

    .variante-carrito span[aria-hidden="true"] {
        display: none;
    }

    .info-carrito .precio-producto {
        margin-top: 2px;
        font-size: 17px;
    }

    .precio-producto-anterior {
        margin-right: 4px;
        font-size: 10px;
    }

    .info-carrito .subtotal-producto {
        margin-top: 7px;
        padding: 0;
        font-size: 13px;
        text-align: left;
    }

    .subtotal-producto span {
        font-size: 11px;
    }

    .acciones-producto {
        justify-content: flex-start;
        gap: 7px;
        margin-top: 8px;
    }

    .acciones-producto .cantidad-carrito {
        gap: 7px;
        padding: 3px 5px;
        border: 1px solid #ffc928;
        border-radius: 999px;
    }

    .acciones-producto .cantidad-carrito::before {
        content: none;
    }

    .acciones-producto .btn-cantidad {
        width: 27px;
        height: 27px;
        border-color: #ffc928;
        font-size: 17px;
    }

    .acciones-producto .cantidad-numero {
        min-width: 17px;
        font-size: 13px;
    }

    .acciones-producto .btn-favorito-carrito,
    .acciones-producto .btn-eliminar {
        width: 31px;
        height: 31px;
        border: 1px solid var(--ruban-borde);
        background: #fff;
        box-shadow: 0 2px 7px rgba(15, 23, 42, .05);
        font-size: 13px;
    }

    .acciones-producto .btn-favorito-carrito {
        color: var(--ruban-fucsia);
    }

    .acciones-producto .btn-eliminar {
        color: #1f2937;
    }

    .total-carrito {
        margin-top: 20px;
        padding: 19px 16px;
        border: 1px solid var(--ruban-borde);
        border-radius: 18px;
        box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
    }

    .titulo-resumen {
        margin-bottom: 17px;
        font-size: 20px;
    }

    .resumen-compra p {
        margin: 11px 0;
        font-size: 13px;
    }

    .resumen-compra h2 {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 17px;
        font-size: 21px;
    }

    .total-carrito .btn-comprar {
        padding: 14px;
        border-radius: 999px;
        background: linear-gradient(105deg, #f70b70, #e60062);
        box-shadow: 0 8px 18px rgba(231, 25, 104, .22);
        font-size: 16px;
    }

    .total-carrito .btn-comprar:hover {
        background: linear-gradient(105deg, #d90862, #b90551);
        color: #fff;
    }

/* ==========================================
   RESUMEN FIJO EN CELULAR
========================================== */

.total-carrito {
    position: fixed;
    left: 50%;
    bottom: 58px;
    transform: translateX(-50%);

    width: calc(100% - 22px);
    max-width: 500px;

    margin: 0;

    z-index: 900;

    background: #ffffff;
}

/* Deja espacio para que los últimos productos
   no queden escondidos detrás del resumen */
.carrito-container {
    padding-bottom: 230px;
}

/* El footer no se muestra en carrito desde celular */
footer {
    display: none !important;
}
}

/* Selector de orden alineado como en Favoritos, solo en celular. */
@media (max-width: 700px) {
    .carrito-container .contenedor-ordenar {
        justify-content: flex-start;
        gap: 8px;
        width: calc(100% - 12px);
        margin: 16px 0 18px 12px;
    }

    .carrito-container .contenedor-ordenar label {
        flex: 0 0 auto;
        font-size: 12px;
    }

    .carrito-container .contenedor-ordenar select {
        min-width: 0;
        width: 128px;
        padding: 8px 22px 8px 10px;
        font-size: 11px;
    }

    .carrito-container .contenedor-ordenar select option {
        font-size: 11px;
    }
}

