/* --- Contenedor Principal del Carrito --- */
.main-login-container {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.login-box h2 {
    font-size: 1.8rem;
    color: #111;
    margin-bottom: 20px;
}

/* --- Estilos de la Tabla --- */
.tabla-carrito-wrapper {
    width: 100%;
    overflow-x: auto;
}

.login-box table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    text-align: left;
}

.login-box thead tr {
    border-bottom: 2px solid #ffd700;
}

.login-box th {
    padding: 12px;
    color: #111;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-box td {
    padding: 15px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    font-size: 0.95rem;
}

.text-center {
    text-align: center !important;
}

/* Miniatura y Producto */
.td-miniatura img {
    max-height: 60px;
    max-width: 60px;
    object-fit: contain;
    border-radius: 4px;
}

.td-producto strong {
    display: block;
    color: #111;
    font-size: 1rem;
    margin-bottom: 4px;
}

.td-producto small {
    color: #666;
    line-height: 1.4;
    display: block;
}

.td-subtotal {
    font-weight: bold;
    color: #111;
}

/* Control de Cantidad (+ y -) */
.cantidad-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cantidad-control a {
    text-decoration: none;
    color: #111;
    background: #f1f1f1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    transition: background 0.2s;
}

.cantidad-control a:hover {
    background: #ffd700;
}

.cantidad-numero {
    font-weight: bold;
    font-size: 15px;
    min-width: 20px;
    text-align: center;
}

/* Botón Quitar */
.btn-quitar {
    color: #d9534f;
    text-decoration: none;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: bold;
    transition: color 0.2s;
}

.btn-quitar:hover {
    text-decoration: underline;
    color: #b52b27;
}

/* --- Sección de Total y Acciones --- */
.carrito-resumen {
    text-align: right;
    margin-top: 30px;
    border-top: 2px solid #f1f1f1;
    padding-top: 20px;
}

.carrito-resumen p {
    font-size: 15px;
    color: #666;
    margin-bottom: 5px;
}

.carrito-resumen h3 {
    font-size: 2.2rem;
    color: #111;
    margin-bottom: 25px;
}

.carrito-acciones {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.btn-seguir-comprando {
    color: #666;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: color 0.2s;
}

.btn-seguir-comprando:hover {
    color: #111;
}

.btn-finalizar-pedido {
    background: #ffd700;
    color: #111;
    padding: 12px 28px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.2s, transform 0.1s;
}

.btn-finalizar-pedido:hover {
    background: #e6c200;
    transform: translateY(-1px);
}

/* --- Estado Vacío --- */
.carrito-vacio {
    padding: 50px 20px;
    text-align: center;
}

.carrito-vacio p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.btn-ver-catalogo {
    display: inline-block;
    background: #111;
    color: #ffd700;
    padding: 12px 28px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-ver-catalogo:hover {
    background: #222;
}

/* --- Diseño Responsive para Celulares --- */
@media (max-width: 768px) {
    .login-box {
        padding: 20px 15px;
    }

    /* Ocultamos los títulos tradicionales de la tabla en mobile */
    .login-box thead {
        display: none;
    }

    .login-box tr {
        display: block;
        background: #fafafa;
        border: 1px solid #eee;
        border-radius: 8px;
        margin-bottom: 20px;
        padding: 15px;
    }

    .login-box td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right !important;
        border-bottom: 1px solid #eee;
        padding: 10px 0;
    }

    .login-box td:last-child {
        border-bottom: none;
    }

    /* Simulamos etiquetas con attr() o flex items para cada celda */
    .login-box td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #444;
        text-align: left;
        font-size: 13px;
        text-transform: uppercase;
    }

    /* Excepciones para miniatura y producto para que mantengan estructura limpia */
    .login-box td.td-miniatura {
        justify-content: center;
        border-bottom: 1px solid #eee;
        padding-bottom: 12px;
    }
    .login-box td.td-miniatura::before {
        display: none;
    }

    .login-box td.td-producto {
        display: block;
        text-align: left !important;
        padding: 12px 0;
    }
    .login-box td.td-producto::before {
        display: none;
    }

    .carrito-resumen {
        text-align: center;
    }

    .carrito-acciones {
        flex-direction: column-reverse;
        width: 100%;
        gap: 15px;
    }

    .btn-finalizar-pedido, 
    .btn-seguir-comprando {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* =========================================================
   RESUMEN DEL CARRITO
========================================================= */

.carrito-resumen {
    margin-top: 30px;
    margin-left: auto;

    width: 100%;
    max-width: 520px;

    padding: 24px;

    background: #ffffff;

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

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.07);
}


/* =========================================================
   MERCADO PAGO
========================================================= */

.resumen-precio-mp {
    display: flex;
    flex-direction: column;

    gap: 4px;

    padding-bottom: 18px;

    border-bottom: 1px solid #e5e7eb;
}

.resumen-titulo {
    font-size: 13px;
    color: #64748b;
}

.resumen-total-mp {
    font-size: 28px;
    font-weight: 800;

    color: #111827;
}

.resumen-metodo-mp {
    font-size: 12px;
    color: #94a3b8;
}


/* =========================================================
   DESCUENTO
========================================================= */

.resumen-descuento {
    display: flex;
    align-items: center;

    gap: 12px;

    margin: 18px 0;

    padding: 13px 15px;

    background: #f0fdf4;

    border: 1px solid #bbf7d0;

    border-radius: 9px;
}

.resumen-descuento-icono {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

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

    background: #dcfce7;

    border-radius: 50%;

    font-size: 18px;
}

.resumen-descuento-texto {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.resumen-descuento-texto strong {
    color: #15803d;

    font-size: 16px;
    font-weight: 800;
}

.resumen-descuento-texto span {
    color: #166534;

    font-size: 12px;
}


/* =========================================================
   TRANSFERENCIA
========================================================= */

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

    gap: 20px;

    padding: 17px 0;

    border-bottom: 1px solid #e5e7eb;
}

.resumen-transferencia > div {
    display: flex;
    flex-direction: column;

    gap: 4px;
}

.transferencia-label {
    color: #334155;

    font-size: 14px;
    font-weight: 700;
}

.resumen-transferencia small {
    color: #16a34a;

    font-size: 11px;
    font-weight: 600;
}

.resumen-transferencia > strong {
    color: #15803d;

    font-size: 23px;
    font-weight: 800;

    white-space: nowrap;
}


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

.carrito-acciones {
    display: flex;

    gap: 12px;

    margin-top: 22px;
}

.btn-seguir-comprando,
.btn-finalizar-pedido {
    flex: 1;

    min-height: 45px;

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

    border-radius: 8px;

    text-decoration: none;

    font-size: 12px;
    font-weight: 700;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.btn-seguir-comprando {
    color: #475569;

    background: #f8fafc;

    border: 1px solid #cbd5e1;
}

.btn-finalizar-pedido {
    color: #ffffff;

    background: #111827;
}

.btn-seguir-comprando:hover,
.btn-finalizar-pedido:hover {
    transform: translateY(-1px);

    box-shadow:
        0 5px 12px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .carrito-resumen {
        padding: 18px;

        margin-top: 20px;
    }

    .resumen-total-mp {
        font-size: 24px;
    }

    .resumen-transferencia > strong {
        font-size: 20px;
    }

    .carrito-acciones {
        flex-direction: column;
    }

    .btn-seguir-comprando,
    .btn-finalizar-pedido {
        width: 100%;
    }

}