/* ================================================================
   OFFERS SECTION v3 — GX Compatible
   ================================================================ */

:root {
  --gasex-white: #ffffff;
  --gasex-dark: #1a1a1a;
  --gasex-accent: #0056b3;
  --gasex-shadow-soft: 0 10px 35px rgba(0, 0, 0, 0.07);
  --gasex-shadow-hover: 0 28px 60px rgba(0, 0, 0, 0.14);
  --transition-premium: all 0.45s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ================================================================
   SECTION BASE
   ================================================================ */

.offers-gx {
  padding: 60px 0;
  background-color: var(--gasex-white);
}

/* ================================================================
   DESCRIPCIÓN DE SECCIÓN
   ================================================================ */

.gx-section-description {
  text-align: center;
  font-size: 15px;
  color: #666;
  margin: -10px auto 36px;
  max-width: 540px;
  line-height: 1.6;
}

/* ================================================================
   HEADER TYPE 1
   ================================================================ */

.gx-header-type1 {
  margin-bottom: 14px;
  position: relative;
}

.gx-header-type1__subtitle {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--gasex-accent);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.gx-header-type1__title {
  font-weight: 900;
  font-size: 3.5rem;
  color: var(--gasex-dark);
  margin: 0 auto 20px auto;
  max-width: 900px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.gx-header-type1::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--gasex-accent);
  margin: 0 auto 10px;
  border-radius: 2px;
}

.gx-header-type1.gx-align-left  { text-align: left; }
.gx-header-type1.gx-align-center { text-align: center; }
.gx-header-type1.gx-align-right { text-align: right; }

.gx-header-type1.gx-align-left::after  { margin-left: 0; }
.gx-header-type1.gx-align-right::after { margin-left: auto; margin-right: 0; }

/* ================================================================
   HEADER TYPE 2
   ================================================================ */

.gx-header-type2 {
  display: flex;
  align-items: center;
  gap: 25px;
  width: 100%;
  margin-bottom: 14px;
}

.gx-header-type2__line {
  flex: 1;
  height: 2px;
  background: var(--gasex-dark);
}

.gx-header-type2__box {
  border: 2px solid var(--gasex-dark);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  background: var(--gasex-white);
}

.gx-header-type2__title {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gasex-dark);
}

.gx-header-type2.gx-align-left   { justify-content: flex-start; }
.gx-header-type2.gx-align-center { justify-content: center; }
.gx-header-type2.gx-align-right  { justify-content: flex-end; }

/* ================================================================
   GRID
   ================================================================ */

.offers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ================================================================
   TARJETA EXTERIOR
   ================================================================ */

.offer-card-outer {
  background: var(--gasex-white);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-premium);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--gasex-shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.offer-card-outer:hover {
  transform: translateY(-10px);
  box-shadow: var(--gasex-shadow-hover);
}

/* ================================================================
   ZONA COLOREADA (INNER)
   ================================================================ */

.offer-card-inner {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  /* altura fija: evita que el grid estire esta sección */
  height: 320px;
  flex-shrink: 0;
}

/* Imagen de fondo — derecha, tamaño contenido */
.offer-bg-image {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  left: auto;
  width: 96%;
  height: 100%;
  object-fit: contain;
  object-position: center right;
  opacity: 0.85;
  z-index: 0;
  pointer-events: none;
}

/* Placeholder cuando no hay imagen (solo editor) */
.offer-bg-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  font-weight: 600;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  z-index: 1;
}

/* Botón cambiar imagen (solo editor) */
.offer-bg-edit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.5px;
}

/* ── Texto sobre la imagen ── */

.offer-card-left {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-width: 62%; /* evita que el texto se adentre en la zona de la imagen */
  flex: 1;
}

.offer-savings-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.offer-percentage {
  display: block;
  font-size: 4rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.offer-accent-line {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.55);
  margin: 4px 0 8px;
}

.offer-category {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  text-decoration: none;
}

.offer-description {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  margin-bottom: 10px;
}

/* ================================================================
   SECCIÓN BLANCA INFERIOR (footer card)
   ================================================================ */

.offer-card-footer {
  background: var(--gasex-white);
  border-radius: 22px 22px 0 0;
  margin-top: -22px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1; /* ocupa el espacio restante → botón siempre al fondo */
}

/* ── Cajita informativa ── */

.offer-info-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 18px 16px;
}

.offer-info-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.offer-info-text {
  font-size: 13px;
  color: #444;
  line-height: 1.45;
  font-weight: 500;
}

/* ================================================================
   BOTÓN CTA
   ================================================================ */

.offer-cta-wrapper {
  padding: 14px 16px;
  margin-top: auto;
}

.offer-cta-btn {
  display: block;
  text-align: center;
  border-radius: 50px;
  padding: 13px 24px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: var(--transition-premium);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.offer-card-outer:hover .offer-cta-btn {
  filter: brightness(1.1);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

/* ================================================================
   PIE DE BLOQUE
   ================================================================ */

.offers-footer {
  margin-top: 32px;
  text-align: center;
}

.offers-footer-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.offers-footer-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.offers-footer-text {
  font-size: 13px;
  color: #777;
  font-weight: 500;
  margin: 0;
}

.offers-footer-text strong {
  color: #444;
  font-weight: 700;
}

/* ================================================================
   COMPATIBILIDAD CON MARKUP ANTIGUO (offer-card-right como columna)
   Aplica hasta que el usuario haga "Intentar recuperación" en el editor
   ================================================================ */

/* Imagen de la columna derecha → pasa a fondo absoluto */
.offer-card-right {
  position: absolute !important;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.offer-card-right img {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  left: auto;
  width: 96%; /* igual que .offer-bg-image para coherencia post-recovery */
  height: 100%;
  object-fit: contain;
  object-position: center right;
  opacity: 0.55;
  pointer-events: none;
}

/* offer-info-box y offer-cta-wrapper como hijos directos del <a> (sin offer-card-footer) */
.offer-card-outer > .offer-info-box {
  background: var(--gasex-white);
  border-radius: 22px 22px 0 0;
  margin-top: -22px;
  position: relative;
  z-index: 1;
}

.offer-card-outer > .offer-cta-wrapper {
  background: var(--gasex-white);
}

/* ================================================================
   ACCESIBILIDAD
   ================================================================ */

/* Foco visible para navegación por teclado */
.offer-card-outer:focus-visible {
  outline: 3px solid var(--gasex-accent);
  outline-offset: 3px;
}

/* Respeto por prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .offer-card-outer,
  .offer-cta-btn {
    transition: none;
  }
  .offer-card-outer:hover {
    transform: none;
  }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 1024px) {
  .offers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gx-header-type1__title {
    font-size: 2.2rem;
  }

  .offers-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .offers-gx {
    padding: 40px 0;
  }

  .gx-header-type1,
  .gx-header-type2 {
    margin-bottom: 10px;
  }

  .gx-header-type2 {
    gap: 12px;
  }

  .gx-header-type2__box {
    padding: 10px 18px;
  }

  .gx-header-type2__title {
    font-size: 0.9rem;
  }

  /* En columna única no hay stretching de grid → altura automática */
  .offer-card-inner {
    height: auto;
    min-height: 220px;
    padding-bottom: 44px;
  }

  /* Texto puede ocupar más ancho en columna única */
  .offer-card-left {
    max-width: 70%;
  }

  .offer-percentage {
    font-size: 3.2rem;
  }
}

@media (max-width: 480px) {
  .offer-card-inner {
    height: auto;
    min-height: 180px;
    padding: 20px 18px;
  }

  .offer-card-left {
    max-width: 75%;
  }

  .offer-percentage {
    font-size: 2.8rem;
  }
}

/* ============================================
   IMAGEN DESKTOP vs MOBILE
   .has-mobile-image: imagen desktop lleva texto
   en la imagen → ocultar textos en desktop,
   mostrar en mobile con imagen propia.
============================================ */

/* Imagen mobile — misma posición que la desktop, oculta en desktop */
.offer-bg-image--mobile {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  left: auto;
  width: 96%;
  height: 100%;
  object-fit: contain;
  object-position: center right;
  opacity: 0.85;
  pointer-events: none;
}

@media (min-width: 769px) {
  /* Desktop: ocultar imagen mobile y textos que ya vienen en la imagen */
  .has-mobile-image .offer-bg-image--mobile { display: none; }
  .has-mobile-image .offer-category         { display: none; }
  .has-mobile-image .offer-description      { display: none; }
}

@media (max-width: 768px) {
  /* Mobile: ocultar imagen desktop, mostrar imagen mobile y todos los textos */
  .has-mobile-image .offer-bg-image         { display: none; }
  .has-mobile-image .offer-bg-image--mobile { display: block; }
  .has-mobile-image .offer-category         { display: block; }
  .has-mobile-image .offer-description      { display: block; }
}
