/* ========================================
   VARIABLES & CORE
======================================== */
:root {
  --gx-navy: #1C244B;
  --gx-accent: #0B5ED7;
  --gx-blue-dark: #003966;
  --gx-white: #ffffff;
  --gx-glass: rgba(0, 0, 0, 0.6);
  --gx-radius: 12px;
  --gx-transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  --gx-bezier: cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ========================================
   SECTION & TITLE
======================================== */
.imagenes-aplicaciones {
  width: 100%;
  padding: 40px 20px;
  max-width: 1300px;
  margin: 0 auto;
}

.titulo-seccion-aplicaciones {
  text-align: center;
  font-weight: 800;
  font-size: 1.75rem;
  margin-bottom: 2.5rem;
  color: var(--gx-navy);
  letter-spacing: -0.02em;
}

/* ========================================
   GRID (MOBILE FIRST)
======================================== */
.grid-imagenes-aplicaciones {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  height: auto;
}

/* Tablet (2 columnas) */
@media (min-width: 640px) {
  .grid-imagenes-aplicaciones {
    grid-template-columns: repeat(2, 1fr);
    height: 500px;
  }
}

/* Desktop (La grilla asimétrica GaseX) */
@media (min-width: 1024px) {
  .grid-imagenes-aplicaciones {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: repeat(2, 1fr);
    height: 600px;
    gap: 16px;
  }

  .imagen-electricas-aplicaciones { grid-area: 1 / 1 / 3 / 2; }
  .imagen-napoleon-aplicaciones   { grid-area: 1 / 2 / 2 / 4; }
  .imagen-chicharra-aplicaciones  { grid-area: 2 / 2 / 3 / 3; }
  .imagen-caiman-aplicaciones     { grid-area: 2 / 3 / 3 / 4; }
}


/* ========================================
   ITEM & IMAGE
   Nota: overflow:hidden vive en .gx-image-wrap
   para que los tooltips de hotspots puedan desbordarse.
======================================== */
.imagen-aplicaciones {
  position: relative;
  border-radius: var(--gx-radius);
  background: var(--gx-navy);
  isolation: isolate;
}

.gx-image-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: var(--gx-radius);
}

/* Eleva la imagen sobre las hermanas cuando un hotspot está en hover
   para que el tooltip no quede recortado por las imágenes vecinas. */
.imagen-aplicaciones:has(.gx-hotspot-item:hover) {
  z-index: 50;
}

.imagen-aplicaciones img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--gx-transition);
  filter: brightness(0.9);
}

.imagen-aplicaciones:hover img {
  filter: brightness(1.05);
  transform: scale(1.03);
}


/* ========================================
   ETIQUETA (PESTAÑA INFERIOR IZQUIERDA)
======================================== */
.etiqueta-aplicaciones {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gx-white);
  background: var(--gx-blue-dark);
  border-radius: 0 8px 0 0;
  z-index: 5;
  letter-spacing: 0.05em;
  pointer-events: none;
}


/* ========================================
   HOTSPOTS (TRIGGERS)
======================================== */
.gx-hotspot-item {
  position: absolute;
  z-index: 20;
  cursor: pointer;
}

.gx-p-trigger {
  width: 30px;
  height: 30px;
  background: var(--gx-navy);
  color: var(--gx-white);
  border-radius: 50%;
  border: 2px solid var(--gx-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, background 0.3s ease;
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.gx-hotspot-item:hover .gx-p-trigger {
  transform: scale(1.15);
  background: var(--gx-accent);
}

.gx-p-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  animation: gxPulse 2s infinite;
  pointer-events: none;
}

@keyframes gxPulse {
  0%   { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}


/* ========================================
   TOOLTIP DESKTOP
   Oculto por default. Solo visible en desktop con hover.
======================================== */
.gx-desktop-tooltip {
  display: none;
}

@media (min-width: 1024px) {
  .gx-desktop-tooltip {
    display: block;
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 280px;
    background: var(--gx-white);
    padding: 24px 22px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: var(--gx-transition);
    z-index: 999;
    text-align: center;
    pointer-events: none;
  }

  .gx-hotspot-item::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    width: 280px;
    height: 50px;
    opacity: 0;
    pointer-events: none;
  }

  .gx-hotspot-item:hover::before {
    pointer-events: auto;
  }

  .gx-hotspot-item:hover .gx-desktop-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
  }

  .gx-tooltip-title {
    font-weight: 800;
    color: var(--gx-navy);
    font-size: 1.1rem;
    margin-bottom: 10px;
  }

  .gx-tooltip-desc {
    font-size: .9rem;
    color: #555;
    margin-bottom: 14px;
  }

  .gx-tooltip-price-original {
    font-size: .95rem;
    color: #6B7280;
    text-decoration: line-through;
    margin-bottom: 6px;
    font-weight: 600;
  }

  .gx-tooltip-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: #E63946;
    margin-bottom: 10px;
    line-height: 1.2;
  }

  .gx-tooltip-badge {
    background: #1C244B;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: .9rem;
    display: inline-block;
    margin: 6px 0 18px;
    line-height: 1.4;
  }

  .gx-tooltip-btn {
    display: inline-block;
    background: var(--gx-navy);
    color: var(--gx-white);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
  }
}


/* ========================================
   BOTTOM SHEET (MOBILE UX)
======================================== */
.gx-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 2000;
  cursor: pointer;
}

.gx-mobile-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.gx-bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -100%;
  background: var(--gx-white);
  border-radius: 20px 20px 0 0;
  padding: 30px 24px;
  transition: bottom 0.4s var(--gx-bezier);
  z-index: 2001;
  text-align: center;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
}

.gx-bottom-sheet.is-active {
  bottom: 0;
}

/* Header del sheet (pill visual + botón close) */
.gx-sheet-header {
  position: relative;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gx-sheet-pill {
  width: 40px;
  height: 4px;
  background: #d0d0d0;
  border-radius: 2px;
}

.gx-sheet-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.gx-sheet-close:hover {
  color: var(--gx-navy);
}

.gx-sheet-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gx-navy);
  margin-bottom: 10px;
}

.gx-sheet-desc {
  font-size: 1rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 25px;
}

.gx-sheet-price-original {
  font-size: .95rem;
  color: #6B7280;
  text-decoration: line-through;
  margin-bottom: 6px;
  font-weight: 600;
}

.gx-sheet-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: #E63946;
  margin-bottom: 12px;
}

.gx-sheet-badge {
  background: #1C244B;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .9rem;
  display: inline-block;
  margin: 6px 0 18px;
  line-height: 1.4;
}

.gx-sheet-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 15px;
  background: var(--gx-navy);
  color: var(--gx-white);
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: background 0.3s ease;
}

.gx-sheet-btn:hover {
  background: var(--gx-accent);
}


/* ========================================
   EDITOR PREVIEW (solo Gutenberg)
======================================== */
.is-editor-preview .gx-hotspot-item {
  cursor: default;
}