/* POPUP GENERAL (Aplica a ambos) */

/************************************************************************************/



/*****
*
* pestañas responsivas
*
*/

/* Estilo base para pestañas */
.tabs-admin {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #ccc;
  background-color: #f7f7f7;
}

/* Botones de pestaña */
.tabs-admin .tab-link {
  flex: 0 0 auto;
  padding: 10px 15px;
  background-color: #e2e2e2;
  border: none;
  border-radius: 5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.3s ease;
}

.tabs-admin .tab-link.active {
  background-color: #0073aa;
  color: white;
}

.tabs-admin::-webkit-scrollbar {
  height: 6px;
}
.tabs-admin::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 3px;
}




/* Contenedor principal */
#modificar {
  padding: 24px;
  background-color: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.popup-header {
    display: flex;
    align-items: center;
    background-color: #efeded;
    padding: 10px;
    border-bottom: 1px solid #ccc;
}

/*boton cerrar*/
.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e50914; /* Fondo rojo */
    color: #fff; /* Letra blanca */
   
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.close-popup:hover {
    background-color: #c40811; /* Rojo más oscuro en hover */
}
.informe-wrapper {
  padding: 20px;
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  font-family: "Segoe UI", sans-serif;
}

.informe-wrapper h3 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  color: #2c3e50;
  border-bottom: 2px solid #0073aa;
  padding-bottom: 8px;
}

.informe-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  background-color: #f1f1f1;
  border: 2px solid #0073aa;
  padding: 15px;
  border-radius: 8px;
}

.informe-controls label {
  font-weight: bold;
  margin-right: 5px;
  color: #333;
}

.informe-controls select,
.informe-controls button {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background-color: #fff;
}

.informe-controls button {
  background-color: #0073aa;
  color: white;
  border: none;
  cursor: pointer;
}

.informe-controls button:hover {
  background-color: #005c8e;
}

#resultado-informe {
  width: 100%;
  margin-top: 20px;
}

#resultado-informe table {
  width: 100%;
  border-collapse: collapse;
}

#resultado-informe th,
#resultado-informe td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
}

#resultado-informe th {
  background-color: #0073aa;
  color: #fff;
  font-weight: bold;
}

#resultado-informe tr:nth-child(even) {
  background-color: #f9f9f9;
}

#btn-descargar-pdf {
  margin-top: 20px;
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  float: right;
}

#btn-descargar-pdf:hover {
  background-color: #218838;
}

/* Buscador */
#buscador-productos-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

#buscar-producto {
  flex: 1;
  min-width: 250px;
  padding: 10px 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: white;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  transition: border 0.2s ease;
}

#buscar-producto:focus {
  outline: none;
  border-color: #007cba;
}

/* Botón "Ver todos" */
#btn-mostrar-todos {
  background-color: #007cba;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#btn-mostrar-todos:hover {
  background-color: #005fa3;
}

/* Productos en grid */
#productos-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

@media screen and (max-width: 600px) {
  #productos-container {
    grid-template-columns: repeat(2, 1fr);
  }

  #productos-container .producto-item img {
    width: 100%;
    height: auto;
  }
}

/* Producto individual */
.producto-item {
  background-color: white;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  transition: transform 0.2s ease;
}

.producto-item:hover {
  transform: translateY(-3px);
}

/* Spinner */
#spinner-container {
  text-align: center;
  padding: 20px 0;
  font-size: 16px;
  color: #666;
}
/* Editor de producto */
#editor-producto {
  background-color: #fff;
  padding: 25px;
  margin-top: 30px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Campos de entrada del editor */
#editor-producto input[type="text"],
#editor-producto input[type="number"],
#editor-producto textarea,
#editor-producto select {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  margin-bottom: 16px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 15px;
  box-sizing: border-box;
}

/* Etiquetas de campos */
#editor-producto label {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
  color: #333;
}

/* Botones del editor */
#editor-producto button {
  padding: 10px 18px;
  background-color: #007cba;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  margin-right: 10px;
  transition: background-color 0.3s;
}
#editor-producto button:hover {
  background-color: #005fa3;
}

/* Mensaje de guardado */
#mensaje-producto-guardado {
  background-color: #e0f7e9;
  border: 1px solid #2e7d32;
  border-radius: 6px;
  padding: 20px;
  margin-top: 30px;
}

/************************************************************************************/

.spinner {
  border: 4px solid rgba(0,0,0,0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: #09f;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/*estilos del formulario de crear usuarios*/
.usuario-exito {
  text-align: center;
  margin-top: 20px;
}

.usuario-exito h2 {
  font-size: 22px;
  color: #28a745;
  margin-bottom: 20px;
}

.icono-usuario {
  font-size: 50px;
  animation: saltar 1s infinite alternate;
  margin-bottom: 10px;
}

@keyframes saltar {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.botones-compartir {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Reutiliza los estilos de antes */
.btn-compartir {
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-whatsapp {
  background-color: #25D366;
  color: white;
}
.btn-whatsapp:hover {
  background-color: #1ebe5d;
  transform: scale(1.03);
}

.btn-correo {
  background-color: #007BFF;
  color: white;
}
.btn-correo:hover {
  background-color: #0056b3;
  transform: scale(1.03);
}

.btn-nuevo {
  background-color: #6c757d;
  color: white;
}
.btn-nuevo:hover {
  background-color: #5a6268;
  transform: scale(1.03);
}



/* Estilos para inputs y selects del formulario */
#form-crear-usuario input[type="text"],
#form-crear-usuario input[type="email"],
#form-crear-usuario input[type="password"],
#form-crear-usuario select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 15px;
  border: 2px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: #fff;
  outline: none;
}

/* Borde y sombra al enfocar */
#form-crear-usuario input[type="text"]:focus,
#form-crear-usuario input[type="email"]:focus,
#form-crear-usuario input[type="password"]:focus,
#form-crear-usuario select:focus {
  border-color: #007BFF; /* azul brillante */
  box-shadow: 0 0 8px rgba(0, 123, 255, 0.5);
  background-color: #f0f8ff;
}

/* Opcional: estilos para etiquetas, para que combine */
#form-crear-usuario label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
  color: #333;
}

/* Opcional: estilo para el botón del formulario */
#form-crear-usuario button[type="submit"] {
  background-color: #007BFF;
  border: none;
  color: white;
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#form-crear-usuario button[type="submit"]:hover {
  background-color: #0056b3;
}

/* Estilo bonito para el botón Mostrar todos los productos */
#btn-mostrar-todos {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 117, 252, 0.6);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  display: block;
  margin: 20px auto;
  user-select: none;
}

#btn-mostrar-todos:hover {
  background: linear-gradient(135deg, #2575fc 0%, #6a11cb 100%);
  box-shadow: 0 6px 16px rgba(37, 117, 252, 0.8);
}


/* Contenedor mensaje-cupon */
#mensaje-cupon {
    margin-top: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
}


#productos-container {
  display: grid;
  min-height: 150px; /* o el alto que estimes adecuado */
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 20px;
}
.producto-item {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  border-radius: 5px;
  transition: transform 0.2s;
}
.producto-item:hover {
  transform: scale(1.03);
}
.producto-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
}


/*   productos editar*/
#productos-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px;
}

.producto-item {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
    background: white;
}

.producto-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.producto-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 8px;
}

.producto-item p {
    font-weight: 600;
    font-size: 14px;
    margin: 0;
    color: #333;
}





/* formulario de crear producto */
#form-producto input[type="text"],
#form-producto input[type="number"],
#form-producto textarea,
#form-producto select {
  border: 1.5px solid #555!important;
  border-radius: 4px!important;
  padding: 6px 8px !important;
  font-family: Arial, sans-serif;
  font-size: 14px !important;
  transition: border-color 0.3s ease;
  width: 100% !important;
  box-sizing: border-box;
  margin-bottom: 12px;
}

#form-producto input[type="text"]:focus,
#form-producto input[type="number"]:focus,
#form-producto textarea:focus,
#form-producto select:focus {
  border-color: #1a73e8 !important;
  outline: none !important;
}


/* fin de crear producto */
/* Enlaces de compartir */
#mensaje-cupon a {
    display: inline-block;
    margin: 5px 10px 5px 0;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

#mensaje-cupon a[target="_blank"] {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#mensaje-cupon a:first-of-type {
    background-color: #25D366; /* Verde WhatsApp */
    color: white;
}

#mensaje-cupon a:first-of-type:hover {
    background-color: #1ebe5b;
}

#mensaje-cupon a:last-of-type {
    background-color: #0072C6; /* Azul correo */
    color: white;
}

#mensaje-cupon a:last-of-type:hover {
    background-color: #005fa3;
}

/* Botón crear nuevo cupón */
#btn-nuevo-cupon {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    background-color: #444;
    color: white;
    font-weight: 700;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    user-select: none;
}

#btn-nuevo-cupon:hover {
    background-color: #222;
}

/* Ocultar el formulario */
.oculto {
    display: none !important;
}

/* Mejorar estilo inputs, textarea y select */
form#form-cupon input[type="text"],
form#form-cupon input[type="number"],
form#form-cupon input[type="date"],
form#form-cupon textarea,
form#form-cupon select {
    width: 100%;
    padding: 7px 10px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

form#form-cupon input[type="text"]:focus,
form#form-cupon input[type="number"]:focus,
form#form-cupon input[type="date"]:focus,
form#form-cupon textarea:focus,
form#form-cupon select:focus {
    border-color: #66afe9;
    outline: none;
}

/* Estilo botón crear cupón */
form#form-cupon button[type="submit"] {
    background-color: #28a745;
    border: none;
    padding: 10px 18px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form#form-cupon button[type="submit"]:hover {
    background-color: #218838;
}

#popup-cupones {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 10px;
}

#popup-cupones.hidden {
    display: none;
}

/* CONTENIDO DEL POPUP (aplica a login y cupones) */
.popup-content {
    background-color: #efeded;
    padding: 25px 30px;
    border-radius: 12px;
    width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    transition: all 0.3s ease;
}

/* BOTÓN CERRAR */
.close-popup {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 26px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.close-popup:hover {
    color: #d33;
}

/* CAMPOS DEL FORMULARIO */
input[type=text],
input[type=number],
input[type=password],
input[type=date],
select {
    width: 100%;
    padding: 10px 12px;
    margin: 8px 0 16px 0;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1.5px solid #ccc;
    font-size: 15px;
    transition: border-color 0.25s ease;
}

input[type=text]:focus,
input[type=number]:focus,
input[type=password]:focus,
input[type=date]:focus,
select:focus {
    border-color: #4caf50;
    outline: none;
}

label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    display: block;
    color: #444;
}

/* BOTONES */
button[type=submit] {
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: background-color 0.3s ease;
}

button.crear {
    background-color: #4caf50;
    color: white;
}

button.crear:hover {
    background-color: #388e3c;
}

button.cancelar {
    background-color: #e53935;
    color: white;
    margin-left: 15px;
}

button.cancelar:hover {
    background-color: #ab000d;
}


/* RESPONSIVE */
@media screen and (max-width: 720px) {
    .popup-content {
        width: 95%;
        max-height: 85vh;
        padding: 20px;
        font-size: 14px;
    }

    button[type=submit] {
        width: 100%;
        margin: 10px 0 0 0;
        padding: 14px 0;
        font-size: 16px;
    }

    button.cancelar {
        margin-left: 0;
    }
}

.tabs-admin {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 2px solid #ccc;
}

.tab-link {
  background-color: #eee;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  margin-right: 5px;
  font-weight: bold;
  border-radius: 5px 5px 0 0;
}

.tab-link.active {
  background-color: #fff;
  border: 1px solid #ccc;
  border-bottom: 2px solid white;
}

.tab-content {
  background-color: #fff;
  padding: 15px;
  border: 1px solid #ccc;
  display: none;
}
.btn {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 10px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
}

.btn-nuevo {
    background-color: #0073aa;
    color: white;
}

.btn:hover {
    opacity: 0.9;
}

.btn {
    display: inline-block;
    padding: 10px 15px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    margin: 5px;
    cursor: pointer;
}

.btn-whatsapp {
    background-color: #25D366;
}

.btn-nuevo {
    background-color: #0073aa;
}
/* Contenedor pestañas */
.tabs {
  display: flex;
  border-bottom: 2px solid #ccc;
  margin-bottom: 15px;
  font-family: Arial, sans-serif;
}

/* Botones pestañas */
.tabs .tab-button {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: #444;
  transition: all 0.3s ease;
  outline: none;
}

/* Pestaña activa */
.tabs .tab-button.active {
  border-bottom-color: #0073aa; /* color WP azul */
  color: #0073aa;
  font-weight: 700;
}

/* Hover en pestañas */
.tabs .tab-button:hover:not(.active) {
  color: #005177;
}

/* Buscador */
#buscar-producto {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 15px;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
  display: none; /* por defecto oculto */
}

/* Mostrar buscador solo en modificar productos */
#buscar-producto.visible {
  display: block;
}

/* Contenedor productos */
#productos-container {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(150px,1fr));
  gap: 10px;
  font-family: Arial, sans-serif;
}

/* Producto individual */
.producto-item {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
  background-color: #fff;
}

.producto-item:hover {
  box-shadow: 0 0 8px rgba(0,115,170,0.5);
  border-color: #0073aa;
}

.producto-item img {
  max-width: 100%;
  height: 100px;
  object-fit: contain;
  margin-bottom: 8px;
}

.producto-item p {
  margin: 0;
  font-weight: 600;
  color: #222;
  font-size: 14px;
}
