/* Estilos para el Modelo de Partículas 3D */
#particle-model-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  z-index: 3000;
  /* Por encima de todo */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  display: none;
  /* Oculto por defecto */
}

#particle-model-overlay.active {
  opacity: 1;
  pointer-events: all;
  display: block;
}

#particle-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

#particle-close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 3001;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s;
}

#particle-close-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.2);
}

/* Adaptación de style.css original */
#particle-info {
  position: absolute;
  top: 10px;
  width: 100%;
  text-align: center;
  z-index: 100;
  pointer-events: none;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  opacity: 0.7;
  text-transform: uppercase;
  color: white;
  mix-blend-mode: difference;
  font-family: 'Inter', sans-serif;
}

#product-tooltip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px;
  border-radius: 12px;
  pointer-events: none;
  text-align: left;
  display: none;
  z-index: 200;
  width: 280px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
  font-family: sans-serif;
  color: white;
}

#product-tooltip img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 15px;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
}

#product-tooltip h2 {
  margin: 0 0 5px 0;
  font-size: 1.2rem;
  font-weight: 600;
}

#product-tooltip .price {
  font-size: 1.5rem;
  color: #4ade80;
  font-weight: 700;
  margin: 5px 0;
}

#product-tooltip .sales {
  font-size: 0.9rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 5px;
}

#product-tooltip .sales-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 5px #4ade80;
}

#ui-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: sans-serif;
}

.topic-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
}

.topic-selector {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 1rem;
  border-radius: 30px;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  min-width: 200px;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
}

.topic-selector:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.7rem;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: rgba(255, 255, 255, 0.6);
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
  #particle-info {
    top: 70px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }

  #particle-info h1 {
    font-size: 1.5rem !important;
    line-height: 1.2;
    margin-bottom: 5px;
  }

  #particle-info p {
    font-size: 0.8rem;
  }

  /* Move bottom controls up slightly to clear native bars */
  #ui-controls {
    bottom: 80px;
    width: 90%;
  }

  .topic-selector {
    width: 100%;
    min-width: unset;
    font-size: 0.9rem;
    padding: 12px;
  }

  /* Adjust Close Button */
  #particle-close-btn {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  /* Tooltip Mobile: Centered Fixed Popup */
  #product-tooltip {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 85vw !important;
    max-width: 350px !important;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 9999;
    margin: 0;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  }

  #product-tooltip img {
    height: auto;
    max-height: 300px;
    object-fit: contain;
    background: white;
    /* Ensure visibility for transparent PNGs */
  }

  /* Hide technical debug controls on mobile to prevent clutter */
  .lil-gui,
  .lil-gui.autoPlace {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}