/* ================================
   EMGRAND – Versión (Elige tu versión ideal)
   Sección 1 del configurador, según Figma
================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.emg-version {
  position: relative;
  max-width: 100%;
  width: 100%;
  aspect-ratio: 1440 / 798;
  padding: 40px 24px 40px;
  color: #03050f;

  /* Fondo por defecto si no hay imagen */
  background-color: #f4f4f4;

  /* Imágenes desde CSS vars (inline style en PHP) */
  background-image: var(--emg-config-bg-desktop);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  overflow-x: clip;
  margin-top: 0;
}
@supports not (overflow: clip) {
  .emg-version {
    overflow-x: hidden;
  }
}

.emg-version__inner {
  max-width: 1240px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Top bar: título + tabs en la misma fila */

.emg-version__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 8px;
  padding-top: 18px;
}

.emg-version__header {
  text-align: left;
}

.emg-version__title {
  text-transform: uppercase;
  margin: 0;
  font-weight: 700;
  font-size: 48px;
  line-height: 120%;
  letter-spacing: 0;
  color: #0B0C0C;
  font-family: var(--font-geely);
  max-width: 550px
}

/* Tabs — estilo pill (Figma) */

.emg-version__tabs {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 100px;
  padding: 4px;
  gap: 2px;
  //backdrop-filter: blur(8px);
  box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.08);
}

.emg-version__tab {
  font-family: var(--font-inter);
  border: none;
  padding: 8px 15px;
  font-size: 16px;
  line-height: 22px;
  cursor: pointer;
  background: transparent;
  color: #555;
  border-radius: 100px;
  font-weight: 400;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.emg-version__tab.is-active {
  background: #fff;
  color: #0B0C0C;
  font-weight: 500;
  box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.12);
}

/* Paneles */

.emg-version__panels {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.emg-version__panel {
  display: none;
}

.emg-version__panel.is-active {
  display: flex;
  flex: 1;
  flex-direction: column;
}

/* Layout: relativo, ocupa toda la altura del bloque (auto en el fondo) */

.emg-version__layout {
  position: relative;
  flex: 1;
  text-align: center;
}

.emg-version__visual {
  position: absolute;
  inset: 0;
}

.emg-version__image {
  display: none;
}

/* Info: tarjeta blanca translúcida (posición/medidas exactas del Figma sobre canvas 1440x798) */

.emg-version__info {
  position: absolute;
  top: 76.94%;    
  left: 50%;                    
  width: fit-content;           
  max-width: 90%;               /* evita que se salga en pantallas chicas */
  transform: translateX(-50%);
  z-index: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;

  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  padding: 56px 90px 22px;
  backdrop-filter: blur(2px);
}



.emg-version__price-badge {
  position: absolute;
  top: 72.18%;    /* 576px / 798px */
  left: 50%;  /* 519px / 1440px */
  //width: 31.917%; /* 402px / 1440px */
  height: 63px;
  z-index: 2;
  transform: translate(-50%);
  width: auto;
  max-width: 90%;
  white-space: nowrap;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 32px;

  background: #194BFF;
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-geely);
}

.emg-version__price-label {
  font-family: var(--font-geely);
  font-size: 20px;
  font-weight: 700;
  line-height: 120%;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

.emg-version__price-line {
  font-family: var(--font-inter);
  font-size: 16px;
  font-weight: 500;
  line-height: 120%;
}

.emg-version__price-usd,
.emg-version__price-local {
  font-weight: 500;
}

.emg-version__price-or {
  margin: 0 4px;
}

/* Specs rápidas: cilindrada / velocidades / potencia */

.emg-version__specs {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 86px;
  white-space: nowrap;   
}

.emg-version__spec {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.emg-version__spec-top {
  display: block;
  align-items: center;
  gap: 7px;
}

.emg-version__spec-main-titulo {
  font-family: var(--font-inter);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  color: #0B0C0C;
  width: 134px;
  height: 1px;
  text-align: center;
  text-transform: uppercase;
}

.emg-version__spec-main {
  font-family: var(--font-geely);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  color: #0B0C0C;
  //width: 65px;
  height: 44px;
  text-align: end;
}

.emg-version__spec-main--text {
  font-family: var(--font-inter);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  height: auto;
  //white-space: normal;
  text-align: center;
  color: #444;
}


.emg-version__spec-sub {
  font-family: var(--font-inter);
  font-size: 15px;
  color: #0B0C0C;
  line-height: 1;
  font-weight: 700;
}

.emg-version__spec-meta {
  display: flex;
  align-items: center;
  
  gap: 8px;
}

.emg-version__spec-icon {
  width: 16px;
  height: 16px;
  color: #777;
  flex-shrink: 0;
}

.emg-version__spec-icon svg {
  width: 100%;
  height: 100%;
}

.emg-version__spec-tag {
  font-family: var(--font-inter);
  font-size: 12px;
  font-weight: 500;
  color: #0B0C0C;
  white-space: nowrap;
}

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

@media (max-width: 1024px) {
  .emg-version {
    padding: 48px 16px 32px;
  }

  .emg-version__title {
    font-size: 26px;
    line-height: 34px;
  }

  .emg-version__specs {
    gap: 40px;
  }

  .emg-version__spec-main {
    font-size: 32px;
  }
}
@media (max-width: 768px) {
  .emg-version {
    aspect-ratio: auto;
    height: auto;
    min-height: 600px;
    padding: 22px 16px 24px;
    background-image: var(--emg-config-bg-mobile, var(--emg-config-bg-desktop));
    background-size: cover;
    background-position: center top;
  }

  .emg-version__inner {
    max-width: 420px;
    margin: 0 auto;
    height: auto;
  }

  .emg-version__top {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
  }

  .emg-version__title {
    font-size: 32px;
    line-height: 120%;
    text-align: center;

  }

  .emg-version__tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    margin: 0 auto;
  }

  .emg-version__tabs::-webkit-scrollbar {
    display: none;
  }

  .emg-version__tab {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: max-content;
    padding: 8px 18px;
    font-size: 14px;
  }

  /* --- Layout: dejar de ser absoluto, pasar a flujo normal --- */
  .emg-version__panel.is-active {
    display: flex;
  }

  .emg-version__layout {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .emg-version__visual {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 290px;
  }

  /* Tarjeta de specs: contenedor relativo donde se incrusta el badge */
  .emg-version__info {
    position: relative;
    top: auto;
    //left: auto;
    width: 100%;
    max-width: 100%;
    margin-top: 32px; /* espacio para que el badge se solape por arriba */
    padding: 28px 20px 20px;
    gap: 20px;
    backdrop-filter: blur(4px);
    border-radius: 24px;
  }

  /* Badge: absoluto DENTRO de .emg-version__info, centrado, sobresaliendo arriba */
  .emg-version__price-badge {
    position: absolute;
    top: 290px;
    left: 51%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 320px;
    height: auto;
    margin: 0;
    padding: 10px 16px;
    gap: 2px;
    z-index: 2;
  }

  .emg-version__price-label {
    font-size: clamp(11px, 4.2vw, 16px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .emg-version__price-line {
    font-size: clamp(11px, 4.2vw, 16px);
    white-space: nowrap;
  }

  /* Specs: grid 2 columnas (Motor / Transmisión arriba, Potencia abajo centrada) */
  .emg-version__specs {
    display: flex;
    gap: 1px 24px;
    width: 100%;
    margin-top: 20px;
  }

  .emg-version__spec {
    align-items: center;
    gap: 10px;
  }

  .emg-version__specs .emg-version__spec:nth-child(3) {
    grid-column: 1 / -1;
  }

  .emg-version__spec-main {
    font-size: 22px;
    width: auto;
    height: auto;
  }

   .emg-version__spec-main-titulo {
    font-size: 14px;
    width: 136px;
    height: 20px;
    
    line-height: 2;
  }
  .emg-version__spec-sub {
    font-size: 15px;
    padding-bottom: 6.5px;
    text-transform: uppercase;
  }

  .emg-version__spec-icon {
    width: 18px;
    height: 18px;
  }

  .emg-version__spec-tag {
    font-size: 13px;
  }
}

/* Mobile muy pequeño: reducir aún más sin romper la línea */
@media (max-width: 360px) {
  .emg-version__price-badge {
    max-width: 280px;
    padding: 8px 12px;

  }

  .emg-version__price-label,
  .emg-version__price-line {
    font-size: clamp(10px, 4vw, 13px);
  }

  .emg-version__info {
    margin-top: 28px;
  }
}

/* Mobile muy pequeño: reducir aún más sin romper la línea */
@media (max-width: 360px) {
  .emg-version__price-badge {
    max-width: 280px;
    padding: 8px 12px;
  }

  .emg-version__price-label,
  .emg-version__price-line {
    font-size: clamp(10px, 4vw, 13px);
  }
}