/**
 * RestoPY - Cliente Styles (Vista QR)
 */

:root {
    --cliente-primary: #dc2626;
    --cliente-bg: #fafafa;
}

* {
    font-family: 'Poppins', sans-serif;
}

.cliente-body {
    background: var(--cliente-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header-cliente {
    background: #000000;
    color: #fff;
}

.logo-cliente {
    max-height: 100px;
    width: auto;
}

.brand-cliente {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

/* Navigation */
.nav-cliente {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem 0;
}

.nav-cliente .nav-pills .nav-link {
    color: #6b7280;
    font-weight: 500;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
}

.nav-cliente .nav-pills .nav-link.active {
    background: var(--cliente-primary);
    color: #fff;
}

/* Main */
.main-cliente {
    flex: 1;
}

/* Estado del Pedido */
.estado-pedido-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.estado-icono {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2.5rem;
}

.estado-icono.pendiente {
    background: #fef3c7;
    color: #f59e0b;
}

.estado-icono.en_cocina,
.estado-icono.preparando {
    background: #dbeafe;
    color: #3b82f6;
}

.estado-icono.listo {
    background: #dcfce7;
    color: #22c55e;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.estado-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.estado-descripcion {
    color: #6b7280;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    padding-left: 45px;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 8px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 2px solid #fff;
}

.timeline-item.completado .timeline-dot {
    background: #22c55e;
}

.timeline-item.activo .timeline-dot {
    background: #3b82f6;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

.timeline-content {
    background: #fff;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.timeline-titulo {
    font-weight: 600;
    color: #1f2937;
}

.timeline-hora {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Detalle Pedido */
.detalle-pedido {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.detalle-header {
    padding: 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

.detalle-item {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.detalle-item:last-child {
    border-bottom: none;
}

.detalle-cantidad {
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
}

.detalle-info {
    flex: 1;
}

.detalle-nombre {
    font-weight: 600;
    color: #1f2937;
}

.detalle-extras {
    font-size: 0.875rem;
    color: #6b7280;
}

.detalle-precio {
    font-weight: 600;
    color: #1f2937;
}

.detalle-total {
    padding: 1rem;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Menú */
.categoria-header {
    padding: 1rem;
    background: #fff;
    position: sticky;
    top: 50px;
    z-index: 10;
    border-bottom: 1px solid #e5e7eb;
}

.categoria-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.menu-item {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.menu-item-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.menu-item-body {
    padding: 1rem;
}

.menu-item-nombre {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.menu-item-descripcion {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.menu-item-precio {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cliente-primary);
}

.menu-item-tamanios {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.tamanio-badge {
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    color: #4b5563;
}

/* Footer */
.footer-cliente {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

/* Responsive */
@media (min-width: 768px) {
    .menu-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 992px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ================================ */
/* Estilos adicionales Fase 9      */
/* ================================ */

/* Estado del pedido - Nuevos estilos */
.estado-pedido-container .card {
    border-radius: 12px;
}

.pedido-codigo h3 {
    color: var(--cliente-primary);
}

/* Barra de progreso */
.progress {
    border-radius: 10px;
    background: #e9ecef;
    height: 8px;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Timeline horizontal */
.estado-timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 10px;
}

.estado-timeline .timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.4;
    padding: 0;
    position: relative;
}

.estado-timeline .timeline-item::before {
    display: none;
}

.estado-timeline .timeline-item.active {
    opacity: 1;
}

.estado-timeline .timeline-dot {
    position: relative;
    left: auto;
    top: auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dee2e6;
    margin-bottom: 5px;
    border: none;
}

.estado-timeline .timeline-item.active .timeline-dot {
    background: #198754;
}

.estado-timeline .timeline-line {
    width: 30px;
    height: 2px;
    background: #dee2e6;
    margin: 0 5px;
    margin-bottom: 20px;
}

.estado-timeline .timeline-line.active {
    background: #198754;
}

/* Producto Cards - Grid */
.producto-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.producto-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

.producto-imagen-wrapper {
    height: 120px;
    overflow: hidden;
}

.producto-imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.producto-card:hover .producto-imagen {
    transform: scale(1.05);
}

.producto-sin-imagen {
    height: 120px;
    background: #f8f9fa;
}

.producto-nombre {
    font-size: 0.9rem;
    line-height: 1.2;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.producto-descripcion {
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.producto-precio {
    font-size: 0.95rem;
}

/* Categorías scroll */
.categorias-scroll {
    margin: 0 -1rem;
    padding: 0 1rem;
}

.categorias-scroll::-webkit-scrollbar {
    height: 4px;
}

.categorias-scroll::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

.categorias-scroll .btn {
    white-space: nowrap;
}

/* Mesa container */
.mesa-container {
    max-width: 400px;
    margin: 0 auto;
}

.mesa-icono {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cliente-primary) 0%, #991b1b 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto;
}

/* Error container */
.error-container {
    max-width: 400px;
    margin: 0 auto;
}

.error-icono {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto;
}

/* Animaciones de estado */
.estado-icono.estado-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.estado-icono.estado-info {
    background: rgba(13, 202, 240, 0.15);
    color: #0dcaf0;
    animation: pulse 2s infinite;
}

.estado-icono.estado-success {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
    animation: bounce 1s infinite;
}

.estado-icono.estado-primary {
    background: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
}

.estado-icono.estado-danger {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Modal */
.modal-content {
    border-radius: 16px;
    border: none;
}

.modal-header {
    border-bottom: none;
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--cliente-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 576px) {
    .producto-imagen-wrapper,
    .producto-sin-imagen {
        height: 100px;
    }

    .producto-nombre {
        font-size: 0.85rem;
    }

    .estado-timeline {
        font-size: 0.75rem;
    }

    .estado-timeline .timeline-line {
        width: 20px;
    }
}
