/* AgroQuipu360® — Ganadería: carrusel invertido (izq) + beneficios (der) */

.livestock-screen {
  --ls-stage-max: 1650px;
  --ls-carousel-transition: 0.62s;
  --ls-kw-green: #5aad78;
  --ls-accent-deep: #1a4d32;
  --ls-text-body: rgba(248, 250, 246, 0.98);
  --ls-text-secondary: rgba(248, 250, 246, 0.93);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--field-dark);
}

.livestock-screen__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 70% at 20% 55%, rgba(26, 77, 50, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 40%, rgba(15, 23, 32, 0.5) 0%, transparent 50%),
    linear-gradient(160deg, #0a1218 0%, var(--field-dark) 45%, #0d1a14 100%);
}

.livestock-screen__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      255deg,
      rgba(15, 23, 32, 0.42) 0%,
      rgba(15, 23, 32, 0.25) 34%,
      rgba(15, 23, 32, 0.18) 58%,
      rgba(15, 23, 32, 0.02) 100%
    ),
    linear-gradient(
      180deg,
      rgba(15, 23, 32, 0.12) 0%,
      transparent 28%,
      rgba(15, 23, 32, 0.05) 62%,
      rgba(15, 23, 32, 0.58) 100%
    );
}

.livestock-screen.reveal-on-scroll {
  transform: none;
}

.livestock-screen.reveal-on-scroll:not(.is-visible) {
  opacity: 1;
}

.livestock-screen__stage {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 2.5rem), var(--ls-stage-max));
  max-width: var(--ls-stage-max);
  display: grid;
  grid-template-columns: 78% 22%;
  grid-template-areas:
    "intro intro"
    "carousel benefits";
  align-items: center;
  justify-content: center;
  row-gap: clamp(1.15rem, 2.2vh, 1.85rem);
  column-gap: clamp(1.35rem, 2.2vw, 2.15rem);
  padding: 4rem;
  margin: 0 auto;
}

.livestock-screen__intro {
  grid-area: intro;
  display: flex;
  flex-direction: column;
  gap: clamp(0.9rem, 1.8vh, 1.25rem);
  width: 100%;
  max-width: 100%;
}

.livestock-kw {
  font-weight: 700;
  color: var(--ls-kw-green);
  text-shadow: 0 0 16px rgba(31, 90, 56, 0.35);
}

.livestock-kw--gold {
  color: var(--harvest-gold);
  text-shadow: 0 0 20px rgba(217, 164, 65, 0.32);
}

.livestock-kw--green {
  color: var(--agro-green-soft);
  text-shadow: 0 0 16px rgba(47, 122, 74, 0.35);
}

.livestock-screen__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(160, 146, 17, 0.55);
  background: rgba(77, 65, 26, 0.32);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(248, 250, 246, 0.92);
}

.livestock-screen__eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(180, 156, 17);
  box-shadow: 0 0 8px rgba(102, 92, 34, 0.85);
}

.livestock-screen__title {
  margin: 0;
  max-width: 1450px;
  font-size: clamp(3.5rem, 3.6vw, 2.65rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--white-soft);
  text-wrap: balance;
}

.livestock-screen__lead {
  margin: 0;
  max-width: 1200px;
  font-size: clamp(0.92rem, 1.05vw, 1.04rem);
  font-weight: 500;
  line-height: 1.62;
  color: var(--ls-text-body);
  text-wrap: balance;
}

.livestock-benefits {
  grid-area: benefits;
  list-style: none;
  margin: 0;
  padding: 0;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.livestock-benefits__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding: 0.95rem 1.05rem 0.95rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248, 250, 246, 0.1);
  border-left: 3px solid var(--harvest-gold);
  background: linear-gradient(
    135deg,
    rgba(15, 23, 32, 0.82) 0%,
    rgba(15, 23, 32, 0.62) 100%
  );
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.livestock-benefits__title {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--white-soft);
  margin-bottom: 0.28rem;
}

.livestock-benefits__text {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ls-text-secondary);
}

.livestock-carousel {
  grid-area: carousel;
  position: relative;
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
  align-self: center;
}

.livestock-carousel__glow {
  position: absolute;
  inset: -6% -4%;
  background: radial-gradient(ellipse 70% 65% at 50% 45%, rgba(31, 90, 56, 0.22) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.livestock-carousel__frame {
  position: relative;
  z-index: 2;
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid rgba(248, 250, 246, 0.18);
  background: linear-gradient(165deg, rgba(20, 31, 42, 0.48) 0%, rgba(15, 23, 32, 0.65) 100%);
  backdrop-filter: blur(20px) saturate(155%);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 64px rgba(31, 90, 56, 0.16);
  overflow: hidden;
  padding: 0.35rem;
}

.livestock-carousel__viewport {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  width: 100%;
  min-height: clamp(460px, 58vh, 690px);
  max-height: min(70vh, 720px);
  background: #0a1018;
}

.livestock-carousel__track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.livestock-slide {
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  transition: transform var(--ls-carousel-transition) cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.livestock-slide.is-active {
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}

.livestock-slide.is-active.is-leaving,
.livestock-slide.is-leaving {
  transform: translateX(-100%);
  z-index: 1;
  pointer-events: none;
}

.livestock-slide__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  display: block;
  background: #0a1018;
}

.livestock-slide__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(1rem, 2.5vw, 1.35rem) clamp(1.1rem, 2.5vw, 1.5rem);
  background: linear-gradient(0deg, rgba(15, 23, 32, 0.92) 0%, rgba(15, 23, 32, 0.55) 55%, transparent 100%);
}

.livestock-slide__caption-inner {
  max-width: 52ch;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248, 250, 246, 0.12);
  background: rgba(15, 23, 32, 0.55);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.livestock-slide__label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--harvest-gold);
}

.livestock-slide__legend {
  margin: 0;
  font-size: clamp(0.78rem, 1.35vw, 0.9rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--ls-text-secondary);
  text-wrap: balance;
}

.livestock-carousel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  padding: 0 0.15rem;
}

.livestock-carousel__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.livestock-carousel__tab {
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(248, 250, 246, 0.14);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(255, 255, 255);
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition),
    color var(--transition);
}

.livestock-carousel__tab:hover {
  border-color: rgba(217, 164, 65, 0.45);
  color: var(--white-soft);
}

.livestock-carousel__tab.is-active {
  border-color: rgba(217, 164, 65, 0.65);
  background: rgba(217, 164, 65, 0.12);
  color: var(--harvest-gold);
}

.livestock-carousel__progress {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.livestock-carousel__dot {
  width: 28px;
  height: 3px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: rgba(248, 250, 246, 0.15);
  cursor: pointer;
  transition: background var(--transition), width var(--transition-fast);
}

.livestock-carousel__dot.is-active {
  width: 40px;
  background: linear-gradient(90deg, var(--harvest-gold), #e8c878);
}

.ls-rise {
  opacity: 0;
  transform: translateY(18px);
}

.ls-rise--left {
  transform: translateX(-22px);
}

.livestock-screen.is-visible .ls-rise {
  animation: lsRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.livestock-screen.is-visible .ls-rise--left {
  animation: lsRiseLeft 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.livestock-screen.is-visible .ls-rise--1 { animation-delay: 0.06s; }
.livestock-screen.is-visible .ls-rise--2 { animation-delay: 0.14s; }
.livestock-screen.is-visible .ls-rise--3 { animation-delay: 0.22s; }
.livestock-screen.is-visible .ls-rise--4 { animation-delay: 0.3s; }
.livestock-screen.is-visible .ls-rise--5 { animation-delay: 0.4s; }

@keyframes lsRise {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes lsRiseLeft {
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1024px) {
  .livestock-screen__stage {
    width: min(calc(100% - 1.5rem), var(--ls-stage-max));
    max-width: 100%;
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "carousel"
      "benefits";
    row-gap: 1.5rem;
    padding-left: clamp(1rem, 4vw, 1.5rem);
    padding-right: clamp(1rem, 4vw, 1.5rem);
  }

  .livestock-screen__title,
  .livestock-screen__lead {
    max-width: none;
  }

  .livestock-carousel__viewport {
    min-height: clamp(320px, 44vh, 480px);
  }
}

@media (max-width: 560px) {
  .livestock-benefits {
    display: none;
  }

  .livestock-carousel__tabs {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ls-rise {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .livestock-slide {
    transition: none;
  }
}
