/* formulario.css */
/* Overlay formulario mejorado */
.form-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4000;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Contenedor del formulario mejorado */
.form-container {
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
  border-radius: 25px;
  padding: 2.5rem;
  max-width: 550px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255,255,255,0.3);
  animation: popInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
}

.form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #231a11, #DAA520, #231a11);
  border-radius: 25px 25px 0 0;
}

@keyframes popInBounce {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.form-container h2 {
  color: #231a11;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-container h3 {
  color: #231a11;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
  border-bottom: 2px solid #DAA520;
  padding-bottom: 0.5rem;
}

/* Resumen del pedido mejorado */
.resumen-pedido {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 237, 78, 0.1));
  padding: 1.5rem;
  border-radius: 20px;
  margin-bottom: 2rem;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.resumen-pedido h3 {
  color: #231a11;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.resumen-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  border-left: 4px solid #DAA520;
  transition: all 0.3s ease;
}

.resumen-item:hover {
  background: rgba(255,255,255,0.9);
  transform: translateX(5px);
}

.resumen-item:last-child {
  margin-bottom: 0;
}

.resumen-total {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.1));
  border: 2px solid rgba(34, 197, 94, 0.3);
  border-radius: 15px;
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: #22c55e;
}

/* Inputs y textareas mejorados */
form input, 
form textarea {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 15px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.9);
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

form input:focus, 
form textarea:focus {
  border-color: #DAA520;
  background: rgba(255,255,255,1);
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

form input::placeholder,
form textarea::placeholder {
  color: #999;
  font-style: italic;
}

form textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* Labels mejorados */
form label {
  display: block;
  color: #231a11;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

/* Campos requeridos */
form input[required]::after {
  content: ' *';
  color: #ef4444;
}

/* Botones mejorados */
.form-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.form-buttons button {
  flex: 1;
  padding: 1.25rem;
  border-radius: 15px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.form-buttons button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.form-buttons button:hover::before {
  left: 100%;
}

#cancelarPedido {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid #ef4444;
  color: #ef4444;
  font-weight: 700;
}

#cancelarPedido:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border-color: #dc2626;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

form button[type="submit"] {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

form button[type="submit"]:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
}

form button[type="submit"]:disabled {
  background: linear-gradient(135deg, #ccc, #bbb);
  color: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Estados de validación */
form input:invalid {
  border-color: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

form input:valid {
  border-color: #22c55e;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

/* Indicadores de campo requerido */
.required-indicator {
  color: #ef4444;
  font-weight: bold;
  margin-left: 0.25rem;
}

/* Mensajes de ayuda */
.help-text {
  font-size: 0.85rem;
  color: #666;
  margin-top: -1rem;
  margin-bottom: 1rem;
  font-style: italic;
}

/* Responsive para formulario */
@media (max-width: 768px) {
  .form-container {
    padding: 2rem;
    margin: 1rem;
    width: calc(100% - 2rem);
  }

  .form-container h2 {
    font-size: 1.8rem;
  }

  .form-buttons {
    flex-direction: column;
    gap: 1rem;
  }

  .form-buttons button {
    flex: none;
  }
}

@media (max-width: 480px) {
  .form-container {
    padding: 1.5rem;
    border-radius: 20px;
  }

  .form-container h2 {
    font-size: 1.6rem;
  }

  .resumen-pedido {
    padding: 1rem;
  }

  form input, 
  form textarea {
    padding: 0.875rem;
    font-size: 0.95rem;
  }
}

/* Animaciones adicionales */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.form-container.error {
  animation: shake 0.5s ease-in-out;
}

/* Scrollbar personalizado para el formulario */
.form-container::-webkit-scrollbar {
  width: 6px;
}

.form-container::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.form-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #DAA520, #DAA520);
  border-radius: 3px;
}

.form-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #DAA520, #DAA520);
}