/* Carrito.css - Rediseño Premium con Glassmorphism */

#tmCartPage {
    --car-primary: #0f172a;
    --car-accent: #e11d48;
    --car-success: #10b981;
    --car-bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --car-glass: rgba(255, 255, 255, 0.85);
    --car-glass-border: rgba(255, 255, 255, 0.4);
    --car-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.05), 0 10px 15px -5px rgba(0, 0, 0, 0.03);
    
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
}

/* Hero Section Refinada */
#tmCartPage .tmc-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2.5rem;
    border-radius: 24px;
    color: #ffffff;
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.3);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

#tmCartPage .tmc-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

#tmCartPage .tmc-title {
    margin: 0;
    font-weight: 800;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    letter-spacing: -0.03em;
    color: #ffffff !important;
}

#tmCartPage .tmc-sub {
    color: #e2e8f0; /* Blanco azulado muy nítido */
    opacity: 1;
    margin-top: 0.75rem;
    font-size: 1.05rem;
    max-width: 600px;
    line-height: 1.6;
    font-weight: 400;
    border-left: 3px solid var(--car-accent);
    padding-left: 1rem;
}

#tmCartPage .tmc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.25rem;
    border-radius: 100px;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Empty State */
#tmCartPage .tmc-empty {
    text-align: center;
    background: var(--car-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--car-glass-border);
    border-radius: 30px;
    padding: 5rem 2rem;
    box-shadow: var(--car-shadow);
    margin: 2rem 0;
}

#tmCartPage .tmc-empty i {
    font-size: 5rem;
    background: linear-gradient(135deg, #0f172a, #334155);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

#tmCartPage .tmc-empty h2 {
    font-weight: 800;
    font-size: 2rem;
    color: #0f172a;
}

/* Toolbar de Acciones */
#tmCartPage .tmc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    border: 1px solid #f1f5f9;
}

#tmCartPage .tmc-checkall {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #475569;
}

#tmCartPage .tmc-chip {
    background: #0f172a;
    color: #fff;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    margin-left: 8px;
}

/* Cards de Grupos por Negocio */
#tmCartPage .tmc-subcard {
    background: var(--car-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--car-glass-border) !important;
    border-left: 6px solid var(--car-primary) !important; /* Marca el inicio de forma notoria */
    border-radius: 24px !important;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
    margin-bottom: 3rem !important; /* Más espacio al final */
}

#tmCartPage .tmc-subcard .card-header {
    background: rgba(15, 23, 42, 0.03) !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem 1.5rem;
}

#tmCartPage .tmc-subcard .card-header .fw-bold {
    font-size: 1.1rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tabla de Productos */
#tmCartPage .tmc-table-scroll {
    border-radius: 0;
    border: none;
}

#tmCartPage .tmc-table {
    margin-bottom: 0;
}

#tmCartPage .tmc-table thead {
    background: transparent !important;
}

#tmCartPage .tmc-table thead th {
    background: #f8fafc;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #f1f5f9;
}

#tmCartPage .tmc-table tbody td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

#tmCartPage .tmc-table tbody tr:last-child td {
    border-bottom: none;
}

#tmCartPage .tmc-table tbody tr:hover {
    background: rgba(15, 23, 42, 0.01);
}

#tmCartPage .tmc-table tbody tr.table-active {
    background: rgba(15, 23, 42, 0.04) !important;
}

/* Detalles del Producto en Fila */
#tmCartPage .tmc-badge-soft {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

#tmCartPage .tmc-desc-title {
    font-weight: 700;
    color: #0f172a;
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

#tmCartPage .tmc-oferta-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: #fff1f2 !important;
    color: #e11d48 !important;
    padding: 4px 10px !important;
    border-radius: 100px !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    box-shadow: none !important;
}

/* Controles de Cantidad */
#tmCartPage .tmc-qty-group {
    display: inline-flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 100px;
    padding: 4px;
    border: 1px solid #e2e8f0;
}

#tmCartPage .tmc-qty-group .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: white;
    color: #0f172a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

#tmCartPage .tmc-qty-group .btn:hover {
    background: #0f172a;
    color: white;
    transform: scale(1.1);
}

#tmCartPage .tmc-qty-input {
    width: 50px !important;
    border: none !important;
    background: transparent !important;
    font-weight: 800;
    font-size: 1rem;
    text-align: center;
    color: #0f172a;
    padding: 0 !important;
}

/* Remover flechas del input number */
#tmCartPage .tmc-qty-input::-webkit-inner-spin-button,
#tmCartPage .tmc-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Footers y Totales */
#tmCartPage .tmc-group-total-row {
    background: rgba(15, 23, 42, 0.05) !important;
}

#tmCartPage .tmc-table tfoot th {
    padding: 1.5rem;
    font-weight: 800;
    font-size: 1.1rem;
    border-top: 2px solid #e2e8f0;
}

#tmCartPage .tmc-total-amount {
    color: var(--car-primary);
    font-size: 1.3rem !important;
    font-weight: 900 !important;
}

#tmCartPage .tmc-subcard .card-footer {
    background: white !important;
    padding: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

/* Gran Total Final */
#tmCartPage .tmc-grand-total-card {
    background: #0f172a;
    color: white;
    padding: 2.5rem;
    border-radius: 24px;
    text-align: right;
    margin-top: 3rem;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.3);
}

#tmCartPage .tmc-grand-total-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #94a3b8; /* Gris azulado claro de alto contraste */
    font-weight: 700;
    display: block;
    margin-bottom: 0.75rem;
}

#tmCartPage .tmc-grand-total-value {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    display: block;
    color: #ffffff !important;
}

#tmCartPage .tmc-grand-total-card p {
    margin-top: 1.5rem;
    margin-bottom: 0;
    opacity: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8; /* Gris claro de alto contraste */
}

/* Botones Premium */
.btn-premium-danger {
    background: #fff1f2;
    color: #e11d48;
    border: none;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.2s;
}

.btn-premium-danger:hover:not(:disabled) {
    background: #e11d48;
    color: white;
}

.btn-premium-success {
    background: #10b981;
    color: white;
    border: none;
    font-weight: 800;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-premium-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.3);
    background: #059669;
}

/* Responsive - Rediseño Total para móviles (Cards limpios) */
@media (max-width: 991px) {
    #tmCartPage .tmc-hero {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    #tmCartPage .tmc-hero-right { order: -1; }
    #tmCartPage .tmc-table thead { display: none; }

    /* Convertir filas en tarjetas */
    #tmCartPage .tmc-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 1.5rem;
        position: relative;
        gap: 0.75rem;
        border-bottom: 8px solid #f1f5f9;
        background: #fff;
    }

    #tmCartPage .tmc-table tbody td {
        display: block;
        padding: 0;
        border: none;
        width: 100% !important;
        text-align: left !important;
    }

    #tmCartPage .tmc-table tbody td.tmc-col-check {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        width: auto !important;
        z-index: 5;
    }

    #tmCartPage .tmc-badge-soft {
        display: inline-block;
        margin-bottom: 0.25rem;
    }

    #tmCartPage .tmc-desc-title {
        font-size: 1.05rem;
        line-height: 1.4;
        padding-right: 40px; 
        margin-bottom: 0.5rem;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    #tmCartPage .tmc-table tbody td:nth-child(4)::before {
        content: "Precio unitario: ";
        color: #94a3b8;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        margin-right: 5px;
    }

    #tmCartPage .tmc-qty-group {
        justify-content: center;
        width: 100%;
        margin: 0.75rem 0;
        background: #f1f5f9;
        padding: 6px;
    }

    #tmCartPage .tmc-table tbody td:nth-child(6) {
        text-align: center !important;
        font-size: 1.2rem;
        padding: 0.75rem;
        background: #f8fafc;
        border-radius: 12px;
        color: var(--car-primary);
        font-weight: 800;
        border: 1px dashed #e2e8f0;
    }

    #tmCartPage .tmc-table tbody td:nth-child(6)::before {
        content: "SUBTOTAL LÍNEA: ";
        display: block;
        font-size: 0.7rem;
        color: #64748b;
        letter-spacing: 0.05em;
        margin-bottom: 4px;
    }

    #tmCartPage .tmc-col-x {
        position: absolute;
        bottom: 1.5rem;
        right: 1.5rem;
        width: auto !important;
    }

    #tmCartPage .tmc-table tfoot tr {
        display: block;
        background: #f8fafc;
        border-top: 1px solid #e2e8f0;
    }

    #tmCartPage .tmc-table tfoot th {
        display: block;
        width: 100% !important;
        text-align: center !important;
        padding: 1.5rem;
    }

    #tmCartPage .tmc-grand-total-value {
        font-size: 2.25rem;
    }
}