/* Estilos para el sistema de pedidos */

/* Botón del carrito en el header */
.cart-button {
    background: linear-gradient(to right, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

#cartCount {
    background: white;
    color: #059669;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    min-width: 24px;
    text-align: center;
}

/* Layout de la página de pedidos */
.pedido-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.cliente-form-section,
.productos-selector-section,
.carrito-section {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.carrito-section {
    grid-column: 1 / -1;
}

.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(to right, #0891b2, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #06b6d4;
}

/* Formulario del cliente */
.cliente-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    border: 2px solid #67e8f9;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
    background: white;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group select:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Productos disponibles */
.productos-disponibles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    margin-top: 1rem;
}

.producto-item-pedido {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.3s;
    align-items: center;
}

.producto-item-pedido:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.producto-item-pedido img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 0.5rem;
    background: #f9fafb;
    padding: 0.5rem;
}

.producto-item-info {
    flex: 1;
}

.producto-item-nombre {
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.producto-item-codigo {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.producto-item-precios {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
}

.precio-opcion {
    display: flex;
    flex-direction: column;
}

.precio-opcion-label {
    color: #6b7280;
    font-size: 0.75rem;
}

.precio-opcion-valor {
    font-weight: bold;
    color: #0891b2;
}

.producto-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.producto-item-actions select {
    padding: 0.5rem;
    border: 2px solid #67e8f9;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.producto-item-actions input {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid #67e8f9;
    border-radius: 0.25rem;
    text-align: center;
    font-size: 0.875rem;
}

.btn-agregar-carrito {
    background: linear-gradient(to right, #10b981, #059669);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.btn-agregar-carrito:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* Carrito */
.carrito-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.carrito-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #f9fafb;
    align-items: center;
}

.carrito-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 0.25rem;
}

.carrito-item-info {
    flex: 1;
}

.carrito-item-nombre {
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

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

.carrito-item-cantidad {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-cantidad {
    background: #06b6d4;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-cantidad:hover {
    background: #0891b2;
}

.cantidad-valor {
    font-weight: bold;
    min-width: 32px;
    text-align: center;
}

.carrito-item-subtotal {
    font-weight: bold;
    color: #059669;
    font-size: 1.125rem;
}

.btn-eliminar-item {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-eliminar-item:hover {
    background: #b91c1c;
}

.carrito-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(to right, #dbeafe, #d1fae5);
    border-radius: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

#carritoTotal {
    color: #059669;
}

.btn-enviar-pedido {
    width: 100%;
    background: linear-gradient(to right, #0891b2, #059669);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-enviar-pedido:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(8, 145, 178, 0.3);
}

.btn-enviar-pedido:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.modal-content h3 {
    font-size: 1.5rem;
    color: #059669;
    margin-bottom: 1rem;
}

.modal-content p {
    color: #374151;
    margin-bottom: 1rem;
}

.btn-primary {
    background: linear-gradient(to right, #10b981, #059669);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Responsive */
@media (max-width: 1024px) {
    .pedido-layout {
        grid-template-columns: 1fr;
    }

    .cart-button {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .cliente-form-section,
    .productos-selector-section,
    .carrito-section {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .producto-item-pedido {
        flex-direction: column;
        text-align: center;
    }

    .producto-item-precios {
        flex-direction: column;
        gap: 0.5rem;
    }

    .carrito-item {
        flex-direction: column;
        text-align: center;
    }

    .carrito-total {
        font-size: 1.25rem;
    }
}
/* Estilos para validación de formularios */
.error-message {
    display: none;
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #dc2626;
}

.help-text {
    display: block;
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}