/* ============================================
   PREMIUM UI — Tipografía, nav, hologramas
   ============================================ */

:root {
  --font-display: 'Orbitron', 'Rajdhani', sans-serif;
  --font-ui: 'Rajdhani', 'Plus Jakarta Sans', sans-serif;
  --holo-cyan: #67e8f9;
  --holo-magenta: #e879f9;
  --holo-gold: #fbbf24;
  --text-detail: rgba(226, 232, 240, 0.78);
}

/* —— Navbar —— */
.navbar {
  border-bottom: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(251, 191, 36, 0.08);
  animation: navBarGlow 5s ease-in-out infinite alternate;
}

@keyframes navBarGlow {
  0% { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 18px rgba(251, 191, 36, 0.06); }
  100% { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 28px rgba(52, 211, 153, 0.12); }
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.1rem, 2.5vw, 1.65rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(
    105deg,
    #fef3c7 0%,
    var(--holo-gold) 25%,
    #86efac 50%,
    var(--holo-gold) 75%,
    #fef3c7 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brandShimmer 7s linear infinite;
  filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.45));
}

@keyframes brandShimmer {
  0% { background-position: 0% center; }
  100% { background-position: 220% center; }
}

.nav-quad,
.nav-icon-btn {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    transform 0.25s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

.nav-quad:hover,
.nav-icon-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.25);
}

.nav-quad.active,
.nav-icon-btn.active {
  animation: navPulse 2.2s ease-in-out infinite;
}

@keyframes navPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(251, 191, 36, 0.45); }
  50% { box-shadow: 0 0 26px rgba(251, 191, 36, 0.7), 0 0 40px rgba(52, 211, 153, 0.2); }
}

/* —— Barra de categorías —— */
.category-index {
  font-family: var(--font-ui);
  border-bottom: 1px solid rgba(251, 191, 36, 0.28);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: categoryBarSlide 0.6s ease-out;
}

@keyframes categoryBarSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  transition:
    transform 0.28s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.28s ease,
    background 0.28s ease;
}

.category-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3);
  color: #fef3c7;
}

.category-btn.active {
  animation: categoryActiveGlow 2.5s ease-in-out infinite;
  transform: scale(1.04);
}

@keyframes categoryActiveGlow {
  0%, 100% {
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.55), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 28px rgba(251, 191, 36, 0.85), 0 0 36px rgba(103, 232, 249, 0.25);
  }
}

.category-section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--holo-gold), #fef3c7, #86efac);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sectionTitleFloat 4s ease-in-out infinite alternate;
}

@keyframes sectionTitleFloat {
  0% { filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.35)); }
  100% { filter: drop-shadow(0 0 18px rgba(52, 211, 153, 0.35)); }
}

/* —— Jerarquía en tarjeta: nombre / detalle / precio —— */
.product-container .product-name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.05em;
  margin: 0.35rem 0 0.25rem;
  padding: 0;
  background: linear-gradient(135deg, #fffbeb 0%, var(--holo-gold) 45%, #a7f3d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 12px rgba(251, 191, 36, 0.35));
}


.product-description-scroll {
  height: 5.15rem;
  min-height: 5.15rem;
  max-height: 5.15rem;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.5rem 0.35rem 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.12);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--holo-gold) rgba(0, 0, 0, 0.35);
}

/* Cuando contiene campos estructurados: sin altura fija, sin scroll */
.product-description-scroll:has(.detail-modal-grid) {
  height: auto;
  min-height: auto;
  max-height: none;
  overflow-y: visible;
  padding: 0.8rem 0.5rem 0.8rem 0;
}

.product-description-scroll:focus {
  outline: 1px solid rgba(251, 191, 36, 0.45);
  outline-offset: 2px;
}

.product-description-scroll::-webkit-scrollbar {
  width: 6px;
}

.product-description-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
}

.product-description-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-primary-light), var(--accent-primary-dark));
  border-radius: 6px;
}

.product-description {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-detail);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.product-price {
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  padding: 0.5rem 0;
  margin-top: 0.25rem;
}

.product-price-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.65);
  width: 100%;
}

.product-price-current {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #fef08a, var(--holo-gold), #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pricePulse 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

@keyframes pricePulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.45)); }
  50% { filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.85)); }
}

.product-stock {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(167, 243, 208, 0.9);
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.12);
}

/* —— Efecto holográfico en cards —— */
.product-container.holo-card {
  --mx: 50%;
  --my: 50%;
  --rx: 0deg;
  --ry: 0deg;
  --holo-intensity: 0.3;
  -webkit-transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  isolation: isolate;
  transition:
    -webkit-transform 0.35s ease-out,
    transform 0.35s ease-out,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.product-container.holo-card .holo-overlay,
.product-container.holo-card .holo-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.product-container.holo-card .holo-overlay {
  background: conic-gradient(
    from 0deg at var(--mx) var(--my),
    rgba(255, 107, 157, 0.5),
    rgba(192, 132, 252, 0.45),
    rgba(96, 165, 250, 0.45),
    rgba(52, 211, 153, 0.4),
    rgba(251, 191, 36, 0.5),
    rgba(255, 107, 157, 0.5)
  );
  opacity: 0;
  mix-blend-mode: color-dodge;
  -webkit-mix-blend-mode: color-dodge;
  transition: opacity 0.15s ease-out;
}

.product-container.holo-card .holo-glare {
  background:
    repeating-linear-gradient(
      118deg,
      transparent 0%,
      rgba(255, 255, 255, 0.02) 1.5%,
      rgba(255, 255, 255, 0.14) 2.5%,
      transparent 3.5%
    ),
    radial-gradient(
      circle at var(--mx) var(--my),
      rgba(255, 255, 255, 0.22) 0%,
      transparent 55%
    );
  opacity: 0;
  mix-blend-mode: overlay;
  -webkit-mix-blend-mode: overlay;
  transition: opacity 0.15s ease-out;
  will-change: background-position;
}


@keyframes holoScan {
  0% { background-position: 0% 0%, 0% 0%; }
  100% { background-position: 200% 0%, 0% 0%; }
}

@keyframes holoFoilShimmer {
  0%, 100% {
    filter: hue-rotate(0deg) saturate(1.05);
  }
  50% {
    filter: hue-rotate(28deg) saturate(1.2);
  }
}

/* Escritorio: holograma solo con el mouse */
@media (hover: hover) and (pointer: fine) {
  .product-container.holo-card:not(.holo-touch) .holo-glare {
    animation: holoScan 4s linear infinite;
  }

  .product-container.holo-card:not(.holo-touch):hover .holo-overlay {
    opacity: 0.42;
  }

  .product-container.holo-card:not(.holo-touch):hover .holo-glare {
    opacity: 0.55;
  }

  .product-container.holo-card:not(.holo-touch):hover {
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow:
      0 28px 70px rgba(0, 0, 0, 0.7),
      0 0 40px rgba(251, 191, 36, 0.2),
      0 0 60px rgba(103, 232, 249, 0.12);
  }
}


/* Android / tactil: foil tipo carta, scroll + intensidad baja */
@media (hover: none) and (pointer: coarse) {

  .product-container.holo-card.holo-touch .holo-overlay {
    opacity: calc(0.12 + var(--holo-intensity, 0.32) * 0.14);
    mix-blend-mode: screen;
    -webkit-mix-blend-mode: screen;
    background:
      conic-gradient(
        from 0deg at var(--mx) var(--my),
        rgba(255, 120, 170, 0.38),
        rgba(180, 140, 255, 0.34),
        rgba(100, 180, 255, 0.34),
        rgba(80, 220, 180, 0.3),
        rgba(255, 210, 100, 0.38),
        rgba(255, 120, 170, 0.38)
      ),
      linear-gradient(
        128deg,
        transparent 38%,
        rgba(255, 255, 255, 0.06) 48%,
        rgba(200, 230, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.06) 52%,
        transparent 62%
      );
    animation: holoFoilShimmer 8s ease-in-out infinite;
    transition:
      opacity 0.45s ease,
      -webkit-transform 0.45s ease,
      transform 0.45s ease;
  }

  .product-container.holo-card.holo-touch .holo-glare {
    opacity: calc(0.26 + var(--holo-intensity, 0.32) * 0.22);
    mix-blend-mode: soft-light;
    -webkit-mix-blend-mode: soft-light;
    background:
      repeating-linear-gradient(
        125deg,
        transparent 0%,
        rgba(255, 255, 255, 0.015) 0.8%,
        rgba(255, 255, 255, 0.1) 1.4%,
        rgba(200, 220, 255, 0.08) 2%,
        transparent 2.6%
      ),
      radial-gradient(
        ellipse 75% 55% at var(--mx) var(--my),
        rgba(255, 255, 255, 0.16) 0%,
        transparent 58%
      );
    background-size: 180% 100%, 100% 100%;
    animation: none !important;
    transition: opacity 0.45s ease;
  }

  .product-container.holo-card.holo-touch.holo-active .holo-overlay {
    opacity: calc(0.26 + var(--holo-intensity, 0.45) * 0.22);
  }

  .product-container.holo-card.holo-touch.holo-active .holo-glare {
    opacity: calc(0.3 + var(--holo-intensity, 0.45) * 0.24);
  }

  .product-container.holo-card.holo-touch {
    border-color: rgba(251, 191, 36, 0.32);
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.62),
      0 0 22px rgba(251, 191, 36, 0.12),
      0 0 34px rgba(103, 232, 249, 0.08);
  }

  @supports not (mix-blend-mode: screen) {
    .product-container.holo-card.holo-touch .holo-overlay {
      mix-blend-mode: normal;
      background: linear-gradient(
        125deg,
        rgba(255, 107, 157, 0.22),
        rgba(192, 132, 252, 0.2),
        rgba(96, 165, 250, 0.2),
        rgba(251, 191, 36, 0.26)
      );
      opacity: calc(0.28 + var(--holo-intensity, 0.32) * 0.18);
    }

    .product-container.holo-card.holo-touch .holo-glare {
      mix-blend-mode: normal;
      opacity: calc(0.26 + var(--holo-intensity, 0.32) * 0.16);
    }
  }
}


.product-container.holo-card .carousel {
  position: relative;
  z-index: 2;
}

.product-container.holo-card .product-content {
  position: relative;
  z-index: 3;
}

/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
  .brand-title,
  .category-btn.active,
  .category-section-title,
  .product-price-current,
  .navbar,
  .product-container.holo-card .holo-overlay,
  .product-container.holo-card .holo-glare {
    animation: none !important;
  }

  .product-container.holo-card {
    -webkit-transform: none !important;
    transform: none !important;
  }

  .product-container.holo-card.holo-touch .holo-overlay {
    opacity: 0.32;
  }

  .product-container.holo-card.holo-touch .holo-glare {
    opacity: 0.34;
  }

  .nav-quad:hover,
  .category-btn:hover {
    transform: none;
  }
}
