/* =========================================================
   AGROMAQ - Categorías + Secciones destacadas
   Archivo: assets/css/categorias-secciones.css
   Clases nuevas: agx-*
   Gama: gris oscuro, rojo y blanco
   ========================================================= */

/* =========================================================
   CATEGORÍAS
   ========================================================= */

.agx-categories {
  position: relative;
  overflow: hidden;
  padding: 104px 0 94px;
  color: var(--ag-dark-950, #111315);
  background:
    linear-gradient(135deg, #f7f7f5 0%, #ffffff 48%, #f1f1ef 100%);
}

.agx-categories::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(17, 19, 21, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 21, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
}

.agx-categories::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 16px 34px rgba(227, 27, 35, 0.24);
}

.agx-categories-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.agx-categories-line {
  position: absolute;
  width: 430px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(227, 27, 35, 0.3),
    transparent
  );
  transform: rotate(-28deg);
}

.agx-categories-line.line-a {
  top: 18%;
  left: -130px;
}

.agx-categories-line.line-b {
  right: -140px;
  bottom: 20%;
}

.agx-categories-head {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 34px;
  margin-bottom: 30px;
}

.agx-categories-kicker,
.agx-feature-kicker {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 10px 14px;
  color: var(--ag-dark-950, #111315);
  background: #ffffff;
  border: 1px solid rgba(17, 19, 21, 0.1);
  border-left: 4px solid var(--ag-red-500, #e31b23);
  border-radius: 7px;
  box-shadow: 0 12px 30px rgba(17, 19, 21, 0.07);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.agx-categories-kicker i,
.agx-feature-kicker i {
  color: var(--ag-red-500, #e31b23);
}

.agx-categories-title,
.agx-feature-title {
  max-width: 840px;
  margin: 0;
  color: var(--ag-dark-950, #111315);
  font-size: clamp(36px, 4.2vw, 62px);
  line-height: 0.98;
  font-weight: 950;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.agx-categories-title::after,
.agx-feature-title::after {
  content: "";
  display: block;
  width: 86px;
  height: 5px;
  margin-top: 22px;
  background: linear-gradient(
    90deg,
    var(--ag-red-700, #a90f16),
    var(--ag-red-400, #ff3138)
  );
}

.agx-categories-sub,
.agx-feature-sub {
  max-width: 760px;
  margin: 22px 0 0;
  color: rgba(17, 19, 21, 0.62);
  font-size: 16px;
  line-height: 1.72;
}

/* Contador general, sin clics */
.agx-categories-counter {
  min-width: 184px;
  padding: 18px 20px;
  color: var(--ag-white, #ffffff);
  background:
    linear-gradient(145deg, var(--ag-dark-950, #111315), var(--ag-dark-800, #282d32));
  border: 1px solid rgba(227, 27, 35, 0.45);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(17, 19, 21, 0.15);
}

.agx-categories-counter strong {
  display: block;
  color: var(--ag-red-400, #ff3138);
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

.agx-categories-counter span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 800;
}

/* Buscador */
.agx-category-tools {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 20px;
}

.agx-category-search {
  min-height: 54px;
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(17, 19, 21, 0.12);
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(17, 19, 21, 0.07);
}

.agx-category-search i {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--ag-red-500, #e31b23);
  border-right: 1px solid rgba(17, 19, 21, 0.08);
}

.agx-category-search input {
  width: 100%;
  height: 100%;
  padding: 0 16px;
  color: var(--ag-dark-950, #111315);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
  font-weight: 850;
}

.agx-category-search input::placeholder {
  color: rgba(17, 19, 21, 0.42);
}

.agx-category-clear {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  color: var(--ag-dark-950, #111315);
  background: #ffffff;
  border: 1px solid rgba(17, 19, 21, 0.12);
  border-radius: 10px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(17, 19, 21, 0.07);
  transition:
    color 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.agx-category-clear:hover {
  color: var(--ag-red-600, #c9161d);
  border-color: rgba(227, 27, 35, 0.38);
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(17, 19, 21, 0.1);
}

/* Chips */
.agx-category-tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 11px;
  margin-top: 18px;
}

.agx-cat-chip {
  position: relative;
  overflow: hidden;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--ag-dark-950, #111315);
  background: #ffffff;
  border: 1px solid rgba(17, 19, 21, 0.1);
  border-left: 4px solid transparent;
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(17, 19, 21, 0.065);
  cursor: pointer;
  text-align: center;
  transition:
    transform 0.22s ease,
    color 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.agx-cat-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(227, 27, 35, 0.08), transparent 46%);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.agx-cat-chip span {
  position: relative;
  z-index: 2;
  overflow: hidden;
  max-width: 100%;
  color: inherit;
  font-size: 12.5px;
  line-height: 1.25;
  font-weight: 950;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.agx-cat-chip:hover {
  color: var(--ag-dark-950, #111315);
  transform: translateY(-3px);
  border-left-color: var(--ag-red-500, #e31b23);
  border-color: rgba(227, 27, 35, 0.34);
  box-shadow: 0 18px 36px rgba(17, 19, 21, 0.1);
}

.agx-cat-chip:hover::before {
  opacity: 1;
}

.agx-cat-chip.is-active {
  color: var(--ag-white, #ffffff);
  background:
    linear-gradient(135deg, var(--ag-red-700, #a90f16), var(--ag-red-500, #e31b23));
  border-color: rgba(227, 27, 35, 0.48);
  border-left-color: var(--ag-dark-950, #111315);
  box-shadow: 0 18px 38px rgba(227, 27, 35, 0.24);
}

.agx-cat-chip-all {
  color: var(--ag-white, #ffffff);
  background:
    linear-gradient(145deg, var(--ag-dark-950, #111315), var(--ag-dark-800, #282d32));
  border-color: rgba(255, 255, 255, 0.08);
}

.agx-cat-chip-all i {
  position: relative;
  z-index: 2;
  margin-right: 8px;
  color: var(--ag-red-400, #ff3138);
}

/* Ver más */
.agx-category-more-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.agx-category-more {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  color: var(--ag-white, #ffffff);
  background:
    linear-gradient(145deg, var(--ag-dark-950, #111315), var(--ag-dark-800, #282d32));
  border: 1px solid rgba(227, 27, 35, 0.42);
  border-radius: 8px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(17, 19, 21, 0.16);
  transition:
    transform 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease;
}

.agx-category-more:hover {
  transform: translateY(-2px);
  background:
    linear-gradient(135deg, var(--ag-red-700, #a90f16), var(--ag-red-500, #e31b23));
  border-color: rgba(227, 27, 35, 0.7);
}

.agx-category-more span {
  padding: 4px 8px;
  color: var(--ag-dark-950, #111315);
  background: var(--ag-white, #ffffff);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 950;
}

/* Estado vacío */
.agx-category-empty {
  grid-column: 1 / -1;
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 6px;
  color: rgba(17, 19, 21, 0.62);
  background: #ffffff;
  border: 1px dashed rgba(17, 19, 21, 0.18);
  border-radius: 12px;
}

.agx-category-empty i {
  color: var(--ag-red-500, #e31b23);
  font-size: 28px;
}

.agx-category-empty strong {
  color: var(--ag-dark-950, #111315);
}

/* =========================================================
   SECCIONES DESTACADAS
   ========================================================= */

.agx-feature-sections {
  position: relative;
  overflow: hidden;
  padding: 96px 0 112px;
  background: #ffffff;
}

.agx-feature-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  align-items: end;
  gap: 38px;
  margin-bottom: 46px;
}

.agx-feature-sub {
  margin: 0;
}

.agx-feature-list {
  display: grid;
  gap: 28px;
}

.agx-feature-block {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(380px, 1fr);
  align-items: center;
  gap: 34px;
  padding: 26px;
  border-radius: 18px;
  border: 1px solid rgba(17, 19, 21, 0.1);
  box-shadow: 0 24px 56px rgba(17, 19, 21, 0.09);
}

.agx-feature-block::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -120px;
  top: -120px;
  border-radius: 50%;
  border: 34px solid rgba(227, 27, 35, 0.12);
  pointer-events: none;
}

.agx-feature-reverse {
  grid-template-columns: minmax(380px, 1fr) minmax(0, 0.88fr);
}

.agx-feature-reverse .agx-feature-copy {
  order: 2;
}

.agx-feature-reverse .agx-feature-media {
  order: 1;
}

.agx-feature-dark {
  color: var(--ag-white, #ffffff);
  background:
    linear-gradient(145deg, rgba(17, 19, 21, 0.99), rgba(40, 45, 50, 0.97)),
    radial-gradient(circle at 10% 0%, rgba(227, 27, 35, 0.25), transparent 38%);
  border-color: rgba(227, 27, 35, 0.32);
}

.agx-feature-light {
  color: var(--ag-dark-950, #111315);
  background:
    linear-gradient(135deg, #ffffff, #f5f5f2);
  border-color: rgba(17, 19, 21, 0.1);
}

.agx-feature-copy {
  position: relative;
  z-index: 2;
  padding: 16px;
}

.agx-feature-label {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 8px 11px;
  color: var(--ag-white, #ffffff);
  background: var(--ag-red-600, #c9161d);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agx-feature-copy h3 {
  margin: 0;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.06em;
}

.agx-feature-dark .agx-feature-copy h3 {
  color: var(--ag-white, #ffffff);
}

.agx-feature-light .agx-feature-copy h3 {
  color: var(--ag-dark-950, #111315);
}

.agx-feature-copy p {
  max-width: 620px;
  margin: 20px 0 0;
  font-size: 15.5px;
  line-height: 1.72;
}

.agx-feature-dark .agx-feature-copy p {
  color: rgba(255, 255, 255, 0.68);
}

.agx-feature-light .agx-feature-copy p {
  color: rgba(17, 19, 21, 0.62);
}

.agx-feature-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.agx-feature-meta span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 900;
}

.agx-feature-dark .agx-feature-meta span {
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.agx-feature-light .agx-feature-meta span {
  color: rgba(17, 19, 21, 0.72);
  background: #ffffff;
  border: 1px solid rgba(17, 19, 21, 0.1);
}

.agx-feature-meta i {
  color: var(--ag-red-500, #e31b23);
}

.agx-feature-btn {
  margin-top: 26px;
  min-height: 48px;
  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.12) !important;
  box-shadow: 0 18px 36px rgba(227, 27, 35, 0.24);
}

.agx-feature-btn:hover {
  transform: translateY(-2px);
}

.agx-feature-media {
  position: relative;
  z-index: 2;
}

.agx-feature-img-button {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 330px;
  display: block;
  padding: 0;
  background: rgba(17, 19, 21, 0.04);
  border: 1px solid rgba(17, 19, 21, 0.1);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.agx-feature-dark .agx-feature-img-button {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.11);
}

.agx-feature-img-button::after {
  content: "Ver productos";
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  padding: 10px 13px;
  color: var(--ag-white, #ffffff);
  background: var(--ag-red-600, #c9161d);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(227, 27, 35, 0.24);
}

.agx-feature-img-button img {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
  display: block;
  transform: scale(1.03);
  transition:
    transform 0.45s ease,
    filter 0.45s ease;
}

.agx-feature-img-button:hover img {
  transform: scale(1.08);
  filter: contrast(1.05) saturate(1.05);
}

.agx-feature-placeholder {
  min-height: 330px;
  display: grid;
  place-items: center;
  color: rgba(17, 19, 21, 0.34);
  background:
    linear-gradient(135deg, rgba(227, 27, 35, 0.06), rgba(17, 19, 21, 0.03));
}

.agx-feature-dark .agx-feature-placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.agx-feature-placeholder i {
  font-size: 48px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1050px) {
  .agx-categories-head,
  .agx-feature-head {
    grid-template-columns: 1fr;
  }

  .agx-categories-counter {
    max-width: 270px;
  }

  .agx-feature-block,
  .agx-feature-reverse {
    grid-template-columns: 1fr;
  }

  .agx-feature-reverse .agx-feature-copy,
  .agx-feature-reverse .agx-feature-media {
    order: initial;
  }
}

@media (max-width: 720px) {
  .agx-categories,
  .agx-feature-sections {
    padding: 74px 0 82px;
  }

  .agx-category-tools {
    grid-template-columns: 1fr;
  }

  .agx-category-tabs {
    grid-template-columns: 1fr;
  }

  .agx-categories-title,
  .agx-feature-title {
    font-size: clamp(34px, 10vw, 48px);
  }

  .agx-feature-block {
    padding: 18px;
    border-radius: 15px;
  }

  .agx-feature-copy {
    padding: 8px;
  }

  .agx-feature-img-button,
  .agx-feature-img-button img,
  .agx-feature-placeholder {
    min-height: 250px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agx-cat-chip,
  .agx-cat-chip::before,
  .agx-category-clear,
  .agx-category-more,
  .agx-feature-btn,
  .agx-feature-img-button img {
    transition: none !important;
  }
}