/* =========================
   CARRITO
========================= */

.carrito-contenido {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(280px, 0.8fr);

    gap: 30px;

    align-items: start;
}


/* =========================
   LISTA DE PRODUCTOS
========================= */

.carrito-productos {
    display: flex;
    flex-direction: column;

    gap: 18px;
}


/* =========================
   PRODUCTO
========================= */

.carrito-producto {
    display: grid;

    grid-template-columns:
        100px
        minmax(180px, 1fr)
        110px
        120px;

    gap: 20px;

    align-items: center;

    padding: 18px;

    border: 1px solid #e1e5e8;
    border-radius: 14px;

    background-color: #ffffff;

    box-shadow:
        0 5px 15px
        rgba(0, 0, 0, 0.05);
}


/* =========================
   IMAGEN
========================= */

.carrito-producto-imagen {
    width: 100px;
    height: 100px;

    overflow: hidden;

    border-radius: 10px;

    background-color: #e8ebee;
}

.carrito-producto-imagen img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.carrito-producto-imagen div {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #6b7785;

    font-size: 0.8rem;

    text-align: center;
}


/* =========================
   INFORMACIÓN
========================= */

.carrito-producto-info h2 {
    margin: 0 0 8px;

    color: #283545;

    font-size: 1.1rem;

    line-height: 1.35;
}

.carrito-producto-info p {
    margin: 0 0 7px;

    color: #6b7785;

    font-size: 0.9rem;
}

.carrito-producto-precio {
    color: #283545 !important;

    font-size: 1rem !important;
    font-weight: 700;
}


/* =========================
   CANTIDAD
========================= */

.carrito-cantidad {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.carrito-cantidad label {
    color: #6b7785;

    font-size: 0.8rem;
    font-weight: 700;
}

.carrito-cantidad input {
    width: 100%;

    padding: 10px;

    border: 1px solid #d9dfe5;
    border-radius: 8px;

    background-color: #ffffff;
    color: #283545;

    font-family: inherit;
    font-size: 0.95rem;
}

.carrito-cantidad input:focus {
    outline: none;

    border-color: #5b2a78;

    box-shadow:
        0 0 0 3px
        rgba(91, 42, 120, 0.15);
}


/* =========================
   SUBTOTAL
========================= */

.carrito-subtotal {
    display: flex;
    flex-direction: column;

    gap: 6px;

    text-align: right;
}

.carrito-subtotal span {
    color: #6b7785;

    font-size: 0.8rem;
}

.carrito-subtotal strong {
    color: #283545;

    font-size: 1rem;
}


/* =========================
   ELIMINAR
========================= */

.carrito-eliminar {
    grid-column: 2 / -1;

    justify-self: end;

    color: #b34a4a;

    font-size: 0.85rem;
    font-weight: 700;

    text-decoration: none;
}

.carrito-eliminar:hover {
    text-decoration: underline;
}


/* =========================
   RESUMEN
========================= */

.carrito-resumen {
    position: sticky;

    top: 20px;

    padding: 24px;

    border: 1px solid #e1e5e8;
    border-radius: 14px;

    background-color: #ffffff;

    box-shadow:
        0 5px 15px
        rgba(0, 0, 0, 0.05);
}

.carrito-resumen h2 {
    margin: 0 0 20px;

    padding-bottom: 12px;

    border-bottom: 3px solid #e5b83f;

    color: #283545;

    font-size: 1.2rem;
}

.carrito-resumen-linea {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 16px 0;

    border-top: 1px solid #e1e5e8;
    border-bottom: 1px solid #e1e5e8;

    color: #6b7785;
}

.carrito-resumen-linea strong {
    color: #283545;

    font-size: 1.2rem;
}




/* =========================
   BOTONES
========================= */

.boton-actualizar-carrito,
.boton-seguir-comprando,
.boton-finalizar-compra {
    width: 100%;

    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 14px;

    padding: 11px 16px;

    border-radius: 8px;

    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;

    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease;
}


/* =========================
   ACTUALIZAR
========================= */

.boton-actualizar-carrito {
    border: none;

    background-color: #5b2a78;
    color: #ffffff;
}

.boton-actualizar-carrito:hover {
    background-color: #48205f;
}


/* =========================
   SEGUIR COMPRANDO
========================= */

.boton-seguir-comprando {
    border: 1px solid #d9dfe5;

    background-color: #ffffff;
    color: #283545;
}

.boton-seguir-comprando:hover {
    border-color: #5b2a78;

    background-color: #f3f4f6;
}


/* =========================
   FINALIZAR COMPRA
========================= */

.boton-finalizar-compra {
    border: none;

    background-color: #5b2a78;
    color: #ffffff;
}

.boton-finalizar-compra:hover {
    background-color: #48205f;
}


/* =========================
   CARRITO VACÍO
========================= */

.carrito-vacio {
    max-width: 600px;

    margin: 0 auto;

    padding: 50px 30px;

    border: 1px dashed #cfd6dd;
    border-radius: 14px;

    background-color: #ffffff;

    text-align: center;
}

.carrito-vacio h2 {
    margin: 0 0 10px;

    color: #283545;
}

.carrito-vacio p {
    margin: 0 0 24px;

    color: #6b7785;
}

.carrito-vacio .boton-seguir-comprando {
    max-width: 240px;

    margin-right: auto;
    margin-left: auto;
}


/* =========================
   MODO OSCURO
========================= */

body.modo-oscuro .carrito-producto,
body.modo-oscuro .carrito-resumen,
body.modo-oscuro .carrito-vacio,
body.modo-oscuro .carrito-cantidad input,
body.modo-oscuro .boton-seguir-comprando {
    background-color: #242424;

    border-color: #393939;
}

body.modo-oscuro .carrito-producto-imagen {
    background-color: #303030;
}

body.modo-oscuro .carrito-producto-info h2,
body.modo-oscuro .carrito-producto-precio,
body.modo-oscuro .carrito-subtotal strong,
body.modo-oscuro .carrito-resumen h2,
body.modo-oscuro .carrito-resumen-linea strong,
body.modo-oscuro .carrito-vacio h2,
body.modo-oscuro .carrito-cantidad input,
body.modo-oscuro .boton-seguir-comprando {
    color: #f5f5f5;
}

body.modo-oscuro .carrito-producto-info p,
body.modo-oscuro .carrito-cantidad label,
body.modo-oscuro .carrito-subtotal span,
body.modo-oscuro .carrito-resumen-linea,
body.modo-oscuro .carrito-vacio p,
body.modo-oscuro .carrito-producto-imagen div {
    color: #c3c8ce;
}

body.modo-oscuro .carrito-resumen-linea {
    border-color: #393939;
}

body.modo-oscuro .boton-seguir-comprando:hover {
    background-color: #303030;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 950px) {

    .carrito-contenido {
        grid-template-columns: 1fr;
    }

    .carrito-resumen {
        position: static;
    }

}


@media (max-width: 700px) {

    .carrito-producto {
        grid-template-columns:
            90px
            minmax(0, 1fr);

        gap: 16px;
    }

    .carrito-producto-imagen {
        width: 90px;
        height: 90px;
    }

    .carrito-cantidad,
    .carrito-subtotal {
        grid-column: 1 / -1;
    }

    .carrito-cantidad {
        max-width: 160px;
    }

    .carrito-subtotal {
        text-align: left;
    }

    .carrito-eliminar {
        grid-column: 1 / -1;

        justify-self: start;
    }

}


@media (max-width: 450px) {

    .carrito-producto {
        grid-template-columns: 1fr;
    }

    .carrito-producto-imagen {
        width: 100%;
        height: 200px;
    }

}

/* =========================================================
   AJUSTE FINAL — CARRITO CENTRADO Y CON FORMATO APOLO
========================================================= */

body > header.header + main {
    padding-top: 128px !important;
}

main > .seccion {
    width: 100%;
    padding: 0 20px 64px;
}

main > .seccion > .contenedor {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.carrito-contenido {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.formulario-carrito {
    width: 100%;
}

.carrito-productos {
    width: 100%;
}

.carrito-resumen {
    top: 110px;
}

.carrito-vacio {
    width: min(100%, 620px);
    min-height: 250px;
    margin: 20px auto 0;
    padding: 58px 40px;
    border: 1px solid var(--borde);
    border-radius: var(--radio-grande);
    background: var(--superficie);
    box-shadow: var(--sombra);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.carrito-vacio h2 {
    margin-bottom: 10px;
    color: var(--texto);
    font-size: 1.55rem;
}

.carrito-vacio p {
    max-width: 460px;
    margin-bottom: 26px;
    color: var(--texto-secundario);
}

.carrito-vacio .boton-seguir-comprando {
    width: min(100%, 250px);
    margin: 0 auto;
}

.boton-seguir-comprando,
.boton-actualizar-carrito,
.boton-finalizar-compra {
    border-radius: 12px;
}

@media (max-width: 950px) {
    main > .seccion {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 700px) {
    body > header.header + main {
        padding-top: 112px !important;
    }

    .carrito-vacio {
        padding: 44px 24px;
    }
}


/* =========================================================
   MODO OSCURO GLOBAL — CARRITO
========================================================= */

body.modo-oscuro {
    background: #151616 !important;
    color: #f2f0f3 !important;
}

body.modo-oscuro .header,
body.modo-oscuro header.header,
body.modo-oscuro .header-contenedor {
    background: #151616 !important;
    color: #f2f0f3 !important;
    border-color: #3b3c3d !important;
}

body.modo-oscuro .header .navegacion a,
body.modo-oscuro .header .logo a,
body.modo-oscuro .header .usuario,
body.modo-oscuro .header a {
    color: #f2f0f3 !important;
}

body.modo-oscuro .header .navegacion a:hover,
body.modo-oscuro .header .navegacion a.activo {
    color: #ffffff !important;
}

body.modo-oscuro main,
body.modo-oscuro .seccion,
body.modo-oscuro .contenedor {
    background-color: transparent !important;
    color: #f2f0f3 !important;
}

body.modo-oscuro .seccion-encabezado h1,
body.modo-oscuro .seccion-encabezado p {
    color: #f2f0f3 !important;
}

body.modo-oscuro .carrito-producto,
body.modo-oscuro .carrito-resumen,
body.modo-oscuro .carrito-vacio,
body.modo-oscuro .carrito-cantidad input,
body.modo-oscuro .boton-seguir-comprando {
    background: #242424 !important;
    color: #f2f0f3 !important;
    border-color: #424344 !important;
}

body.modo-oscuro .carrito-producto-info h2,
body.modo-oscuro .carrito-producto-precio,
body.modo-oscuro .carrito-subtotal strong,
body.modo-oscuro .carrito-resumen h2,
body.modo-oscuro .carrito-resumen-linea strong,
body.modo-oscuro .carrito-vacio h2,
body.modo-oscuro .boton-seguir-comprando {
    color: #f2f0f3 !important;
}

body.modo-oscuro .carrito-producto-info p,
body.modo-oscuro .carrito-cantidad label,
body.modo-oscuro .carrito-subtotal span,
body.modo-oscuro .carrito-resumen-linea,
body.modo-oscuro .carrito-vacio p,
body.modo-oscuro .carrito-producto-imagen div {
    color: #c9c5ca !important;
}

body.modo-oscuro .carrito-resumen-linea {
    border-color: #424344 !important;
}

body.modo-oscuro .footer {
    background: #0f1011 !important;
    color: #f2f0f3 !important;
    border-top-color: #e5b83f !important;
}

body.modo-oscuro .footer h2,
body.modo-oscuro .footer p,
body.modo-oscuro .footer a,
body.modo-oscuro .footer strong {
    color: #f2f0f3 !important;
}

body.modo-oscuro .controles button {
    background: #242424 !important;
    color: #ffffff !important;
    border-color: #e5b83f !important;
}


/* =========================================================
   CORRECCIÓN DEFINITIVA MODO OSCURO CARRITO 2026-09-24
========================================================= */
body.modo-oscuro .pagina-carrito,
body.modo-oscuro .carrito-contenedor,
body.modo-oscuro .carrito-grid,
body.modo-oscuro .carrito-lista,
body.modo-oscuro .carrito-resumen {
    background: transparent !important;
    color: #f2f0f3 !important;
}

body.modo-oscuro .carrito-vacio,
body.modo-oscuro .carrito-producto,
body.modo-oscuro .carrito-resumen,
body.modo-oscuro .carrito-item,
body.modo-oscuro .carrito-card {
    background: #242424 !important;
    color: #f2f0f3 !important;
    border-color: #424344 !important;
}

body.modo-oscuro .carrito-vacio h1,
body.modo-oscuro .carrito-vacio h2,
body.modo-oscuro .carrito-vacio h3,
body.modo-oscuro .carrito-vacio p,
body.modo-oscuro .carrito-producto h2,
body.modo-oscuro .carrito-producto p,
body.modo-oscuro .carrito-resumen h2,
body.modo-oscuro .carrito-resumen p,
body.modo-oscuro .carrito-resumen span,
body.modo-oscuro .carrito-resumen strong {
    color: #f2f0f3 !important;
}

/* APolo: controles de accesibilidad movil - overlay sin alterar el body */
@media screen and (max-width:700px) {
  body { padding-right:0 !important; padding-left:0 !important; }
  .controles, .controles-flotantes, .header-vendedor-controles, .admin-header-controles, .tienda-public-controls, #apolo-controles-moviles {
    position:fixed !important; top:50% !important; right:10px !important; left:auto !important; bottom:auto !important;
    transform:translateY(-50%) !important; width:50px !important; max-width:50px !important; height:auto !important;
    min-height:0 !important; margin:0 !important; padding:6px !important; display:flex !important;
    flex-direction:column !important; align-items:center !important; justify-content:center !important; gap:7px !important;
    box-sizing:border-box !important; z-index:2147483647 !important; overflow:visible !important;
    background:#fff !important; border:2px solid #b99a45 !important; border-radius:28px !important;
    box-shadow:0 4px 18px rgba(0,0,0,.25) !important;
  }
  .controles > button, .controles > .letra-indicador, .controles-flotantes > button, .controles-flotantes > .letra-indicador, .header-vendedor-controles > button, .header-vendedor-controles > .letra-indicador, .admin-header-controles > button, .admin-header-controles > .letra, .tienda-public-controls > button, .tienda-public-controls > .tienda-a, #apolo-controles-moviles > button, #apolo-controles-moviles > .letra-indicador, #apolo-controles-moviles > .letra {
    width:38px !important; height:38px !important; min-width:38px !important; min-height:38px !important;
    flex:0 0 38px !important; margin:0 !important; padding:0 !important; display:flex !important;
    align-items:center !important; justify-content:center !important; border:2px solid #b99a45 !important;
    border-radius:50% !important; background:#fff !important; color:#5b2a78 !important; box-sizing:border-box !important;
  }
  body.modo-oscuro .controles, .controles-flotantes, .header-vendedor-controles, .admin-header-controles, .tienda-public-controls, #apolo-controles-moviles { background:#202020 !important; color:#fff !important; border-color:#b99a45 !important; }
  body.modo-oscuro .controles > button, .controles > .letra-indicador, .controles-flotantes > button, .controles-flotantes > .letra-indicador, .header-vendedor-controles > button, .header-vendedor-controles > .letra-indicador, .admin-header-controles > button, .admin-header-controles > .letra, .tienda-public-controls > button, .tienda-public-controls > .tienda-a, #apolo-controles-moviles > button, #apolo-controles-moviles > .letra-indicador, #apolo-controles-moviles > .letra { background:#202020 !important; color:#fff !important; border-color:#b99a45 !important; }
}



/* APOLO FIX V4: eliminar franja de color diferente en Mi carrito */
body.modo-oscuro main .seccion-encabezado,
body.modo-oscuro main .carrito-encabezado,
body.modo-oscuro main .encabezado-carrito,
body.modo-oscuro main .titulo-seccion { background:#292929 !important; background-image:none !important; }
body.modo-oscuro main, body.modo-oscuro .carrito-contenedor { background:#202020 !important; }
body.modo-oscuro .carrito-vacio,
body.modo-oscuro .carrito-producto,
body.modo-oscuro .carrito-resumen { background:#292929 !important; border-color:#414141 !important; }

