/* Fondo oscuro y modal centrado */
#product-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999999;
}

#product-popup.show {
  display: flex !important;
}

.popup-inner {
  background: #fff;
  padding: 20px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

/* BotÃ³n de cierre */
#popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 30px;
  cursor: pointer;
  z-index: 2;
}

/* Slider container */
#popup-slider {
  position: relative;
  overflow: hidden;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
}

/* ImÃ¡genes del slider */
#popup-slider img {
  width: 100%;
  max-width: 300px;
  height: 300px; /* Fijamos la altura para que funcione el cover */
  object-fit: cover; /* Â¡Clave aquÃ­! */
  border-radius: 16px;
  display: none;
  user-select: none;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}


/* Imagen visible */
#popup-slider img.active {
  display: block;
}

/* Flechas de navegaciÃ³n */
#popup-slider .nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
  color: rgba(0,0,0,0.5);
  cursor: pointer;
  user-select: none;
  padding: 8px;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  transition: background 0.2s;
}

#popup-slider .nav-arrow:hover {
  background: rgba(255,255,255,1);
}

#popup-slider .nav-arrow.prev {
  left: 10px;
}

#popup-slider .nav-arrow.next {
  right: 10px;
}

/* Precio */
.popup-price {
  font-size: 20px;
  color: #000;
  font-weight: bold;
  text-align: center;
}

/* Variaciones */
.popup-variations {
  margin-top: 10px;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.popup-variation-btn {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f8f8f8;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
  display: inline-flex;
  white-space: nowrap;
  align-itrms: center;
}

.popup-variation-btn.selected {
  border-color: #165b33;
  background: #165b33;
  color: #fff;
}

.popup-qty {
  display: flex;
  align-items: center;
  justify-content: center; 
  gap: 5px;
  margin: 10px 0;
  flex-direction:column;
}

.qty-buttons {
  display:flex;
  justify-content:center;
  align-items: center;
  gap: 5px;
}

.qty-buttons button {
  padding: 4px 10px !important;
  font-size: 16px !important;
  background-color: #165b33 !important;
  border: none !important;
  cursor: pointer !important;
  border-radius: 3px !important;
  color: white;
}

.qty-input {
  width: 60px;
  text-align: center;
}

.popup-add-to-cart {
  background: #165b33;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.popup-add-to-cart.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.product-card {
  cursor: pointer;
}

.popup-variation-btn:hover {
  background: #eee;
}

/* DescripciÃ³n */
#popup-description {
  margin-top: 15px;
  text-align: center;
  font-size: 14px;
  color: #444;
  flex-grow: 1;
  overflow:hidden;
}
.popup-desc {
  max-height: 150px; /* ðŸ‘ˆ ajusta este valor segÃºn lo que quieras mostrar */
  overflow-y: auto; /* activa el scroll vertical */
  padding-right: 8px; /* evita que el scroll tape el texto */
  line-height: 1.5;
}

/* Scroll estilizado */
.popup-desc::-webkit-scrollbar {
  width: 6px;
}
.popup-desc::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

#popup-title h2 {
    text-align: center;
}
.variation-price {
  font-size: 15px;
  color: #555;
}

/* Responsive ajustes */
@media only screen and (max-width: 600px) {
  #popup-slider img {
    max-width: 250px;
    max-height: 250px;
  }

  .popup-inner {
    width: 95%;
    padding: 15px;
  }

  #popup-slider .nav-arrow {
    font-size: 24px;
    padding: 6px;
  }

  .popup-price {
    font-size: 18px;
  }
}
/*Barra de busqueda*/
/* BotÃ³n de lupa */
.search-btn {
  background: black;
  color: white;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 20px;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
}

/* Modal de bÃºsqueda */
#search-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: start;
  z-index: 10000;
}

.search-modal-inner {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  position: relative;
  margin-top: 100px;
}

#search-close {
  position: absolute;
  top: 8px; right: 10px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

#search-input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

#search-results {
  margin-top: 10px;
  list-style: none;
  padding: 0;
  max-height: 250px;
  overflow-y: auto;
}

#search-results li {
  display: flex;
  align-items: center;
  padding: 8px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

#search-results img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  margin-right: 10px;
  border-radius: 6px;
}
