/* Estilos para las vistas de usuario */

/* === CHECKOUT VIEW === */
.checkout-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.checkout-header {
    text-align: center;
    margin-bottom: 30px;
}

.checkout-header h1 {
    color: #2d3748;
    margin-bottom: 10px;
}

.checkout-header .subtitle {
    color: #718096;
    font-size: 16px;
}

.checkout-sections {
    display: grid;
    gap: 30px;
}

.checkout-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #4299e1;
}

/* Resumen de productos */
.productos-resumen {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.producto-checkout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.producto-checkout:last-child {
    border-bottom: none;
}

.producto-info {
    flex: 1;
}

.producto-nombre {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.producto-precio {
    color: #718096;
    font-size: 14px;
}

.producto-cantidad {
    background: #edf2f7;
    color: #4a5568;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    margin: 0 15px;
}

.producto-subtotal {
    font-weight: 600;
    color: #2d3748;
}

/* Formulario de entrega */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Cálculo de costos */
.costos-detalle {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
}

.costo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.costo-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 18px;
    color: #2d3748;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #e2e8f0;
}

.costo-label {
    color: #4a5568;
}

.costo-valor {
    font-weight: 600;
    color: #2d3748;
}

/* Botones */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* === PEDIDOS VIEW === */
.pedidos-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.page-header h1 {
    color: #2d3748;
    margin-bottom: 10px;
}

.page-header .subtitle {
    color: #718096;
    font-size: 16px;
}

/* Filtros */
.pedidos-filters {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

/* Lista de pedidos */
.pedidos-lista {
    display: grid;
    gap: 20px;
}

.pedido-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.pedido-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.pedido-info h3 {
    color: #2d3748;
    margin-bottom: 5px;
}

.pedido-local {
    color: #718096;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pedido-estado {
    text-align: right;
}

.estado-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.estado-pendiente {
    background: #fed7d7;
    color: #c53030;
}

.estado-asignado {
    background: #bee3f8;
    color: #2b6cb0;
}

.estado-en-camino {
    background: #faf089;
    color: #975a16;
}

.estado-entregado {
    background: #c6f6d5;
    color: #276749;
}

.estado-cancelado {
    background: #e2e8f0;
    color: #4a5568;
}

.pedido-fecha {
    color: #718096;
    font-size: 12px;
    margin-top: 5px;
}

/* Productos en pedido */
.pedido-productos {
    margin-bottom: 20px;
}

.productos-resumen .producto-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.productos-resumen .cantidad {
    background: #edf2f7;
    color: #4a5568;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.productos-resumen .nombre {
    color: #2d3748;
    font-size: 14px;
}

.productos-mas {
    color: #718096;
    font-size: 12px;
    font-style: italic;
    margin-top: 5px;
}

/* Footer del pedido */
.pedido-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.pedido-totales {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.total-productos,
.total-envio {
    color: #718096;
    font-size: 14px;
}

.total-final {
    color: #2d3748;
    font-size: 16px;
}

.pedido-acciones {
    color: #cbd5e0;
    font-size: 20px;
}

/* === PEDIDO DETALLE VIEW === */
.pedido-detalle-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.pedido-detalle-header {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pedido-numero {
    color: #2d3748;
    margin-bottom: 10px;
}

.pedido-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-item i {
    color: #4299e1;
    width: 20px;
}

.meta-label {
    color: #718096;
    font-size: 14px;
}

.meta-value {
    color: #2d3748;
    font-weight: 600;
}

/* Seguimiento */
.seguimiento-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.seguimiento-timeline {
    position: relative;
    padding-left: 30px;
}

.seguimiento-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #e2e8f0;
}

.timeline-item.completed::before {
    background: #48bb78;
    box-shadow: 0 0 0 2px #48bb78;
}

.timeline-item.current::before {
    background: #4299e1;
    box-shadow: 0 0 0 2px #4299e1;
    animation: pulse 2s infinite;
}

.timeline-content {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
}

.timeline-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.timeline-time {
    color: #718096;
    font-size: 14px;
}

.timeline-description {
    color: #4a5568;
    font-size: 14px;
    margin-top: 5px;
}

/* Estados y animaciones */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Estados vacíos y de carga */
.loading-container,
.empty-state,
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.loading-container .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state i,
.no-results i {
    font-size: 48px;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.empty-state h3,
.no-results h3 {
    color: #4a5568;
    margin-bottom: 10px;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #e53e3e;
}

.error-message i {
    font-size: 48px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .checkout-container,
    .pedidos-container,
    .pedido-detalle-container {
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .pedidos-filters {
        grid-template-columns: 1fr;
    }
    
    .pedido-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .pedido-footer {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .pedido-meta {
        grid-template-columns: 1fr;
    }
}