/* === ESTILOS GENERALES === */
body {
  font-family: "Poppins", sans-serif;
  background-color: #f8f9fa;
  color: #333;
  margin: 0;
  padding: 0;
}

h2 {
  text-align: center;
  margin-top: 40px;
  font-size: 1.8rem;
  color: #222;
  font-weight: 600;
}

/* === CONTENEDOR PRINCIPAL === */
/* === CONTENEDOR PRINCIPAL === */
.contenedor-pedidos {
  width: 90%;
  max-width: 1000px;
  margin: 40px auto;
  background-color: #c8e6c9; /* Verde más oscuro para resaltar la tabla */
  border-radius: 12px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
  overflow-x: auto;
  padding: 25px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.contenedor-pedidos:hover {
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.18);
}


/* título de sección */
.titulo-pedidos {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.8rem;
  font-weight: 600;
  color: #000000;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.subtitulo-pedidos {
  text-align: center;
  color: #555;
  font-size: 0.95rem;
  margin-top: 8px;
}


/* === TABLA DE PEDIDOS === */
/* === CONTENEDOR DE TABLA === */
.tabla-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  background-color: #f7f9f8; /* fondo gris suave */
  padding: 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

/* === TABLA PRINCIPAL === */
.tabla-pedidos {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
  font-size: 0.95rem;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #dcdcdc;
}

/* === ENCABEZADO === */
.tabla-pedidos thead {
  background: linear-gradient(90deg, #00b050, #a8e063);
  color: #fff;
}

.tabla-pedidos th {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

/* === FILAS Y CELDAS === */
.tabla-pedidos td {
  padding: 14px 10px;
  border-bottom: 1px solid #e1e1e1;
  color: #333;
}

.tabla-pedidos tr {
  transition: background-color 0.25s ease, transform 0.15s ease;
}

/* === FILAS ALTERNADAS (stripeado) === */
.tabla-pedidos tbody tr:nth-child(even) {
  background-color: #f6f8f6; /* tono gris muy suave */
}

.tabla-pedidos tbody tr:nth-child(odd) {
  background-color: #ffffff;
}


/* === BORDES REDONDEADOS EN LAS ESQUINAS === */
.tabla-pedidos thead tr:first-child th:first-child {
  border-top-left-radius: 12px;
}
.tabla-pedidos thead tr:first-child th:last-child {
  border-top-right-radius: 12px;
}
.tabla-pedidos tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}
.tabla-pedidos tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .tabla-pedidos {
    font-size: 0.85rem;
  }

  .tabla-pedidos th,
  .tabla-pedidos td {
    padding: 10px 6px;
  }
}


/* === MENSAJE SIN PEDIDOS === */
.vacio {
  text-align: center;
  color: #000000;
  font-style: italic;
  padding: 25px;
  font-size: 1rem;
}

/* === ESTADOS === */
.estado {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  display: inline-block;
  text-transform: capitalize;
}

.estado.pendiente {
  background-color: #ffc107;
  color: #222;
}

.estado.entregado {
  background-color: #28a745;
}

.estado.cancelado {
  background-color: #dc3545;
}

/* === BOTONES DE ACCIÓN === */
button {
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-ver {
  background-color: #00c853;
  color: #fff;
}

.btn-ver:hover {
  background-color: #00a43c;
}

/* === BOTÓN CANCELAR === */
.btn-cancelar {
  background: linear-gradient(135deg, #ff5c5c, #ff2d2d);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(255, 0, 0, 0.2);
}

.btn-cancelar:hover {
  background: linear-gradient(135deg, #ff1a1a, #cc0000);
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(255, 0, 0, 0.3);
}

.btn-cancelar:active {
  transform: scale(0.97);
  box-shadow: 0 2px 4px rgba(255, 0, 0, 0.2);
}


/* === TOASTS === */
.toast {
  position: fixed;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 9999;
}

.toast.visible {
  bottom: 30px;
  opacity: 1;
}

.toast.success {
  background-color: #4caf50;
}

.toast.warning {
  background-color: #ff9800;
}

.toast.error {
  background-color: #f44336;
}

/* === CONFIRMACIÓN PERSONALIZADA === */
/* ------------------------------------------------------------
   🔔 Estilos del cuadro de confirmación personalizada
------------------------------------------------------------ */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.confirm-box {
  background: #ffffff;
  padding: 25px 30px;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 360px;
  width: 90%;
  animation: fadeInConfirm 0.25s ease-in-out;
}

.confirm-box p {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #333;
  font-weight: 500;
}

.confirm-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

/* 🔘 Botón "Sí, cancelar" */
.btn-confirmar {
  background: linear-gradient(90deg, #ff4d4d, #e63b3b);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-confirmar:hover {
  background: linear-gradient(90deg, #e63b3b, #b32020);
  transform: scale(1.05);
}

/* 🔘 Botón "No" (gris elegante) */
.btn-cancelar-modal {
  background: #ccc;
  color: #333;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-cancelar-modal:hover {
  background: #b8b8b8;
  transform: scale(1.05);
}

/* 🌀 Animación */
@keyframes fadeInConfirm {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


/* === RESPONSIVE === */
@media (max-width: 768px) {
  .contenedor-pedidos {
    padding: 15px;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 10px;
  }

  h2 {
    font-size: 1.5rem;
  }

  .estado {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  button {
    font-size: 0.8rem;
    padding: 6px 10px;
  }
}

/* === FILTRO DE ESTADOS === */
.filtro-estados {
  display: flex;
  align-items: center;
  justify-content: center; /* 🔹 centrado horizontal */
  gap: 12px;
  margin: 20px 0;
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.4); /* sutil fondo translúcido */
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filtro-estados label {
  font-weight: 600;
  color: #1f1f1f;
  font-size: 1rem;
}

.filtro-estados select {
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px solid #44c553;
  background-color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.filtro-estados select:hover {
  background-color: #f8fff9;
  border-color: #2ea340;
  box-shadow: 0 0 8px rgba(68, 197, 83, 0.4);
  transform: scale(1.05);
}

/* Botones + y - del carrito */
.cart-item-actions .qty-btn {
  background-color: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  cursor: pointer;
  margin: 0 0px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-item-actions .qty-btn:hover {
  background-color: #45a049;
}

/* Contenedor centrado */
.acciones-pedidos {
  display: flex;
  justify-content: center; /* centra horizontalmente */
  margin: 20px 0; /* separación arriba y abajo */
}

/* Estilo del botón */
.btn-crear-pedido {
  background-color: #4CAF50;
  color: white;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Efecto hover */
.btn-crear-pedido:hover {
  background-color: #45a049;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

/* Efecto al presionar */
.btn-crear-pedido:active {
  transform: translateY(1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* ================= RESPONSIVE GENERAL ================= */
@media (max-width: 992px) {
  /* Contenedor principal */
  .contenedor-pedidos {
    width: 95%;
    padding: 20px;
  }

  /* Títulos */
  h2, .titulo-pedidos {
    font-size: 1.6rem;
  }

  .subtitulo-pedidos {
    font-size: 0.9rem;
  }

  /* Tabla */
  .tabla-pedidos {
    font-size: 0.9rem;
  }

  .tabla-pedidos th,
  .tabla-pedidos td {
    padding: 10px 8px;
  }

  .estado {
    font-size: 0.85rem;
    padding: 4px 10px;
  }

  /* Filtro de estados */
  .filtro-estados {
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
  }

  .filtro-estados label, .filtro-estados select {
    font-size: 0.9rem;
  }

  /* Botones */
  button, .btn-crear-pedido {
    font-size: 0.85rem;
    padding: 8px 16px;
  }
}

@media (max-width: 768px) {
  /* Contenedor principal */
  .contenedor-pedidos {
    width: 100%;
    margin: 20px 0;
    padding: 15px;
  }

  /* Títulos */
  h2, .titulo-pedidos {
    font-size: 1.4rem;
  }

  .subtitulo-pedidos {
    font-size: 0.85rem;
  }

  /* Tabla */
  .tabla-wrapper {
    padding: 5px;
  }

  .tabla-pedidos {
    font-size: 0.8rem;
  }

  .tabla-pedidos th,
  .tabla-pedidos td {
    padding: 8px 6px;
  }

  /* Estado */
  .estado {
    font-size: 0.75rem;
    padding: 3px 8px;
  }

  /* Botones */
  button, .btn-crear-pedido {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  /* Filtro de estados */
  .filtro-estados {
    flex-direction: column;
    gap: 6px;
    padding: 6px 0;
  }

  /* Acciones centradas */
  .acciones-pedidos {
    flex-direction: column;
    gap: 10px;
  }

  /* Botones + y - del carrito */
  .cart-item-actions .qty-btn {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  h2, .titulo-pedidos {
    font-size: 1.2rem;
  }

  .subtitulo-pedidos {
    font-size: 0.8rem;
  }

  .tabla-pedidos {
    font-size: 0.75rem;
  }

  .tabla-pedidos th,
  .tabla-pedidos td {
    padding: 6px 4px;
  }

  button, .btn-crear-pedido {
    font-size: 0.75rem;
    padding: 5px 10px;
  }

  .estado {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  .filtro-estados {
    flex-direction: column;
    gap: 5px;
  }

  .acciones-pedidos {
    gap: 8px;
  }
}

/* Contenedor del buscador a la izquierda */
.dataTables_filter {
  float: left !important;
  text-align: left !important;
  margin-bottom: 15px;
  position: relative;
  font-weight: bold;
  font-size: 14px;
}

/* Input del buscador */
.dataTables_filter input {
  padding: 10px 12px 10px 35px; /* espacio para la lupa */
  border-radius: 25px;
  border: 1px solid #ccc;
  width: 280px;
  transition: all 0.3s ease;
  font-size: 14px;
  margin-left: 10px; /* separa del texto "Buscador:" */
}

/* Efecto al enfocar */
.dataTables_filter input:focus {
  border-color: #4CAF50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
  outline: none;
}

/* Icono de lupa dentro del input */
.dataTables_filter label {
  position: relative;
}




