@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
  --bg-color: #faf8f8e0;
  --card-bg: #ffffff;
  --primary-color: #55aff8fb;
  --hover-color: #55aff8fb;
  --text-color: #333;
  --border-color: #e0e0e0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --section-separator: #dddddd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-bottom: 30px;
}

#buscador {
  font-size: 16px;
}

input, select, textarea {
  font-size: 16px;
}



.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 35px 10px;
  background-color: #1c1c1e;
  position: relative;
  flex-wrap: wrap;
}

.navbar-center {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 5px;
}

.menu-icon {
  font-size: 28px;
  border: none;
  background: transparent;
  color: var(--primary-color);
  cursor: pointer;
}

.imagen {
  width: 120px;
  height: auto;
  padding-bottom: 10px;
  padding-top: 3px;
}

.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 30px 20px;
  border-bottom: 1px solid var(--section-separator);
  animation: fadeIn 0.6s ease;
}

.filtros input,
.filtros select {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  background-color: white;
  transition: box-shadow 0.3s ease;
}

.filtros input:focus,
.filtros select:focus {
  box-shadow: 0 0 5px var(--primary-color);
  outline: none;
}

.filtros input {
  width: 250px;
}

.filtros select {
  width: 150px;
}

.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 300px));
  gap: 20px;
  padding: 5px;
  animation: fadeIn 0.7s ease;
  justify-content: center;
 }

.product-card {
  position: relative;
  width: 95%;
  max-width: 300px;
  min-height: 200px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: px;
  margin: 10px auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
  box-sizing: border-box;
}


.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.imagenes-producto img,
.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  background-color: #fff;
  transition: transform 0.3s;
  display: block;
  margin-bottom: 15px;
}

.imagenes-producto img:hover,
.product-card img:hover {
  transform: scale(1.05);
}

.titulo {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  color: #222;
  min-height: 48px;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.precio {
  font-size: 1.1em;
  color: #2ecc71;
  font-weight: bold;
  text-align: center;
  margin-bottom: 8px;
  min-height: 1em; /* 1 líneas */
  font-family: 'Arial', sans-serif;
  letter-spacing: 0.5px;
  line-height: 1.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}



.vendedor {
  font-size: 13px;
  color: #555;
  text-align: center;
  height: 2.6em;
  line-height: 1.3em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}





.estado {
  font-size: 13px;
  color: #999;
  text-align: center;
  min-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.descripcion .short-desc {
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.descripcion .full-desc {
  display: none;
}

.descripcion.expanded .full-desc {
  display: inline;
}

.descripcion.expanded .short-desc {
  display: none;
}

.toggle-desc {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-color);
  cursor: pointer;
  user-select: none;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.toggle-desc:hover {
  color: var(--hover-color);
}

.buy-button {
  margin-top: auto;
  width: 80%;
  padding: 12px 0;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  border-radius: var(--radius);
  background-color: var(--primary-color);
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(6, 6, 6, 0.5);
  align-self: center;
  margin-top: 5px;
  background-color: #25d366;
}



.buy-button:hover {
  background-color: var(--hover-color);
  transform: scale(1.05);
}

.badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--primary-color);
  color: white;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 10;
  pointer-events: none;
}

.badge.nuevo { background-color: #1b65fa; }
.badge.usado { background-color: #d33f00; }

.side-menu {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100%;
  background-color: #262626;
  color: white;
  padding-top: 2rem;
  transition: left 0.3s ease;
  z-index: 1000;
}

.side-menu.open { left: 0; }
.side-menu ul { list-style: none; padding: 0; }
.side-menu ul li { padding: 1rem; }
.side-menu ul li a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}
.side-menu ul li:hover { background-color: #333; }
.side-menu a.active {
  background-color: #444;
  font-weight: bold;
  border-left: 5px solid var(--primary-color);
}

.rede { height: 1.8em; vertical-align: middle; }
.redee { height: 2.2em; background-color: #c0392b; border-radius: 5px; }


.lightbox, .lightbox img {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px #000;
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
}

.contenido-producto {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDesc {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive para móviles */
@media (max-width: 600px) {
  .container {
    grid-template-columns: repeat(2, 1fr);
  }
  .filtros input,
  .filtros select {
    width: 100%;
  }
  .buy-button {
    width: 100%;
  }
}





@media (max-width: 480px) {
  .product-card {
    max-width: 100%;
  }
}

@media (min-width: 900px) {
  .imagenes-producto img,
  .product-card img {
    height: 275px;
  }

  .container {
    grid-template-columns: repeat(auto-fill, minmax(320px, 320px));
    gap: 20px;
  }
}
.descripcion .short-desc {
  min-height: 3.0em; /* 3 líneas de texto, con line-height 1.3em */
  line-height: 1.3em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 10px;
  padding-bottom: 10px;
}

.descripcion .full-desc {
  display: none;
}
.descripcion.expanded .full-desc {
  display: inline;
}
.descripcion.expanded .short-desc {
  display: none;
}

.modal {
  display: none; /* o block cuando esté visible */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fff;
  margin: 50px auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh; /* Limita la altura */
  overflow-y: auto; /* Habilita el scroll vertical si es necesario */
  position: relative;
  text-align: center; /* Centra el contenido inline como el botón */
}


.modal-content img {
  max-width: 100%;
  border-radius: 10px;
}

.close-modal {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 28px;
  cursor: pointer;
}

.buy-link {
  margin: 15px auto 0 auto; /* top: 15px, horizontal: auto, bottom: 0 */
  display: block; /* o flex si lo necesitas */
  background-color: #25d366;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  text-decoration: none;
  width: fit-content; /* evita que ocupe toda la línea */
}


#modal-img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 10px;
}

@media (min-width: 768px) {
  #modal-img {
    max-height: 400px;
  }
}
body.dark {
  background-color: #222222;
}
/* Botón Modo Oscuro */
.modo-btn {
  font-size: 22px;
  border: none;
  background: transparent;
  color: var(--primary-color);
  cursor: pointer;
  transition: transform 0.2s ease, color 0.3s ease;
  padding: 5px 10px;
}

.modo-btn:hover {
  transform: scale(1.2);
  color: #ffffff;
}

.share-button {
  background-color: #56bafd;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  margin: 5px auto 10px auto;
  display: block;
  transition: background-color 0.3s ease;
}

.share-button:hover {
  background-color: #01050a;
}

.badge.nuevo { background-color: #1b65fa; font-size: 10px; }
.badge.usado { background-color: #d33f00; font-size: 10px;}

.visor-oculto {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}

#visor-img-grande img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#cerrar-visor {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}
.btn-flotante {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #56bafd;
  color: white;
  font-size: 22px;
  padding: 14px 18px;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 999;
  transition: background-color 0.3s ease;
}

.btn-flotante:hover {
  background-color: #090909;
}

.skeleton-card {
  background: #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  animation: pulse 1.5s infinite ease-in-out;
  width: 100%;
  max-width: 220px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-img {
  width: 100%;
  height: 180px;
  background: #d0d0d0;
  border-radius: 8px;
}

.skeleton-line {
  height: 15px;
  background: #d0d0d0;
  border-radius: 4px;
}

.skeleton-line.short {
  width: 50%;
}
.skeleton-line.medium {
  width: 80%;
}
.skeleton-line.long {
  width: 100%;
}

@keyframes pulse {
  0% { background-color: #e0e0e0; }
  50% { background-color: #f0f0f0; }
  100% { background-color: #e0e0e0; }
}

.side-menu {
  height: 100vh;              /* Toda la altura de la pantalla */
}

.side-menu ul {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  margin: 0;
}

.side-menu li {
  list-style: none;
  padding: 10px;
}

/* Instalar App al fondo */
#install-li {
  margin-top: auto;
}
.delete-button {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: #e53e3e;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.delete-button:hover {
  background: #c53030;
}
.delete-button {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: #e53e3e;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.delete-button:hover {
  background: #c53030;
}
h1 {
  margin-bottom: 24px;
  font-size: 1.75rem;
  background-color: #0acaffae;
  color: #ffffff;
  text-align: center;
}


/* Estilos del formulario de edición */
#modal-editar .modal-content {
  background-color: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 30px;
  max-width: 500px;
  margin: 30px auto;
}

#modal-editar h2 {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 25px;
  text-align: center;
}

#modal-editar input,
#modal-editar select {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 15px;
  background-color: #fff;
  transition: all 0.3s ease;
}

#modal-editar input:focus,
#modal-editar select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px #55aff872;
}

#modal-editar button {
  width: 100%;
  padding: 14px;
  background-color: var(--primary-color);
  color: white;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.3s ease, transform 0.2s;
}

#modal-editar button:hover {
  background-color: var(--hover-color);
  transform: translateY(-1px);
}

/* Espaciado y estilos para los placeholders */
#modal-editar input::placeholder,
#modal-editar select::placeholder {
  color: #aaa;
  font-style: italic;
}


/* Estilo del botón de editar */
.edit-button {
  background-color: #f9f9f9;  /* Fondo suave, color claro */
  color: var(--primary-color); /* Color primario (azul) para el texto */
  font-size: 16px;
  font-weight: 500;
  border: 1px solid var(--border-color); /* Borde suave */
  border-radius: var(--radius); /* Bordes redondeados */
  padding: 10px 20px;  /* Espaciado interno */
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s; /* Efectos de transición */
}

.edit-button:hover {
  background-color: var(--hover-color);  /* Color de fondo cuando el cursor está sobre el botón */
  color: rgba(255, 255, 255, 0.808);  /* Cambiar color del texto a blanco */
  transform: translateY(-1px);  /* Efecto de "flotado" */
}

.edit-button:focus {
  outline: none;
  border-color: var(--primary-color); /* Resaltar el borde con el color primario al enfocar */
  box-shadow: 0 0 0 3px #55aff872; /* Efecto de sombra suave */
}

/* Estilo para la "X" de cerrar el modal */
.close-modal-edit {
  position: absolute;
  top: 10px;  /* Mantenerla cerca de la parte superior */
  right: 10px;  /* Mantenerla en la esquina superior derecha */
  font-size: 50px;  /* Tamaño de la "X" más grande */
  color: #f50808;  /* Color blanco para la "X" */
  background-color: transparent;  /* Fondo transparente */
  border: none;
  cursor: pointer;
  padding: 5px;  /* Espaciado alrededor */
}

/* Evitar borde cuando tiene el foco */
.close-modal-edit:focus {
  outline: none;
}

/* Ajustes para pantallas móviles */
@media (max-width: 600px) {
  .close-modal-edit {
    font-size: 50px;  /* Reducir el tamaño de la "X" en dispositivos pequeños */
    top: 5px;  /* Ajustar un poco la posición en pantallas más pequeñas */
    right: 5px;  /* Hacer la posición más ajustada */
  }
}




@media (max-width: 768px) {
  #modal {
    align-items: flex-start; /* coloca el modal desde arriba */
    padding: 20px 0; /* espacio arriba y abajo */
    overflow-y: auto; /* scroll general si el contenido es muy largo */
  }

  .modal-content {
    width: 95%;
    max-height: 85vh;  /* 👈 no usar 100% de la pantalla */
    overflow-y: auto;  /* permite scroll dentro del modal */
    border-radius: 12px;
    margin: 0 auto;
  }

  body.modal-abierto {
    overflow: hidden;  /* evita scroll del fondo */
  }
}
