/* =========================================================
   AGROMAQ - Bloque Servicios
   Archivo: assets/css/servicios.css
   Usa variables globales ya declaradas en navbar.css
   ========================================================= */

.ag-services {
  position: relative;
  overflow: hidden;
  padding: 108px 0 118px;
  color: var(--ag-white, #ffffff);
  background:
    linear-gradient(135deg, rgba(17, 19, 21, 0.99), rgba(40, 45, 50, 0.97)),
    radial-gradient(circle at 80% 20%, rgba(227, 27, 35, 0.24), transparent 34%);
}

.ag-services::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.7;
  pointer-events: none;
}

.ag-services::after {
  content: "";
  position: absolute;
  left: 8%;
  top: 0;
  width: 240px;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--ag-red-700, #a90f16),
    var(--ag-red-400, #ff3138)
  );
  box-shadow: 0 18px 38px rgba(227, 27, 35, 0.32);
}

.ag-services-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ag-services-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(16px);
  opacity: 0.3;
}

.ag-services-glow.glow-a {
  top: 8%;
  right: 8%;
  background: radial-gradient(circle, rgba(227, 27, 35, 0.35), transparent 65%);
  animation: agServicesPulse 6s ease-in-out infinite;
}

.ag-services-glow.glow-b {
  left: -120px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 68%);
  animation: agServicesPulse 7s ease-in-out infinite reverse;
}

.ag-services-line {
  position: absolute;
  width: 420px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227, 27, 35, 0.6), transparent);
  transform: rotate(-28deg);
}

.ag-services-line.line-a {
  top: 24%;
  left: -110px;
}

.ag-services-line.line-b {
  right: -120px;
  bottom: 24%;
}

/* Header */
.ag-services-head {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.55fr);
  align-items: end;
  gap: 42px;
  margin-bottom: 48px;
}

.ag-services-kicker {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 10px 14px;
  color: var(--ag-white, #ffffff);
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(227, 27, 35, 0.42);
  border-left: 4px solid var(--ag-red-500, #e31b23);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ag-services-kicker i {
  color: var(--ag-red-400, #ff3138);
}

.ag-services-title {
  max-width: 880px;
  margin: 0;
  color: var(--ag-white, #ffffff);
  font-size: clamp(38px, 4.4vw, 66px);
  line-height: 0.98;
  font-weight: 950;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.ag-services-title::after {
  content: "";
  display: block;
  width: 88px;
  height: 5px;
  margin-top: 24px;
  background: linear-gradient(
    90deg,
    var(--ag-red-700, #a90f16),
    var(--ag-red-400, #ff3138)
  );
}

.ag-services-sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  line-height: 1.72;
}

/* Layout */
.ag-services-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(380px, 0.8fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

/* Panel principal */
.ag-service-feature {
  position: relative;
  overflow: hidden;
  padding: 28px;
  min-height: 100%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 20% 0%, rgba(227, 27, 35, 0.2), transparent 35%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.28);
}

.ag-service-feature::before {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 210px;
  height: 210px;
  border: 28px solid rgba(227, 27, 35, 0.16);
  border-radius: 50%;
}

.ag-service-feature::after {
  content: "";
  position: absolute;
  left: -55px;
  bottom: 56px;
  width: 230px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227, 27, 35, 0.72), transparent);
  transform: rotate(-28deg);
}

.ag-service-feature-top {
  position: relative;
  z-index: 2;
  margin-bottom: 28px;
}

.ag-service-feature-top span {
  display: block;
  color: var(--ag-red-400, #ff3138);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ag-service-feature-top strong {
  display: block;
  margin-top: 8px;
  color: var(--ag-white, #ffffff);
  font-size: 27px;
  line-height: 1.12;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.ag-service-flow {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
}

.ag-flow-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 16px;
  background: rgba(17, 19, 21, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  transition:
    transform 0.26s ease,
    border-color 0.26s ease,
    background 0.26s ease;
}

.ag-flow-item:hover,
.ag-flow-item.active {
  transform: translateX(5px);
  border-left-color: var(--ag-red-500, #e31b23);
  background: rgba(227, 27, 35, 0.12);
}

.ag-flow-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--ag-white, #ffffff);
  background: linear-gradient(
    135deg,
    var(--ag-red-700, #a90f16),
    var(--ag-red-500, #e31b23)
  );
  border-radius: 9px;
  box-shadow: 0 14px 30px rgba(227, 27, 35, 0.22);
}

.ag-flow-icon i {
  font-size: 20px;
}

.ag-flow-item strong {
  display: block;
  color: var(--ag-white, #ffffff);
  font-size: 15px;
  font-weight: 950;
}

.ag-flow-item span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.ag-services-cta {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 50px;
  justify-content: center;
  margin-top: 24px;
  border-radius: 8px !important;
  color: var(--ag-white, #ffffff) !important;
  background: linear-gradient(
    135deg,
    var(--ag-red-700, #a90f16),
    var(--ag-red-500, #e31b23)
  ) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 18px 36px rgba(227, 27, 35, 0.26);
}

.ag-services-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 46px rgba(227, 27, 35, 0.34);
}

/* Cards */
.ag-services-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.ag-service-card {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  padding: 26px 24px;
  color: var(--ag-white, #ffffff);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.24);
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
}

.ag-service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 0%, rgba(227, 27, 35, 0.18), transparent 34%);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.ag-service-card::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--ag-red-700, #a90f16),
    var(--ag-red-400, #ff3138)
  );
  transform: scaleX(0.3);
  transform-origin: left;
  opacity: 0.55;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.ag-service-card:hover {
  transform: translateY(-9px);
  border-color: rgba(227, 27, 35, 0.44);
  box-shadow: 0 30px 62px rgba(0, 0, 0, 0.32);
}

.ag-service-card:hover::before {
  opacity: 1;
}

.ag-service-card:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.ag-service-card-red {
  background:
    linear-gradient(145deg, rgba(227, 27, 35, 0.82), rgba(169, 15, 22, 0.92));
  border-color: rgba(255, 255, 255, 0.16);
}

.ag-service-number {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.16);
  font-size: 54px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.ag-service-icon {
  position: relative;
  z-index: 2;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-top: 34px;
  color: var(--ag-white, #ffffff);
  background: linear-gradient(
    135deg,
    var(--ag-red-700, #a90f16),
    var(--ag-red-500, #e31b23)
  );
  border-radius: 10px;
  box-shadow: 0 16px 32px rgba(227, 27, 35, 0.26);
}

.ag-service-card-red .ag-service-icon {
  background: rgba(17, 19, 21, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ag-service-icon i {
  font-size: 25px;
}

.ag-service-card h3 {
  position: relative;
  z-index: 2;
  margin: 24px 0 0;
  color: var(--ag-white, #ffffff);
  font-size: 23px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -0.035em;
}

.ag-service-card p {
  position: relative;
  z-index: 2;
  margin: 13px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  line-height: 1.65;
}

.ag-service-card-red p {
  color: rgba(255, 255, 255, 0.78);
}

/* Animaciones */
@keyframes agServicesPulse {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0.22;
  }

  50% {
    transform: scale(1.08);
    opacity: 0.38;
  }
}

/* Responsive */
@media (max-width: 1150px) {
  .ag-services-grid {
    grid-template-columns: 1fr;
  }

  .ag-services-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ag-service-card {
    min-height: 310px;
  }
}

@media (max-width: 920px) {
  .ag-services {
    padding: 84px 0 92px;
  }

  .ag-services-head {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ag-services-sub {
    max-width: 720px;
  }

  .ag-services-cards {
    grid-template-columns: 1fr;
  }

  .ag-service-card {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .ag-services {
    padding: 68px 0 76px;
  }

  .ag-services-title {
    font-size: clamp(34px, 10vw, 48px);
  }

  .ag-service-feature {
    padding: 22px;
    border-radius: 14px;
  }

  .ag-flow-item {
    grid-template-columns: 1fr;
  }

  .ag-flow-icon {
    width: 46px;
    height: 46px;
  }

  .ag-service-card {
    padding: 24px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-services-glow,
  .ag-flow-item,
  .ag-service-card,
  .ag-service-card::before,
  .ag-service-card::after,
  .ag-services-cta {
    animation: none !important;
    transition: none !important;
  }
}