/* Apps (opción B Premium aprobada): franja breve en index.html y catálogo en apps.html.
   Datos de las 10 apps: nombres, IDs y paquetes provistos por Erik; descripciones PENDIENTES DE VALIDACIÓN COMERCIAL.

   Tarjeta de aplicación y botones de tienda.
   Mismos tokens del sitio: --paper, --ink, --forest, --green, --muted, radios de 6 px y cápsulas de 999 px. */
.section--tint { background: oklch(0.95 0.006 100); }
.apps-intro { margin: 0; max-width: 40ch; font-size: 16px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }

.app-card {
  display: flex; flex-direction: column; gap: 14px; padding: 20px;
  border-radius: 6px; background: var(--paper); border: 1px solid oklch(0.18 0.01 150 / 0.08);
  transition: border-color .2s, box-shadow .2s;
}
.app-card:hover { border-color: oklch(0.42 0.08 150 / 0.3); box-shadow: 0 12px 28px -20px oklch(0.26 0.05 155 / 0.5); }
/* Íconos oficiales (App Store, 256 px): esquina redondeada como en el sistema. */
.app-icon { width: 56px; height: 56px; border-radius: 22.5%; display: block; flex: none; box-shadow: 0 0 0 1px oklch(0.18 0.01 150 / 0.08), 0 4px 10px -5px oklch(0.2 0.03 155 / 0.35); }
.app-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.app-name { margin: 0; font-weight: 500; font-size: 17px; line-height: 1.25; letter-spacing: -0.015em; }
.app-desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.app-stores { display: flex; flex-wrap: wrap; gap: 6px; }
.store-btn {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid oklch(0.18 0.01 150 / 0.18);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; color: var(--ink);
  transition: background-color .2s, border-color .2s, color .2s;
}
.store-btn span { font-size: 11px; opacity: .6; }
.store-btn:hover { background: var(--forest); border-color: var(--forest); color: var(--paper); }
.store-btn:hover span { opacity: 1; color: var(--lime); }
.store-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media (max-width: 640px) { .store-btn { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .app-card, .store-btn { transition: none; } }

/* Presentación breve en la página principal + página apps.html. */

/* Enlace «Apps» (página aparte): el indicador de main.js solo sigue anclas #; estado propio en CSS. */
.nav-links a[aria-current="page"] { color: var(--forest); background: oklch(0.86 0.13 125 / 0.32); box-shadow: inset 0 0 0 1px oklch(0.42 0.08 150 / 0.22); }
.nav-links a[href="apps.html"]:not([aria-current]):hover { background: oklch(0.18 0.01 150 / 0.06); box-shadow: inset 0 0 0 1px oklch(0.18 0.01 150 / 0.1); }
.mobile-menu a[aria-current="page"] { color: var(--forest); }
.mobile-menu a[aria-current="page"]::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 12px; border-radius: 50%; vertical-align: middle; background: var(--lime); box-shadow: 0 0 0 4px oklch(0.86 0.13 125 / 0.3); }
.footer-col a[aria-current="page"] { color: var(--green); }

/* Botón verde sobre fondo claro (variante de .btn del hero; el foco blanco no se vería). */
.btn-forest { background: var(--forest); color: var(--paper); }
.btn-forest:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.btn-forest span { transition: transform .2s; }
.btn-forest:hover span { transform: translateX(3px); }
.btn-forest:focus-visible { outline-color: var(--green); }

/* Página principal: franja breve */
.apps-teaser.section { padding-top: clamp(56px, 6vw, 96px); padding-bottom: clamp(56px, 6vw, 96px); }
.apps-teaser-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px clamp(32px, 5vw, 80px); align-items: center; }
.apps-teaser-text .apps-intro { margin-top: 20px; }
.apps-teaser-text .btn { margin-top: 28px; }
.apps-teaser-icons { display: block; padding: clamp(18px, 2.2vw, 28px); border-radius: 6px; background: var(--paper); border: 1px solid oklch(0.18 0.01 150 / 0.08); transition: border-color .2s, box-shadow .2s; }
.apps-teaser-icons:hover { border-color: oklch(0.42 0.08 150 / 0.3); box-shadow: 0 12px 28px -20px oklch(0.26 0.05 155 / 0.5); }
.apps-teaser-icons:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.apps-teaser-icons ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 64px); gap: 16px; }
.apps-teaser-icons img { width: 64px; height: 64px; display: block; border-radius: 22.5%; box-shadow: 0 0 0 1px oklch(0.18 0.01 150 / 0.08), 0 4px 10px -5px oklch(0.2 0.03 155 / 0.35); transition: transform .3s var(--ease); }
.apps-teaser-icons:hover img { transform: translateY(-2px); }
@media (max-width: 899.98px) { .apps-teaser-inner { grid-template-columns: minmax(0, 1fr); } .apps-teaser-icons { justify-self: start; } }
@media (max-width: 600px) {
  .apps-teaser-icons { justify-self: stretch; }
  .apps-teaser-icons ul { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  .apps-teaser-icons img { width: 100%; height: auto; }
}

/* Página apps.html */
.apps-hero { border-bottom: 1px solid oklch(0.18 0.01 150 / 0.08); }
.apps-hero-inner { max-width: 1320px; margin: 0 auto; padding: clamp(24px, 3vw, 36px) var(--gutter) clamp(36px, 4.5vw, 56px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: clamp(28px, 3.5vw, 48px); font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.breadcrumb a { color: var(--green); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb [aria-current] { color: var(--ink); }
.apps-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px clamp(32px, 5vw, 80px); align-items: end; }
.apps-hero-title { margin: 0; font-weight: 500; font-size: clamp(40px, 5.6vw, 80px); line-height: 1; letter-spacing: -0.04em; }
.apps-hero-aside { display: flex; flex-direction: column; gap: 18px; }
.apps-count { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.apps-count span { padding: 7px 13px; border-radius: 999px; border: 1px solid oklch(0.18 0.01 150 / 0.14); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.apps-catalog { max-width: 1320px; margin: 0 auto; padding: clamp(32px, 4vw, 56px) var(--gutter) clamp(72px, 9vw, 128px); }
.apps-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.apps-list .app-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) 148px; column-gap: 20px; align-items: center; padding: 20px 24px; }
.apps-list .app-icon { width: 72px; height: 72px; }
.apps-list .app-stores { flex-direction: column; }
@media (max-width: 1199.98px) {
  .apps-list .app-card { grid-template-columns: 64px minmax(0, 1fr); row-gap: 14px; align-items: start; }
  .apps-list .app-icon { width: 64px; height: 64px; }
  .apps-list .app-stores { grid-column: 2; flex-direction: row; }
}
@media (max-width: 760px) { .apps-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .apps-list { gap: 12px; }
  .apps-list .app-card { grid-template-columns: 52px minmax(0, 1fr); column-gap: 14px; padding: 16px; }
  .apps-list .app-icon { width: 52px; height: 52px; }
}
.apps-back { margin-top: clamp(40px, 5vw, 64px); padding-top: 28px; border-top: 1px solid oklch(0.18 0.01 150 / 0.14); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; }
.btn-back { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px; background: var(--forest); color: var(--paper); font-size: 15px; font-weight: 500; transition: background .2s; }
.btn-back:hover { background: var(--ink); color: var(--paper); }
.apps-back-contact { font-size: 15px; color: var(--green); border-bottom: 1px solid currentColor; }
.apps-back-contact:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .apps-teaser-icons, .apps-teaser-icons img, .btn-back { transition: none; } .apps-teaser-icons:hover img, .btn-forest:hover { transform: none; } }
.store-btn--na { border-style: dashed; color: var(--muted); font-weight: 400; font-size: 12px; cursor: default; }
.store-btn--na:hover { background: none; border-color: oklch(0.18 0.01 150 / 0.18); color: var(--muted); }
.store-btn--na { white-space: normal; text-align: center; line-height: 1.25; padding: 6px 10px; }
@media (min-width: 900px) { .apps-hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }

/* B premium — página apps.html sobre verde oscuro.
   Todo está acotado a .apps-page (el <main> de apps.html): la portada, el encabezado del sitio
   y el pie no cambian. Se carga después de apps.css y solo sobrescribe colores, tamaños y efectos. */
.apps-page {
  --deep: oklch(0.2 0.042 155);          /* fondo */
  --deep-card: oklch(0.255 0.048 155);   /* tarjeta: un escalón más claro y algo más saturado */
  --deep-card-hover: oklch(0.28 0.052 155);
  --on-deep: oklch(0.985 0.004 100);     /* blanco cálido del sitio */
  --on-deep-soft: oklch(0.985 0.004 100 / 0.8);
  --on-deep-muted: oklch(0.985 0.004 100 / 0.66);
  --hairline: oklch(1 0 0 / 0.09);
  position: relative; isolation: isolate;
  background: var(--deep); color: var(--on-deep);
}
/* Luz ambiental muy tenue arriba a la derecha (no compite con el texto) */
.apps-page::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 720px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 70% at 85% 0%, oklch(0.86 0.13 125 / 0.09), transparent 70%),
    radial-gradient(50% 60% at 10% 10%, oklch(0.42 0.08 150 / 0.22), transparent 70%);
}

/* Encabezado de la página */
.apps-page .apps-hero { border-bottom-color: var(--hairline); }
.apps-page .breadcrumb { color: var(--on-deep-muted); }
.apps-page .breadcrumb a { color: var(--lime); }
.apps-page .breadcrumb a:hover { color: var(--on-deep); }
.apps-page .breadcrumb [aria-current] { color: var(--on-deep); }
.apps-page .eyebrow { color: var(--lime); }
.apps-page .apps-hero-title { color: var(--on-deep); font-weight: 500; }
.apps-page .apps-intro { color: var(--on-deep-soft); font-size: 17px; }
.apps-page .apps-count span { color: var(--on-deep-soft); border-color: oklch(1 0 0 / 0.16); background: oklch(1 0 0 / 0.03); }

/* Tarjetas */
.apps-page .app-card {
  background: linear-gradient(180deg, oklch(0.27 0.05 155), var(--deep-card));
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.05), 0 1px 2px oklch(0.1 0.03 155 / 0.4);
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease, transform .25s var(--ease);
}
.apps-page .app-card:hover {
  border-color: oklch(0.86 0.13 125 / 0.32);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.07), 0 18px 40px -24px oklch(0.08 0.03 155 / 0.9);
  transform: translateY(-2px);
}
.apps-page .app-icon { box-shadow: 0 0 0 1px oklch(1 0 0 / 0.14), 0 8px 18px -8px oklch(0.06 0.03 155 / 0.8); }
.apps-page .app-body { gap: 8px; }
.apps-page .app-name { color: var(--on-deep); font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
.apps-page .app-desc { color: var(--on-deep-soft); font-size: 15px; line-height: 1.55; }

/* Botones de tienda */
.apps-page .store-btn {
  color: var(--on-deep); border-color: oklch(1 0 0 / 0.2); background: oklch(1 0 0 / 0.05);
  font-size: 13.5px; min-height: 38px;
}
.apps-page .store-btn span { opacity: .7; }
.apps-page .store-btn:hover { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.apps-page .store-btn:hover span { color: var(--ink); opacity: 1; }
.apps-page .store-btn:focus-visible { outline-color: var(--lime); }
.apps-page .store-btn--na,
.apps-page .store-btn--na:hover { color: var(--on-deep-muted); border-color: oklch(1 0 0 / 0.22); background: transparent; }

/* Cierre de la página */
.apps-page .apps-back { border-top-color: oklch(1 0 0 / 0.14); }
.apps-page .btn-back { background: var(--lime); color: var(--ink); }
.apps-page .btn-back:hover { background: oklch(0.9 0.12 125); color: var(--ink); }
.apps-page .btn-back:focus-visible { outline-color: var(--on-deep); }
.apps-page .apps-back-contact { color: var(--lime); }
.apps-page .apps-back-contact:hover { color: var(--on-deep); }

/* Tamaño del nombre según ancho */
@media (max-width: 1199.98px) { .apps-page .app-name { font-size: 19px; } }
@media (max-width: 640px) {
  .apps-page .app-name { font-size: 18px; }
  .apps-page .app-desc { font-size: 14.5px; }
  .apps-page .store-btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .apps-page .app-card { transition: none; }
  .apps-page .app-card:hover { transform: none; }
}

/* «Solo en App Store» en una línea: queda junto a App Store siempre que entre (tablet); en celular baja ordenadamente. */
.apps-page .store-btn--na { white-space: nowrap; font-size: 12px; padding: 0 12px; }

/* Franja Apps de la portada — variante «verde del logo».
   Fondo: #7EA62D = color exacto más frecuente de las letras «Agro» en assets/agroti-logo.png
   (10,9 % de los píxeles verdes opacos; base sólida del degradado #AFCB14 → #7EA62D).
   Acotado a .apps-teaser: no afecta a la página apps.html ni a otras secciones. */
.apps-teaser {
  --logo-green: #7EA62D;
  --on-logo: oklch(0.17 0.03 150);          /* casi negro verdoso */
  --on-logo-soft: oklch(0.2 0.035 150 / 0.86);
  --card: oklch(0.24 0.048 155);            /* verde oscuro de las tarjetas */
  --card-hover: oklch(0.28 0.055 155);
  background: var(--logo-green);
  color: var(--on-logo);
  position: relative; isolation: isolate;
}
/* Brillo muy suave arriba a la derecha, con el tono superior del mismo degradado del logo */
.apps-teaser::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 80% at 90% 0%, #AFCB14 0%, transparent 70%);
  opacity: .35;
}
.apps-teaser .eyebrow { color: var(--on-logo); }
.apps-teaser .section-title { color: var(--on-logo); }
.apps-teaser .apps-intro { color: var(--on-logo-soft); }
.apps-teaser .btn-forest { background: var(--on-logo); color: var(--paper); box-shadow: 0 10px 24px -14px oklch(0.15 0.04 155 / 0.8); }
.apps-teaser .btn-forest:hover { background: oklch(0.12 0.02 150); color: var(--paper); }
.apps-teaser .btn-forest:focus-visible { outline-color: var(--on-logo); }

/* Contenedor: sin panel blanco; cada app tiene su tarjeta */
.apps-teaser .apps-teaser-icons { padding: 0; background: none; border: 0; box-shadow: none; border-radius: 10px; }
.apps-teaser .apps-teaser-icons:hover { box-shadow: none; }
.apps-teaser .apps-teaser-icons:focus-visible { outline: 2px solid var(--on-logo); outline-offset: 6px; }
.apps-teaser .apps-teaser-icons ul { grid-template-columns: repeat(5, minmax(0, 118px)); gap: 12px; }
.apps-teaser-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%;
  padding: 16px 10px 14px; border-radius: 12px; text-align: center;
  background: linear-gradient(180deg, oklch(0.27 0.052 155), var(--card));
  border: 1px solid oklch(1 0 0 / 0.08);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.06), 0 10px 22px -16px oklch(0.12 0.04 155 / 0.9);
  transition: transform .25s var(--ease), border-color .25s ease, background-color .25s ease;
}
.apps-teaser .apps-teaser-icons img { width: 56px; height: 56px; transform: none; box-shadow: 0 0 0 1px oklch(1 0 0 / 0.14), 0 6px 14px -6px oklch(0.06 0.03 155 / 0.8); }
.apps-teaser .apps-teaser-icons:hover img { transform: none; }
.apps-teaser-name { color: var(--paper); font-size: 13px; font-weight: 600; line-height: 1.25; letter-spacing: -0.005em; text-wrap: balance; }
.apps-teaser-card:hover { transform: translateY(-3px); border-color: oklch(0.86 0.13 125 / 0.45); }

/* Tablet: texto arriba, 5 × 2 a todo el ancho */
@media (max-width: 1099.98px) {
  .apps-teaser .apps-teaser-inner { grid-template-columns: minmax(0, 1fr); }
  .apps-teaser .apps-teaser-icons { justify-self: stretch; }
  .apps-teaser .apps-teaser-icons ul { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* Celular: 2 columnas, ícono a la izquierda y nombre a la derecha (5 filas compactas) */
@media (max-width: 600px) {
  .apps-teaser .apps-teaser-icons ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .apps-teaser-card { flex-direction: row; text-align: left; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 10px; }
  .apps-teaser .apps-teaser-icons img { width: 40px; height: 40px; flex: none; }
  .apps-teaser-name { font-size: 13px; text-wrap: pretty; }
}
@media (prefers-reduced-motion: reduce) { .apps-teaser-card { transition: none; } .apps-teaser-card:hover { transform: none; } }

/* 700–1099 px: el texto se reparte en dos columnas (título | introducción y botón) para no sumar altura sobre la grilla. */
@media (min-width: 700px) and (max-width: 1099.98px) {
  .apps-teaser .apps-teaser-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); column-gap: clamp(24px, 4vw, 56px); align-items: end; }
  .apps-teaser .apps-teaser-text .eyebrow { grid-column: 1 / -1; }
  .apps-teaser .apps-teaser-text .section-title { grid-column: 1; grid-row: 2 / span 2; align-self: end; }
  .apps-teaser .apps-teaser-text .apps-intro { grid-column: 2; grid-row: 2; margin-top: 0; }
  .apps-teaser .apps-teaser-text .btn { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 16px; }
  .apps-teaser .apps-teaser-inner { row-gap: 32px; }
}
