/**
 * ZE Impact — Estilos
 * Paleta: verde #4a7f57, crema #e8ead4, negro profundo #0d1f0e
 * v1.0.0
 */

/* ── Variables globales ────────────────────────────────────────────────────── */
:root {
    --ze-green:       #4a7f57;
    --ze-green-light: #8fbe9f;
    --ze-green-deep:  #0d1f0e;
    --ze-cream:       #e8ead4;
    --ze-cream-soft:  #f5f8f5;
    --ze-amber:       #b17d00;
    --ze-text:        #1a2e1d;
    --ze-text-muted:  #5a7060;
}

/* ════════════════════════════════════════════════════════════════════════════
   WIDGET: ZE IMPACT TRIP
   ════════════════════════════════════════════════════════════════════════════ */

.ze-impact-trip {
    --ze-accent: #4a7f57;
    --ze-bg:     #f5f8f5;
    background:  var(--ze-bg);
    border:      1px solid color-mix(in srgb, var(--ze-accent) 20%, transparent);
    border-radius: 12px;
    padding:     28px 28px 22px;
    font-family: inherit;
}

/* Header */
.ze-impact-trip__header {
    display:     flex;
    align-items: center;
    gap:         10px;
    margin-bottom: 22px;
}

.ze-impact-trip__leaf {
    flex-shrink: 0;
    width:  36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ze-accent);
    color:  #fff;
    display: flex;
    align-items:     center;
    justify-content: center;
}

.ze-impact-trip__title {
    flex:      1;
    font-size: 15px;
    font-weight: 600;
    color:     var(--ze-text);
    margin:    0;
    line-height: 1.2;
}

.ze-impact-trip__total {
    font-size:   24px;
    font-weight: 700;
    color:       var(--ze-accent);
    white-space: nowrap;
    line-height: 1;
}

.ze-impact-trip__total small {
    display:     block;
    font-size:   11px;
    font-weight: 400;
    color:       var(--ze-text-muted);
    text-align:  right;
    margin-top:  2px;
}

/* Barras desglose */
.ze-impact-trip__breakdown {
    display:       flex;
    flex-direction: column;
    gap:           12px;
    margin-bottom: 22px;
}

.ze-impact-bar__head {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    margin-bottom:   5px;
}

.ze-impact-bar__label {
    font-size:   13px;
    color:       var(--ze-text);
    display:     flex;
    align-items: center;
    gap:         6px;
}

.ze-impact-bar__icon {
    font-size: 14px;
}

.ze-impact-bar__value {
    font-size:   13px;
    font-weight: 600;
    color:       var(--ze-accent);
}

.ze-impact-bar__track {
    height:        6px;
    background:    color-mix(in srgb, var(--ze-accent) 15%, transparent);
    border-radius: 99px;
    overflow:      hidden;
}

.ze-impact-bar__fill {
    height:        100%;
    width:         0;
    border-radius: 99px;
    background:    var(--ze-accent);
    transition:    width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.ze-impact-bar--animated .ze-impact-bar__fill {
    width: var(--pct);
}

/* Equivalencias */
.ze-impact-trip__equivalences {
    display: flex;
    gap:     16px;
    padding: 16px 0;
    border-top:    1px solid color-mix(in srgb, var(--ze-accent) 15%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--ze-accent) 15%, transparent);
    margin-bottom: 16px;
}

.ze-impact-equiv {
    flex:       1;
    text-align: center;
}

.ze-impact-equiv__icon {
    display:     block;
    font-size:   22px;
    line-height: 1;
    margin-bottom: 4px;
}

.ze-impact-equiv__num {
    display:     block;
    font-size:   20px;
    font-weight: 700;
    color:       var(--ze-accent);
    line-height: 1.1;
}

.ze-impact-equiv__label {
    display:   block;
    font-size: 11px;
    color:     var(--ze-text-muted);
    margin-top: 2px;
}

/* Compensación */
.ze-impact-trip__compensation {
    display:     flex;
    align-items: flex-start;
    gap:         8px;
    padding:     10px 14px;
    background:  color-mix(in srgb, var(--ze-accent) 10%, transparent);
    border-left: 3px solid var(--ze-accent);
    border-radius: 0 6px 6px 0;
    margin-bottom: 14px;
}

.ze-impact-comp__icon {
    flex-shrink: 0;
    width:  20px;
    height: 20px;
    background:    var(--ze-accent);
    color:         #fff;
    border-radius: 50%;
    display:       flex;
    align-items:     center;
    justify-content: center;
    margin-top: 1px;
}

.ze-impact-comp__text {
    font-size:   13px;
    color:       var(--ze-text);
    line-height: 1.4;
}

/* Nota metodológica */
.ze-impact-trip__note {
    font-size:  11px;
    color:      var(--ze-text-muted);
    line-height: 1.5;
    margin:     0;
    font-style: italic;
}

/* ════════════════════════════════════════════════════════════════════════════
   WIDGET: ZE IMPACT GLOBAL
   ════════════════════════════════════════════════════════════════════════════ */

.ze-impact-global {
    --ze-accent: #8fbe9f;
    padding:     60px 40px;
    border-radius: 16px;
    position:    relative;
    overflow:    hidden;
}

/* Tema oscuro */
.ze-impact-global--dark {
    background: var(--ze-green-deep);
    color:      var(--ze-cream);
}

/* Tema claro */
.ze-impact-global--light {
    background: var(--ze-cream-soft);
    color:      var(--ze-text);
    --ze-accent: #4a7f57;
}

/* Decoración de fondo — círculos concéntricos sutiles */
.ze-impact-global::before {
    content:    '';
    position:   absolute;
    top:        -80px;
    right:      -80px;
    width:      400px;
    height:     400px;
    border-radius: 50%;
    border:     1px solid color-mix(in srgb, var(--ze-accent) 12%, transparent);
    pointer-events: none;
}
.ze-impact-global::after {
    content:    '';
    position:   absolute;
    top:        -30px;
    right:      -30px;
    width:      280px;
    height:     280px;
    border-radius: 50%;
    border:     1px solid color-mix(in srgb, var(--ze-accent) 18%, transparent);
    pointer-events: none;
}

.ze-impact-global__inner {
    display:   grid;
    grid-template-columns: 1fr 1fr;
    gap:       60px;
    align-items: start;
    position:  relative;
    z-index:   1;
}

@media (max-width: 768px) {
    .ze-impact-global {
        padding: 40px 24px;
    }
    .ze-impact-global__inner {
        grid-template-columns: 1fr;
        gap:       40px;
    }
}

/* Eyebrow */
.ze-impact-global__eyebrow {
    display:     inline-flex;
    align-items: center;
    gap:         6px;
    font-size:   11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color:       var(--ze-accent);
    margin-bottom: 16px;
}

/* Tagline */
.ze-impact-global__tagline {
    font-size:   clamp(22px, 3vw, 36px);
    font-weight: 700;
    line-height: 1.15;
    margin:      0 0 16px;
    color:       inherit;
}

.ze-impact-global--light .ze-impact-global__tagline {
    color: var(--ze-green-deep);
}

/* Body */
.ze-impact-global__body {
    font-size:   15px;
    line-height: 1.65;
    opacity:     0.8;
    margin:      0 0 28px;
}

/* Compromisos */
.ze-impact-commitments {
    list-style: none;
    margin:     0;
    padding:    0;
    display:    flex;
    flex-direction: column;
    gap:        10px;
}

.ze-impact-commitment {
    display:     flex;
    align-items: flex-start;
    gap:         10px;
    font-size:   14px;
    line-height: 1.4;
    opacity:     0.85;
}

.ze-impact-commitment__check {
    flex-shrink: 0;
    width:  20px;
    height: 20px;
    border-radius: 50%;
    background:    color-mix(in srgb, var(--ze-accent) 25%, transparent);
    color:         var(--ze-accent);
    display:       flex;
    align-items:     center;
    justify-content: center;
    margin-top:    1px;
}

/* Métricas */
.ze-impact-global__metrics {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   2px;
}

.ze-impact-metric {
    padding:    28px 24px;
    background: color-mix(in srgb, var(--ze-accent) 8%, transparent);
    position:   relative;
}

.ze-impact-global--light .ze-impact-metric {
    background: color-mix(in srgb, var(--ze-accent) 10%, white);
}

.ze-impact-metric:nth-child(1) { border-radius: 12px 0 0 0; }
.ze-impact-metric:nth-child(2) { border-radius: 0 12px 0 0; }
.ze-impact-metric:nth-child(3) { border-radius: 0 0 0 12px; }
.ze-impact-metric:nth-child(4) { border-radius: 0 0 12px 0; }

.ze-impact-metric__value {
    display:     block;
    font-size:   clamp(28px, 4vw, 42px);
    font-weight: 800;
    color:       var(--ze-accent);
    line-height: 1;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}

.ze-impact-metric__label {
    display:   block;
    font-size: 12px;
    opacity:   0.65;
    line-height: 1.3;
}

/* ════════════════════════════════════════════════════════════════════════════
   WIDGET: ZE IMPACT BADGE
   ════════════════════════════════════════════════════════════════════════════ */

.ze-impact-badge {
    --ze-accent: #4a7f57;
    display:     inline-flex;
    align-items: center;
    gap:         8px;
    font-size:   13px;
    line-height: 1;
}

/* Pill */
.ze-impact-badge--pill {
    background:    color-mix(in srgb, var(--ze-accent) 10%, transparent);
    border:        1px solid color-mix(in srgb, var(--ze-accent) 25%, transparent);
    border-radius: 99px;
    padding:       7px 14px 7px 10px;
    flex-wrap:     wrap;
    gap:           6px;
}

/* Card compacta */
.ze-impact-badge--card {
    background:    color-mix(in srgb, var(--ze-accent) 8%, transparent);
    border-radius: 8px;
    padding:       10px 14px;
    border:        1px solid color-mix(in srgb, var(--ze-accent) 20%, transparent);
}

/* Inline */
.ze-impact-badge--inline {
    background: transparent;
    padding:    0;
}

.ze-impact-badge__icon {
    flex-shrink: 0;
    color:       var(--ze-accent);
    display:     flex;
    align-items: center;
}

.ze-impact-badge__text {
    font-weight: 500;
    color:       inherit;
}

.ze-impact-badge__co2 {
    color:   var(--ze-accent);
    font-weight: 600;
}

.ze-impact-badge__link {
    display:     inline-flex;
    align-items: center;
    gap:         3px;
    color:       var(--ze-accent);
    font-weight: 600;
    text-decoration: none;
    transition:  opacity 0.2s;
    margin-left: 2px;
}

.ze-impact-badge__link:hover {
    opacity: 0.75;
}

/* ── Animación al entrar en viewport ──────────────────────────────────────── */
.ze-impact-bar__fill {
    width: 0;
    transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.ze-impact-metric__value {
    opacity:   0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.ze-impact--visible .ze-impact-bar__fill {
    width: var(--pct);
}

.ze-impact--visible .ze-impact-metric__value {
    opacity:   1;
    transform: none;
}

.ze-impact-metric:nth-child(1) .ze-impact-metric__value { transition-delay: 0.05s; }
.ze-impact-metric:nth-child(2) .ze-impact-metric__value { transition-delay: 0.15s; }
.ze-impact-metric:nth-child(3) .ze-impact-metric__value { transition-delay: 0.25s; }
.ze-impact-metric:nth-child(4) .ze-impact-metric__value { transition-delay: 0.35s; }

/* ═══════════════════════════════════════════════════════════════════
   ZE Impact · Carbon Grid
   Tres modos: carousel | grid | masonry
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables locales ──────────────────────────────────────────── */
.zecg-wrap {
  --zecg-gap:     16px;
  --zecg-radius:  12px;
  --zecg-accent:  #4a7f57;
  position: relative;
}

/* ── Tarjeta base ───────────────────────────────────────────────── */
.zecg-card {
  display:         grid;          /* grid permite apilar img-wrap y body */
  grid-template:   1fr / 1fr;     /* una celda, hijos se superponen */
  overflow:        hidden;
  border-radius:   var(--zecg-radius);
  text-decoration: none;
  color:           inherit;
  background:      #1a2a1c;
  cursor:          pointer;
}

a.zecg-card:hover .zecg-card__img     { transform: scale(1.04); }
a.zecg-card:hover .zecg-card__overlay { opacity: 75% !important; }

/* ── Imagen ─────────────────────────────────────────────────────── */
.zecg-card__img-wrap {
  grid-area:    1 / 1;
  position:     relative;
  width:        100%;
  aspect-ratio: 1 / 1;
  overflow:     hidden;
  display:      flex;             /* flex hace que la img ocupe el 100% del alto */
}

.zecg-card__img-wrap > .zecg-card__img {
  flex:         1;                /* ocupa todo el espacio disponible */
  min-height:   0;
}

/* Variantes de proporción en img-wrap (el default ya es 1/1) */
.zecg-mode-grid.zecg-aspect-portrait    .zecg-card__img-wrap,
.zecg-mode-carousel.zecg-aspect-portrait .zecg-card__img-wrap { aspect-ratio: 3 / 4; }
.zecg-mode-grid.zecg-aspect-landscape   .zecg-card__img-wrap,
.zecg-mode-carousel.zecg-aspect-landscape .zecg-card__img-wrap { aspect-ratio: 4 / 3; }

.zecg-card__img {
  display:          block;
  width:            100%;
  height:           100%;
  object-fit:       cover;
  object-position:  center;
  transition:       transform 0.45s ease;
}

.zecg-card__img--placeholder {
  background: linear-gradient(135deg, #2a3d2c 0%, #1a2a1c 100%);
  height:     100%;
}

.zecg-card__overlay {
  position:   absolute;
  inset:      0;
  z-index:    1;
  background: linear-gradient(
    to top,
    rgba(10, 22, 11, 0.90) 0%,
    rgba(10, 22, 11, 0.45) 50%,
    rgba(10, 22, 11, 0.10) 100%
  );
  opacity:    1;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* ── Info superpuesta ───────────────────────────────────────────── */
.zecg-card__body {
  grid-area:      1 / 1;          /* misma celda → se superpone */
  align-self:     end;            /* se pega al fondo */
  position:       relative;
  z-index:        3;              /* encima del overlay (z-index:1) y la img */
  padding:        16px 14px 14px;
  display:        flex;
  flex-direction: column;
  gap:            8px;
  pointer-events: none;
}

.zecg-card__title {
  font-size:   14px;
  font-weight: 700;
  color:       #fff;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Bloque carbono ─────────────────────────────────────────────── */
.zecg-card__carbon {
  display:        inline-flex;
  align-items:    flex-start;
  gap:            7px;
  padding:        7px 10px;
  background:     rgba(10, 22, 11, 0.55);
  border:         1px solid rgba(255,255,255,0.14);
  border-radius:  8px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  max-width:      100%;
}

.zecg-card__carbon--empty {
  opacity: 0.5;
}

.zecg-carbon-icon {
  flex-shrink: 0;
  margin-top:  1px;
  color:       var(--zecg-accent);
  display:     flex;
}

.zecg-carbon-texts {
  display:        flex;
  flex-direction: column;
  gap:            1px;
  min-width:      0;
}

.zecg-carbon-label {
  font-size:   10px;
  line-height: 1.2;
  color:       rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
}

.zecg-carbon-value {
  font-size:   13px;
  font-weight: 700;
  color:       #fff;
  line-height: 1.25;
}

/* ═══════════════════════════════════════════════════════════════════
   MODO: GRID
   ═══════════════════════════════════════════════════════════════════ */

.zecg-mode-grid {
  display: grid;
  gap:     var(--zecg-gap);
}

.zecg-mode-grid.zecg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.zecg-mode-grid.zecg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.zecg-mode-grid.zecg-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Alturas por proporción (grid) */
/* aspect-ratio ahora en .zecg-card__img-wrap — ver bloque base */

/* ═══════════════════════════════════════════════════════════════════
   MODO: MASONRY
   ═══════════════════════════════════════════════════════════════════ */

.zecg-masonry {
  columns:     var(--zecg-cols, 3);
  gap:         var(--zecg-gap);
  column-gap:  var(--zecg-gap);
}

.zecg-mode-masonry .zecg-card {
  break-inside: avoid;
  margin-bottom: var(--zecg-gap);
  display:       block;
}

/* Masonry — altura natural de la imagen, sin aspect-ratio fijo */
.zecg-mode-masonry .zecg-card__img-wrap {
  aspect-ratio: unset;
  height:       auto;
  min-height:   180px;
}

.zecg-mode-masonry .zecg-card__img {
  height:     auto;
  min-height: 180px;
  width:      100%;
}

/* En masonry el body se superpone igualmente via CSS grid */
.zecg-mode-masonry .zecg-card__body {
  padding: 12px 12px 14px;
}

/* El overlay en masonry también funciona — ajustar si la foto es muy corta */
.zecg-mode-masonry .zecg-card__overlay {
  background: linear-gradient(
    to top,
    rgba(10,22,11,0.92) 0%,
    rgba(10,22,11,0.40) 60%,
    rgba(10,22,11,0.00) 100%
  );
}

/* ═══════════════════════════════════════════════════════════════════
   MODO: CARRUSEL
   ═══════════════════════════════════════════════════════════════════ */

.zecg-mode-carousel {
  position: relative;
}

.zecg-carousel-inner {
  overflow: hidden;
  width:    100%;
}

.zecg-track {
  display:    flex;
  gap:        var(--zecg-gap);
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Cada card en carrusel: ancho = (100% - gaps) / visible */
.zecg-mode-carousel .zecg-card {
  flex-shrink: 0;
  /* width se aplica via JS */
}

/* aspect-ratio ahora en .zecg-card__img-wrap — ver bloque base */

/* Flechas */
.zecg-arrow {
  position:        absolute;
  top:             50%;
  transform:       translateY(-50%);
  z-index:         10;
  width:           40px;
  height:          40px;
  border-radius:   50%;
  border:          none;
  background:      rgba(255,255,255,0.92);
  color:           #1a2a1c;
  display:         flex;
  align-items:     center;
  justify-content: center;
  cursor:          pointer;
  box-shadow:      0 2px 10px rgba(0,0,0,0.18);
  transition:      background 0.18s, transform 0.18s;
}

.zecg-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.zecg-arrow:disabled { opacity: 0.35; pointer-events: none; }

.zecg-arrow--prev { left:  -20px; }
.zecg-arrow--next { right: -20px; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .zecg-mode-grid.zecg-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .zecg-mode-grid.zecg-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .zecg-masonry { columns: 2; }
}

@media (max-width: 600px) {
  .zecg-mode-grid.zecg-cols-4,
  .zecg-mode-grid.zecg-cols-3,
  .zecg-mode-grid.zecg-cols-2 { grid-template-columns: 1fr; }
  .zecg-masonry { columns: 1; }
  .zecg-arrow--prev { left: 4px; }
  .zecg-arrow--next { right: 4px; }
}

