
/* ===== FONDO DE PÁGINA ===== */
html, body {
    overflow-x: hidden;
}

body {
    background: linear-gradient(160deg, #eef2f7 0%, #e4ecf5 100%);
    min-height: 100vh;
}

/* ===== LAYOUT PRINCIPAL (dos columnas) ===== */
.carritoPageWrapper {
    display: flex;
    gap: 20px;
    width: 94%;
    max-width: 1500px;
    margin: 110px auto 50px;
    align-items: flex-start;
    padding: 20px 0;
}

/* ===== COLUMNA PRODUCTOS (izquierda) ===== */
.carritoColumnaProductos {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== TARJETA UNIFICADA PRODUCTOS ===== */
.carritoCardProductos {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(1, 75, 160, 0.09);
    overflow: hidden;
}

/* ===== HEADER ===== */
.carritoHeader {
    background: linear-gradient(135deg, #013a7a 0%, #0266d6 100%);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.carritoHeaderLeft {
    display: flex;
    align-items: center;
    gap: 12px;
}

.carritoHeaderIcon {
    color: white;
    font-size: 1.4rem;
}

.carritoHeaderTitulo {
    color: white;
    font-family: "Principal";
    font-size: 1.3rem;
    margin: 0;
}

.carritoHeaderCount {
    background: rgba(255, 255, 255, 0.22);
    color: white;
    font-family: "Principal";
    font-size: 0.85rem;
    padding: 4px 14px;
    border-radius: 20px;
}

/* ===== TABLA ===== */
.divMenuTablaCarrito {
    overflow-y: auto;
    max-height: 520px;
    padding: 0 8px;
}

.tableMenuCarrito {
    width: 100%;
    border-collapse: collapse;
}

.tableMenuCarrito thead th {
    font-family: "Principal";
    font-size: 0.85rem;
    text-align: center !important;
    color: #7a8799;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 12px !important;
    border-bottom: 2px solid #eef2f7;
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1;
}

.tableMenuCarrito tbody tr {
    border-bottom: 1px solid #f0f4f8;
    transition: background 0.15s;
}

.tableMenuCarrito tbody tr:hover {
    background: #f5f8ff;
}

.tableMenuCarrito tbody td {
    font-family: "Principal";
    font-size: 1rem;
    text-align: center;
    padding: 14px 10px;
    vertical-align: middle;
    color: #2d3748;
}

.tableMenuCarrito tbody img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #e8eef5;
    padding: 4px;
    background: #fff;
}

.precioCarrito {
    color: #dc2626 !important;
    font-weight: 700;
    font-size: 1.05rem !important;
}

/* ===== BOTÓN ELIMINAR ===== */
.borrar-menuProducto {
    background-color: #fee2e2;
    border-radius: 8px;
    padding: 7px 13px;
    text-decoration: none;
    color: #dc2626;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
    display: inline-block;
}

.borrar-menuProducto:hover {
    background-color: #dc2626;
    color: white;
}

/* ===== ESTADO VACÍO ===== */
.carritoVacio {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: #aab4c4;
}

.carritoVacioIcon {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
    color: #c8d6e8;
}

.carritoVacioTexto {
    font-family: "Principal";
    font-size: 1.3rem;
    margin-bottom: 24px;
}

.carritoVacioBtn {
    background: linear-gradient(135deg, #013a7a 0%, #0266d6 100%);
    color: white;
    padding: 10px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-family: "Principal";
    font-size: 1rem;
    transition: opacity 0.2s;
}

.carritoVacioBtn:hover {
    opacity: 0.85;
    color: white;
}

/* ===== COLUMNA RESUMEN (derecha) ===== */
.carritoColumnaSummary {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
}

.carritoCardResumen {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(1, 75, 160, 0.09);
    overflow: hidden;
}

.resumenHeader {
    background: linear-gradient(135deg, #013a7a 0%, #0266d6 100%);
    color: white;
    font-family: "Principal";
    font-size: 1rem;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resumenBody {
    padding: 20px;
    border-bottom: 1px solid #eef2f7;
}

.resumenFila {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resumenLabel {
    font-family: "Principal";
    color: #6b7280;
    font-size: 0.95rem;
}

.totalPrecioMenuCarrito {
    font-family: "Principal";
    font-size: 1.4rem;
    color: #dc2626;
    font-weight: 700;
    margin: 0;
}

.resumenBotones {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== BOTONES ===== */
.btnMenuCarrito {
    width: 100%;
    font-size: 0.95rem;
    text-align: center;
    font-family: "Principal";
    border-radius: 10px;
    padding: 12px 0;
    text-decoration: none;
    transition: opacity 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btnFinalizar {
    background: linear-gradient(135deg, #013a7a 0%, #0266d6 100%);
    color: #fff;
}

.btnFinalizar:hover {
    opacity: 0.88;
    color: #fff;
}

.btnVaciar {
    background: #f3f4f6;
    color: #374151;
}

.btnVaciar:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ===== MODAL PEDIDO CONFIRMADO ===== */
.divPedido {
    width: 360px !important;
    max-width: 92vw !important;
    height: auto !important;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) scale(0) !important;
    transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    z-index: 1060;
}

.divPedido.active-divPedidoo {
    transform: translate(-50%, -50%) scale(1) !important;
}

.textPedido {
    font-family: "Principal";
    text-align: center;
    background: linear-gradient(135deg, #013a7a 0%, #0266d6 100%);
    padding: 16px 20px;
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
}

.numeroPedido {
    margin-top: 20px;
    font-family: "Principal";
    text-align: center;
    color: #dc2626;
    font-size: 1.4rem;
}

.textAgente {
    margin: 16px 20px 24px;
    font-family: "Principal";
    text-align: center;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.icon-closePedido {
    position: absolute;
    right: 14px;
    top: 14px;
}

/* ===== RESPONSIVE PEDIDO ===== */
@media (max-width: 400px) {
    .textPedido {
        font-size: 0.95rem;
        padding: 14px 16px;
    }

    .numeroPedido {
        font-size: 1.2rem;
    }

    .textAgente {
        font-size: 0.88rem;
        margin: 12px 14px 18px;
    }
}

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

/* Tablet landscape: summary un poco más angosta */
@media (max-width: 900px) {
    .carritoColumnaSummary {
        width: 240px;
    }
}

/* Tablet portrait / móvil landscape: columnas apiladas */
@media (max-width: 768px) {
    .carritoPageWrapper {
        flex-direction: column;
        align-items: stretch;
        width: 94%;
        margin-top: 110px;
        margin-left: auto;
        margin-right: auto;
        gap: 16px;
    }

    .carritoColumnaSummary {
        width: 100%;
        position: static;
    }

}

/* Móvil: tabla compacta, oculta columna imagen */
@media (max-width: 550px) {
    .carritoPageWrapper {
        width: 94%;
        margin-top: 110px;
        margin-left: auto;
        margin-right: auto;
        padding: 10px 0;
        gap: 14px;
    }

    .carritoHeader {
        padding: 14px 16px;
    }

    .carritoHeaderTitulo {
        font-size: 1.05rem;
    }

    .carritoHeaderCount {
        font-size: 0.78rem;
        padding: 3px 10px;
    }

    /* Ocultar columna imagen */
    .tableMenuCarrito thead th:first-child,
    .tableMenuCarrito tbody td:first-child {
        display: none;
    }

    .tableMenuCarrito thead th {
        font-size: 0.78rem !important;
        padding: 10px 6px !important;
    }

    .tableMenuCarrito tbody td {
        font-size: 0.85rem;
        padding: 10px 6px;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Nombre: alinear a la izquierda */
    .tableMenuCarrito tbody td:nth-child(2) {
        text-align: left;
    }

    .borrar-menuProducto {
        padding: 6px 10px;
        font-size: 0.82rem;
    }

    .totalPrecioMenuCarrito {
        font-size: 1.15rem;
    }

    .resumenBody {
        padding: 14px 16px;
    }

    .resumenBotones {
        padding: 12px 16px;
        gap: 8px;
    }

    .btnMenuCarrito {
        font-size: 0.9rem;
        padding: 11px 0;
    }
}

/* Móvil muy pequeño */
@media (max-width: 380px) {
    .carritoPageWrapper {
        width: 96%;
        margin-left: auto;
        margin-right: auto;
    }

    .carritoHeaderTitulo {
        font-size: 0.95rem;
    }

    .tableMenuCarrito thead th {
        font-size: 0.72rem !important;
        padding: 8px 4px !important;
    }

    .tableMenuCarrito tbody td {
        font-size: 0.78rem;
        padding: 8px 4px;
    }
}


/* ===== TOAST BIENVENIDA ===== */
@keyframes toastEntrar {
    0%   { opacity: 0; transform: translateX(110%) scale(0.92); }
    60%  { opacity: 1; transform: translateX(-6px) scale(1.01); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastSalir {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(110%) scale(0.92); }
}

@keyframes toastBarra {
    from { width: 100%; }
    to   { width: 0%; }
}

.toast-bienvenida {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 36px rgba(1, 75, 160, 0.14), 0 2px 10px rgba(0, 0, 0, 0.07);
    padding: 16px 18px 18px 18px;
    min-width: 270px;
    max-width: 320px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow: hidden;
    animation: toastEntrar 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast-bienvenida.saliendo {
    animation: toastSalir 0.38s ease-in forwards;
}

.toast-icono-wrap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #013a7a 0%, #0266d6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-contenido {
    flex: 1;
    min-width: 0;
}

.toast-titulo {
    font-family: 'menu', sans-serif;
    font-size: 0.7rem;
    color: #0266d6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.toast-mensaje {
    font-size: 0.9rem;
    color: #1a2a3a;
    font-weight: 500;
    line-height: 1.4;
}

.toast-cerrar {
    background: none;
    border: none;
    color: #c4cdd6;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.2s ease;
    margin-top: 2px;
}

.toast-cerrar:hover {
    color: #6a7a8a;
}

.toast-barra {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 0 14px;
    background: linear-gradient(90deg, #013a7a, #0266d6);
    animation: toastBarra 4s linear forwards;
}

.toast-sesion {
    border-left: none;
    border-right: 4px solid #e07b00;
}

.toast-icono-sesion {
    background: linear-gradient(135deg, #b35900 0%, #e07b00 100%);
}

.toast-titulo-sesion {
    color: #e07b00;
}

.toast-barra-sesion {
    background: linear-gradient(90deg, #b35900, #e07b00);
    border-radius: 0 0 14px 0;
}
