/* ALRI Keys — tema alineado al boceto (azul marino + amarillo + blanco) */
:root {
  --alri-navy: #001f3f;
  --alri-navy-deep: #001028;
  --alri-navy-mid: #011627;
  --alri-gold: #ffd700;
  --alri-gold-hover: #ffe033;
  --alri-wa: #25d366;
  --alri-accent: var(--alri-gold);
}

body {
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Héroe: portada con llaves ALRI (img/hero-portada-alri.png) + velo para legibilidad */
.alri-hero {
  position: relative;
  isolation: isolate;
}

.alri-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--alri-navy);
  background-image: url("../img/hero-portada-alri.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

.alri-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 31, 63, 0.88) 0%,
    rgba(0, 31, 63, 0.65) 42%,
    rgba(0, 31, 63, 0.9) 100%
  );
}

.alri-hero > * {
  position: relative;
  z-index: 2;
}

/* Logo tipográfico ALRI Keys (PNG con transparencia) */
.brand-logo-wordmark {
  display: block;
  height: 2.25rem;
  width: auto;
  max-width: min(220px, 58vw);
  object-fit: contain;
  object-position: left center;
}

@media (min-width: 640px) {
  .brand-logo-wordmark {
    height: 2.5rem;
    max-width: min(260px, 45vw);
  }
}

.brand-logo-wordmark-hero {
  display: block;
  height: auto;
  width: 100%;
  max-width: min(36rem, 92vw);
  max-height: clamp(5.5rem, 18vw, 10.5rem);
  object-fit: contain;
  object-position: left center;
}

/* Cabecera sitio (nav) */
.alri-topbar {
  background: #020617;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.alri-nav-shell {
  background: var(--alri-navy);
  border-bottom: 1px solid rgba(255, 215, 0, 0.12);
}

.alri-nav-link {
  color: rgba(255, 255, 255, 0.88);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.alri-nav-link:hover {
  color: #fff;
}

.alri-nav-link.is-active {
  color: #fff;
  border-bottom: 2px solid var(--alri-gold);
  padding-bottom: 0.125rem;
}

/* Botón Catálogos + submenú de categorías */
.alri-nav-main {
  flex-wrap: nowrap;
}

.alri-catalog-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.25rem;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  transition: color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

@media (min-width: 640px) {
  .alri-catalog-trigger {
    font-size: 0.75rem;
    padding: 0.5rem 0.5rem;
  }
}

.alri-catalog-trigger:hover,
.alri-catalog-trigger.is-active {
  color: #fff;
  border-bottom: 2px solid var(--alri-gold);
  padding-bottom: calc(0.5rem - 2px);
}

.alri-catalog-trigger__chev {
  opacity: 0.9;
}

.alri-catalog-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 60;
  min-width: min(18rem, 88vw);
  max-height: min(70vh, 24rem);
  overflow: auto;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 215, 0, 0.25);
  background: #001a33;
  padding: 0.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.alri-catalog-panel__link {
  display: block;
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.12s ease, color 0.12s ease;
}

.alri-catalog-panel__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.alri-catalog-panel__link.is-active {
  background: rgba(255, 215, 0, 0.16);
  color: #ffd700;
}

/* Franja de valor (debajo del héroe) */
.alri-value-strip {
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 0.75rem;
  background: rgba(0, 31, 63, 0.65);
}

.alri-value-strip svg {
  color: var(--alri-gold);
}

/* Aviso técnico en páginas de catálogo (sobre fondo oscuro) */
.alri-cat-notice,
.cat-notice {
  display: none !important;
}

.alri-cat-notice {
  border-color: rgba(255, 215, 0, 0.28) !important;
  background: rgba(255, 215, 0, 0.08) !important;
  color: rgba(254, 252, 232, 0.95) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.alri-cat-notice code {
  background: rgba(0, 0, 0, 0.35) !important;
  color: #fef9c3 !important;
}

.alri-cat-notice strong {
  color: #fff;
}

.alri-cat-notice .border-amber-200 {
  border-color: rgba(255, 215, 0, 0.25) !important;
}

/* Precios: más legibles y llamativos (valores sin cambio) */
.alri-price-badge {
  border-radius: 9999px;
  background: linear-gradient(180deg, #fff4a8 0%, #ffd700 38%, #e6b800 100%);
  box-shadow:
    0 6px 20px rgba(0, 31, 63, 0.28),
    0 0 0 2px #fff,
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.alri-price-badge__text {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.035em;
  color: #001028;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.alri-cart-price,
.alri-cart-price-total {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #001028;
}

.alri-cart-price {
  font-size: 1.0625rem;
  line-height: 1.2;
}

.alri-cart-price-total {
  font-size: 1.5rem;
  line-height: 1.15;
}

@media (min-width: 640px) {
  .alri-cart-price {
    font-size: 1.1875rem;
  }

  .alri-cart-price-total {
    font-size: 1.75rem;
  }
}

/* Imagen de producto: abre vista ampliada al hacer clic */
.catalog-img {
  cursor: zoom-in;
}

.catalog-img:focus-visible {
  outline: 2px solid rgba(0, 31, 63, 0.5);
  outline-offset: 3px;
}

.alri-catalog-lightbox {
  animation: alriLbFade 0.2s ease-out;
}

.alri-catalog-lightbox__panel {
  animation: alriLbPop 0.22s ease-out;
}

@keyframes alriLbFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes alriLbPop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tarjeta catálogo (boceto) */
.catalog-card:focus-within {
  outline: 2px solid rgba(255, 215, 0, 0.55);
  outline-offset: 3px;
}

.catalog-card.is-out .catalog-card-img-wrap::after {
  content: "AGOTADO";
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(185, 28, 28, 0.92) 45%,
    rgba(127, 29, 29, 0.88) 45%
  );
  transform: none;
  pointer-events: none;
}

.catalog-card.is-out .catalog-img {
  filter: grayscale(0.88);
  opacity: 0.7;
}

/* CTA bar “¿No encuentras…?” */
.alri-help-cta {
  background: linear-gradient(90deg, #001028 0%, #001f3f 50%, #001028 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Pie estilo mockup */
.site-alri-footer {
  background: var(--alri-navy-deep);
  color: rgba(226, 232, 240, 0.9);
}

.site-alri-footer .alri-footer-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 215, 0, 0.12);
  color: var(--alri-gold);
}

/* Cabecera legacy: logo ancho (index u otros) */
.brand-logo-fullheader {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
}

#product-grid {
  scroll-margin-top: 7rem;
  align-items: stretch;
}

#product-grid .catalog-card {
  min-height: 100%;
}

.catalog-card-body {
  min-height: 0;
}

.catalog-card .catalog-card-sku {
  word-break: break-word;
}

.product-placeholder {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.submenu-enter {
  animation: submenuIn 0.15s ease-out;
}

@keyframes submenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buscador en la barra de navegación */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.alri-nav-search {
  position: relative;
  display: none;
  min-width: 0;
}

@media (min-width: 640px) {
  .alri-nav-search:not(.alri-nav-search--mobile) {
    display: block;
    width: min(18rem, 28vw);
  }
}

.alri-nav-search--mobile {
  display: block;
  width: 100%;
}

.alri-nav-search-mobile {
  background: var(--alri-navy);
}

@media (min-width: 640px) {
  .alri-nav-search-mobile {
    display: none;
  }
}

.alri-nav-search__wrap {
  position: relative;
  width: 100%;
}

.alri-nav-search__field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.75rem;
}

.alri-nav-search__field:focus-within {
  border-color: rgba(255, 215, 0, 0.55);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.12);
}

.alri-nav-search__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: rgba(255, 215, 0, 0.95);
}

.alri-nav-search__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #f8fafc;
  font-size: 0.8125rem;
  outline: none;
  padding: 0.2rem 0;
}

.alri-nav-search__field input::placeholder {
  color: rgba(226, 232, 240, 0.45);
}

.alri-nav-search__drop {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 70;
  width: min(28rem, 92vw);
  max-height: min(70vh, 26rem);
  overflow: auto;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 215, 0, 0.28);
  background: #001a33;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  padding: 0.4rem;
}

.alri-nav-search--mobile .alri-nav-search__drop {
  left: 0;
  right: 0;
  width: 100%;
}

.alri-nav-search__drop.hidden {
  display: none;
}

.alri-nav-search__status {
  margin: 0;
  padding: 0.35rem 0.55rem 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 215, 0, 0.9);
}

.alri-nav-search__empty {
  margin: 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(226, 232, 240, 0.6);
}

.alri-page-search-note {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 215, 0, 0.9);
}

.alri-search-item {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.25rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.alri-search-item:hover {
  background: rgba(255, 215, 0, 0.08);
  border-color: rgba(255, 215, 0, 0.25);
}

.alri-search-item.is-out {
  opacity: 0.72;
}

.alri-search-item__img {
  width: 3rem;
  height: 3rem;
  border-radius: 0.45rem;
  overflow: hidden;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alri-search-item__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.alri-search-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 215, 0, 0.9);
}

.alri-search-item__name {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: #f1f5f9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.alri-search-item__price {
  text-align: right;
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffd700;
  white-space: nowrap;
}

.alri-search-item__badge {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fca5a5;
}

.catalog-card.is-search-hit {
  outline: 2px solid #ffd700;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.25);
}
