/**
 * Compra tu Chery — cotización / conversión
 * Namespace: .chery-compra
 */
.chery-compra {
  --cc-red: #e31c23;
  --cc-red-dark: #c4181e;
  --cc-black: #111111;
  --cc-muted: #6b6b6b;
  --cc-line: #e6e6e6;
  --cc-white: #ffffff;
  --cc-radius: 7px;
  --cc-ease: 380ms cubic-bezier(0.22, 1, 0.36, 1);
  box-sizing: border-box;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px 40px;
  color: var(--cc-black);
  font-family: inherit;
  background: transparent;
}

.chery-compra *,
.chery-compra *::before,
.chery-compra *::after {
  box-sizing: border-box;
}

.chery-compra-stage {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.35fr) minmax(280px, 0.85fr) 44px;
  gap: 12px 28px;
  align-items: center;
  min-height: 420px;
}

.chery-compra-side-nav {
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #d8d8d8;
  background: transparent;
  color: #9a9a9a;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--cc-ease), color var(--cc-ease), background var(--cc-ease);
  align-self: center;
}

.chery-compra-side-nav:hover {
  border-color: #bdbdbd;
  color: var(--cc-black);
}

.chery-compra-side-nav:focus-visible {
  outline: 2px solid var(--cc-red);
  outline-offset: 2px;
}

.chery-compra-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 8px 0;
  background: transparent !important;
}

.chery-compra-visual::before,
.chery-compra-visual::after,
.chery-compra-visual-frame::before,
.chery-compra-visual-frame::after {
  content: none !important;
  display: none !important;
}

.chery-compra-visual-frame {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.chery-compra-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  object-position: center;
  background: transparent !important;
  opacity: 1;
  transition: opacity var(--cc-ease), transform var(--cc-ease);
  filter: none;
}

.chery-compra-visual.is-fading img {
  opacity: 0;
  transform: translateY(8px);
}

.chery-compra-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
}

.chery-compra h3.chery-compra-model-name,
.chery-compra .chery-compra-model-name {
  margin: 0 !important;
  padding: 0 !important;
  font-size: clamp(1.85rem, 2.5vw, 2.4rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.05 !important;
  color: #111111 !important;
  background: transparent !important;
  text-shadow: none !important;
}

.chery-compra-category {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cc-black);
}

.chery-compra-category[hidden],
.chery-compra-single-version[hidden],
.chery-compra-versions-block[hidden] {
  display: none !important;
}

.chery-compra-single-version {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cc-muted);
}

.chery-compra-versions-label {
  margin: 4px 0 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--cc-muted);
}

.chery-compra-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chery-compra-version-btn {
  appearance: none;
  border: 1px solid #d0d0d0;
  background: var(--cc-white);
  color: var(--cc-black);
  padding: 8px 16px;
  min-width: 64px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--cc-radius);
  transition: border-color var(--cc-ease), color var(--cc-ease), background var(--cc-ease);
}

.chery-compra-version-btn:hover {
  border-color: var(--cc-black);
}

.chery-compra-version-btn:focus-visible {
  outline: 2px solid var(--cc-red);
  outline-offset: 2px;
}

.chery-compra-version-btn.is-active {
  border-color: var(--cc-red);
  color: var(--cc-red);
  background: #fff7f7;
}

.chery-compra-colors-label {
  margin: 8px 0 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--cc-muted);
}

.chery-compra-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.chery-compra-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
  transition: transform 220ms ease, box-shadow var(--cc-ease);
  background: #ccc;
}

.chery-compra-swatch:hover {
  transform: scale(1.06);
}

.chery-compra-swatch:focus-visible {
  outline: 2px solid var(--cc-red);
  outline-offset: 3px;
}

.chery-compra-swatch.is-active {
  box-shadow: 0 0 0 2px var(--cc-white), 0 0 0 3.5px #333333;
}

.chery-compra-color-name {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cc-black);
}

.chery-compra-ctas {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-top: 12px;
}

.chery-compra-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 7px !important;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: background var(--cc-ease), color var(--cc-ease), border-color var(--cc-ease), transform 200ms ease;
}

.chery-compra-btn:hover {
  text-decoration: none !important;
  transform: translateY(-1px);
}

.chery-compra-btn:focus-visible {
  outline: 2px solid var(--cc-red);
  outline-offset: 3px;
}

.chery-compra-btn-primary {
  background: var(--cc-red);
  color: var(--cc-white) !important;
  border: 1px solid var(--cc-red);
}

.chery-compra-btn-primary:hover {
  background: var(--cc-red-dark);
  border-color: var(--cc-red-dark);
  color: var(--cc-white) !important;
}

.chery-compra-model-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 4px;
}

.chery-compra-model-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cc-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 0;
  transition: color var(--cc-ease);
}

.chery-compra-model-link:hover {
  color: var(--cc-black);
}

.chery-compra-model-link:focus-visible {
  outline: 2px solid var(--cc-red);
  outline-offset: 3px;
}

@media (max-width: 1024px) {
  .chery-compra-stage {
    grid-template-columns: 40px minmax(0, 1fr) minmax(260px, 0.9fr) 40px;
    gap: 10px 16px;
    min-height: 0;
  }

  .chery-compra-visual img {
    max-height: 340px;
  }
}

@media (max-width: 767px) {
  /* Tighten Elementor chrome only when it wraps Compra */
  .elementor-element:has(.chery-compra),
  .elementor-widget-html:has(.chery-compra),
  .elementor-element:has(.chery-compra) > .elementor-widget-container,
  .elementor-element:has(.chery-compra) .e-con-inner {
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .chery-compra {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 22px 28px;
  }

  .chery-compra-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    min-height: 0;
    width: 100%;
    align-items: start;
  }

  .chery-compra-side-nav {
    display: none !important;
  }

  .chery-compra-visual {
    order: 1;
    min-height: 0;
    height: auto;
    padding: 8px 0 0;
    width: 100%;
    max-width: 100%;
  }

  .chery-compra-visual-frame {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .chery-compra-visual img {
    display: block;
    width: 92%;
    max-width: 400px;
    height: auto;
    max-height: 210px;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
  }

  .chery-compra-visual.is-fading img {
    transform: none;
  }

  .chery-compra-info {
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 22px 0 0;
  }

  .chery-compra h3.chery-compra-model-name,
  .chery-compra .chery-compra-model-name {
    margin: 0 0 4px !important;
    font-size: 1.7rem !important;
    line-height: 1.1 !important;
  }

  .chery-compra-category {
    margin: 0;
  }

  .chery-compra-versions-block,
  .chery-compra-single-version:not([hidden]) {
    margin-top: 14px;
  }

  .chery-compra-colors-label {
    margin: 26px 0 10px;
  }

  .chery-compra-swatches {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }

  .chery-compra-swatch {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }

  .chery-compra-color-name {
    margin: 10px 0 0;
  }

  .chery-compra-ctas {
    width: 100%;
    max-width: none;
    margin-top: 26px;
  }

  .chery-compra-btn {
    width: 100%;
  }

  .chery-compra-model-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin-top: 14px;
    padding-top: 0;
    justify-content: stretch;
  }

  .chery-compra .chery-compra-model-link {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 10px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 7px;
    background: #fafafa;
    color: #111111;
    font-size: 0;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1;
  }

  .chery-compra .chery-compra-model-link:hover {
    color: #111111;
    background: #f3f3f3;
  }

  .chery-compra .chery-compra-model-link[data-cc-prev-text]::before {
    content: "‹ Anterior";
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .chery-compra .chery-compra-model-link[data-cc-next-text]::before {
    content: "Siguiente ›";
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}
