/* ============================================================
   Ayres IT — V3 Tabs/Switcher · Override CSS
   Bloque POS+ERP en index.html · secci&oacute;n #productos
   ------------------------------------------------------------
   Cargar DESPU&eacute;S de style.css y green.css.
   Tokens basados en colors_and_type.css del design-reference.

   Convenci&oacute;n de scoping:
   • Todo bajo .ayres-products (clase nueva en el wrapper)
   • Cero side-effects sobre #productos > .modulos-stack (bloques
     de buckets de m&oacute;dulos siguen iguales).

   Asume markup nuevo (ver products-block.html). Reemplaza al
   layout V1 commit af9dc5b — incompatible, revertir antes.
   ============================================================ */

/* ───────────────────────── Tokens (scope local) ───────────────────────── */
.ayres-products {
  /* Brand · verde Ayres oficial (manual de marca) */
  --ap-green-50:  #F2FAE6;
  --ap-green-100: #E0F3C4;
  --ap-green-500: #8CC63F;   /* verde Ayres oficial */
  --ap-green-600: #72A82E;
  --ap-green-700: #588422;
  --ap-green-800: #3F621A;

  /* AyresPOS · celeste oficial */
  --ap-pos-50:  #E6F2FB;
  --ap-pos-100: #C2DFF5;
  --ap-pos-500: #007ACC;
  --ap-pos-600: #0064A8;
  --ap-pos-700: #004D80;

  /* AyresERP · teal oficial */
  --ap-erp-50:  #E0F5F6;
  --ap-erp-100: #B5E7E9;
  --ap-erp-500: #05A7AD;
  --ap-erp-600: #038A90;
  --ap-erp-700: #026C70;

  /* Neutros warm-grey */
  --ap-n-50:  #FAFAFA;
  --ap-n-100: #F5F5F5;
  --ap-n-200: #EEEEEE;
  --ap-n-300: #E0E0E0;
  --ap-n-500: #757575;
  --ap-n-700: #404040;
  --ap-n-900: #232323;

  /* Tipograf&iacute;a · usa fuentes ya cargadas en el sitio (manual de marca: Coolvetica + DIN Pro) */
  --ap-font-display: "Coolvetica", "Manrope", system-ui, sans-serif;
  --ap-font-body:    "DIN Pro", "Manrope", system-ui, sans-serif;
  --ap-font-accent:  Georgia, "Times New Roman", serif; /* serif italic system, fix de "Caveat" no cargada */
  --ap-font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Radii / shadows */
  --ap-r-md: 12px;
  --ap-r-lg: 18px;
  --ap-r-pill: 999px;
  --ap-shadow-card: 0 1px 0 rgba(35,35,35,0.04), 0 8px 24px -8px rgba(35,35,35,0.10);
  --ap-shadow-ring-pos: 0 0 0 1px rgba(0,122,204,0.32), 0 18px 40px -10px rgba(0,122,204,0.20);
  --ap-shadow-ring-erp: 0 0 0 1px rgba(5,167,173,0.32), 0 18px 40px -10px rgba(5,167,173,0.20);

  /* Reset local */
  font-family: var(--ap-font-body);
  color: var(--ap-n-900);
}

/* ───────────────────────── §1 · Header (tagline 3 l&iacute;neas) ───────────────────────── */
.ayres-products__header {
  text-align: center;
  margin-bottom: 56px;
}
.ayres-products__title {
  font-family: var(--ap-font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ap-n-900);
  margin: 0 0 18px;
}
.ayres-products__title > span { display: block; }
.ayres-products__title > span.is-accent { color: var(--ap-green-500); }
.ayres-products__lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ap-n-700);
  max-width: 680px;
  margin: 0 auto;
}

/* ───────────────────────── §2 · Tab switcher (pill) ───────────────────────── */
.ayres-products__tablist {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}
.ayres-products__tablist > div {
  display: inline-flex;
  gap: 4px;
  padding: 6px;
  border-radius: var(--ap-r-pill);
  background: #fff;
  border: 1px solid var(--ap-n-300);
  box-shadow: var(--ap-shadow-card);
}
.ayres-products__tab {
  padding: 12px 24px;
  border-radius: var(--ap-r-pill);
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--ap-n-700);
  transition: background .2s ease, color .2s ease;
}
.ayres-products__tab:hover { color: var(--ap-n-900); }
.ayres-products__tab:focus-visible {
  outline: 2px solid var(--ap-pos-500);
  outline-offset: 2px;
}
.ayres-products__tab[aria-selected="true"][data-product="pos"] {
  background: var(--ap-pos-500); color: #fff;
}
.ayres-products__tab[aria-selected="true"][data-product="erp"] {
  background: var(--ap-erp-500); color: #fff;
}
.ayres-products__tab .dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex: none;
  background: var(--ap-pos-500);
}
.ayres-products__tab[data-product="erp"] .dot { background: var(--ap-erp-500); }
.ayres-products__tab[aria-selected="true"] .dot { background: #fff; }
.ayres-products__tab .pill-principal {
  display: inline-flex; align-items: center;
  padding: 2px 8px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--ap-r-pill);
  background: var(--ap-green-100);
  color: var(--ap-green-800);
  border: 1px solid rgba(140,198,63,0.32);
}
.ayres-products__tab[aria-selected="true"] .pill-principal {
  background: rgba(255,255,255,0.20);
  color: #fff;
  border-color: rgba(255,255,255,0.30);
}

/* ───────────────────────── §3 · Panels (POS + ERP) ───────────────────────── */
.ayres-products__panel {
  background: #fff;
  border: 1px solid var(--ap-n-200);
  border-radius: var(--ap-r-lg);
  overflow: hidden;
}
.ayres-products__panel[hidden] { display: none; }
.ayres-products__panel[data-product="pos"] {
  border-color: var(--ap-pos-100);
  box-shadow: var(--ap-shadow-ring-pos);
}
.ayres-products__panel[data-product="erp"] {
  border-color: var(--ap-erp-100);
  box-shadow: var(--ap-shadow-ring-erp);
}
.ayres-products__panel-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
  align-items: stretch;
}

/* ─── Body (texto) ─── */
.ayres-products__body {
  padding: 40px 44px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ayres-products__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ayres-products__brand-icon {
  width: 44px; height: 44px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: #fff;
  font-family: var(--ap-font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  flex: none;
}
.ayres-products__panel[data-product="pos"] .ayres-products__brand-icon { background: var(--ap-pos-500); }
.ayres-products__panel[data-product="erp"] .ayres-products__brand-icon { background: var(--ap-erp-500); }
/* Logo SVG por producto · reemplaza el cuadrito-A gen&eacute;rico (icono ya trae bg color oficial) */
.ayres-products__brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  flex: none;
  display: block;
}
.ayres-products__brand-name {
  font-family: var(--ap-font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.ayres-products__brand-name .base { color: var(--ap-n-900); }
.ayres-products__panel[data-product="pos"] .ayres-products__brand-name .accent { color: var(--ap-pos-500); }
.ayres-products__panel[data-product="erp"] .ayres-products__brand-name .accent { color: var(--ap-erp-500); }
.ayres-products__quote {
  font-family: var(--ap-font-accent);
  font-style: italic;
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.15;
  color: var(--ap-n-900);
  margin: 0;
  letter-spacing: -0.005em;
}
.ayres-products__desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ap-n-700);
  margin: 0;
  max-width: 560px;
}

/* ─── Bullet grids (14 POS / 8 ERP) ─── */
.ayres-products__bullets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  row-gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--ap-n-200);
  margin: 0;
  list-style: none;
  padding-left: 0;
}
.ayres-products__bullet {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ap-n-700);
}
.ayres-products__bullet-check {
  width: 14px; height: 14px;
  flex: none;
  margin-top: 4px; /* aligns with first text line */
  display: block;
}
.ayres-products__panel[data-product="pos"] .ayres-products__bullet-check { color: var(--ap-pos-500); }
.ayres-products__panel[data-product="erp"] .ayres-products__bullet-check { color: var(--ap-erp-500); }
.ayres-products__bullet b {
  color: var(--ap-n-900);
  font-weight: 700;
}

/* ─── Footer (KPI + CTA) ─── */
.ayres-products__footer {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--ap-n-200);
}
.ayres-products__kpi { display: flex; flex-direction: column; }
.ayres-products__kpi-num {
  font-family: var(--ap-font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.ayres-products__panel[data-product="pos"] .ayres-products__kpi-num { color: var(--ap-pos-500); }
.ayres-products__panel[data-product="erp"] .ayres-products__kpi-num { color: var(--ap-erp-500); }
.ayres-products__kpi-label {
  font-size: 11px;
  color: var(--ap-n-500);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* CTAs */
.ayres-products__cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--ap-r-md);
  font-family: var(--ap-font-body);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  border: 1px solid transparent;
}
.ayres-products__panel[data-product="pos"] .ayres-products__cta {
  background: var(--ap-pos-500);
  color: #fff;
  border-color: var(--ap-pos-500);
}
.ayres-products__panel[data-product="pos"] .ayres-products__cta:hover {
  background: var(--ap-pos-600);
  border-color: var(--ap-pos-600);
  transform: translateY(-1px);
}
.ayres-products__panel[data-product="erp"] .ayres-products__cta {
  background: #fff;
  color: var(--ap-erp-700);
  border-color: var(--ap-erp-500);
}
.ayres-products__panel[data-product="erp"] .ayres-products__cta:hover {
  background: var(--ap-erp-50);
  transform: translateY(-1px);
}
.ayres-products__cta svg {
  width: 16px; height: 16px;
  stroke: currentColor;
}

/* ─── Photo column (right side) ─── */
.ayres-products__photo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-left: 1px solid var(--ap-n-200);
  min-height: 540px;
}
.ayres-products__panel[data-product="pos"] .ayres-products__photo {
  background: linear-gradient(180deg, #F6F6F4, #EDEDE9);
}
.ayres-products__panel[data-product="erp"] .ayres-products__photo {
  background: linear-gradient(180deg, #EAF6F6, #DCEFEF);
}
/* Grid overlay (decoraci&oacute;n) */
.ayres-products__photo::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,122,204,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,122,204,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.ayres-products__panel[data-product="erp"] .ayres-products__photo::before {
  background-image:
    linear-gradient(rgba(5,167,173,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(5,167,173,0.07) 1px, transparent 1px);
}
.ayres-products__photo img {
  position: relative;
  max-width: 100%;
  max-height: 480px;
  height: auto;
  width: auto;
  object-fit: contain;
}

/* Placeholder ERP (sin asset disponible) */
.ayres-products__photo--placeholder {
  display: grid;
  place-items: center;
}
.ayres-products__photo--placeholder .placeholder-box {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  border-radius: 14px;
  background:
    repeating-linear-gradient(135deg,
      rgba(5,167,173,0.08) 0 12px,
      transparent 12px 24px);
  border: 1px dashed rgba(5,167,173,0.32);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}
.ayres-products__photo--placeholder .placeholder-label {
  font-family: var(--ap-font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ap-erp-700);
  font-weight: 600;
}

/* ───────────────────────── §4 · Tip strip (debajo de la card) ───────────────────────── */
.ayres-products__tip {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.ayres-products__tip > p {
  font-size: 13px;
  color: var(--ap-n-500);
  font-family: var(--ap-font-mono);
  letter-spacing: 0.04em;
  margin: 0;
}

/* ───────────────────────── §5 · Responsive ───────────────────────── */
@media (max-width: 992px) {
  .ayres-products__panel-grid { grid-template-columns: 1fr; }
  .ayres-products__photo {
    border-left: 0;
    border-top: 1px solid var(--ap-n-200);
    min-height: 360px;
  }
  .ayres-products__body { padding: 32px 28px 28px; }
}

@media (max-width: 720px) {
  .ayres-products__bullets { grid-template-columns: 1fr; }
  .ayres-products__title { font-size: 26px; }
  .ayres-products__tab { padding: 10px 16px; font-size: 13px; }
  .ayres-products__tab .pill-principal { display: none; } /* ahorra espacio en mobile */
  .ayres-products__brand-name { font-size: 22px; }
}

/* ───────────────────────── §6 · Reduced-motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ayres-products__tab,
  .ayres-products__cta {
    transition: none;
  }
  .ayres-products__cta:hover { transform: none; }
}

/* ───────────────────────── §7 · Modulos-stack (NO TOCAR) ───────────────────────── */
/* La secci&oacute;n .modulos-stack de #productos NO se modifica.
   Estas reglas no la afectan porque todo est&aacute; scopeado a .ayres-products */

/* ============================================================
 * §8 · Cards de m&oacute;dulos e integraciones · layout side-by-side
 * ------------------------------------------------------------
 * Markup compartido en index.html:
 *   .modulo-card > .modulo-card-row > .modulo-card-img-wrap + .modulo-card-content
 *
 * Antes de este bloque, el CSS de .integ-card viv&iacute;a aqu&iacute; pero se
 * perdi&oacute; en una reescritura. Se restablece y se generaliza a TODAS
 * las .modulo-card (incluye m&oacute;dulos del bucket B1-B4 + integraciones).
 * ============================================================ */

.modulo-card {
  display: flex;
  flex-direction: column;
}
.modulo-card .modulo-card-row {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  height: 100%;
}
.modulo-card .modulo-card-img-wrap {
  flex: 0 0 40%;
  max-width: 40%;
  aspect-ratio: auto;
  align-self: stretch;
  overflow: hidden;
  background: #f4f4f4;
}
.modulo-card .modulo-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.modulo-card .modulo-card-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 24px;
  gap: 0;
}
.modulo-card .modulo-card-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: nowrap;
}
.modulo-card .modulo-card-title .modulo-card-icon {
  flex-shrink: 0;
  margin-top: 2px;
}
.modulo-card .modulo-card-title h4,
.modulo-card .modulo-card-title h5 {
  margin: 0;
  display: block;
}
.modulo-card .modulo-card-cta {
  margin-top: auto;
  font-weight: 700;
  color: #8CC63F;
  font-size: 14px;
}

/* Integraciones: foto un poco m&aacute;s alta porque el texto es m&aacute;s largo
   (4 bullets + t&iacute;tulo + bajada vs 1 p&aacute;rrafo en m&oacute;dulos). El ancho
   queda IGUAL al de m&oacute;dulos (col-md-6 → mismo ratio). */
.integ-card .modulo-card-img-wrap {
  min-height: 220px;
}
.integ-card .integ-bullets {
  flex: 1 1 auto;
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.5;
}
.integ-card .integ-bullets li {
  margin-bottom: 6px;
}

/* Mobile: bajar a stack vertical en pantallas chicas */
@media (max-width: 575.98px) {
  .modulo-card .modulo-card-row {
    flex-direction: column;
  }
  .modulo-card .modulo-card-img-wrap {
    flex: 0 0 auto;
    max-width: 100%;
    aspect-ratio: 21 / 9;
  }
  .modulo-card .modulo-card-content { padding: 18px; }
}

/* ============================================================
 * §9 · Color de marca AyresKDS / AyresIA (slice naming)
 * ============================================================
 * Las paginas raiz NO cargan tokens.css (activacion diferida a la fase
 * de diseno), donde vive la unica definicion de .text-pos. Sin esta regla
 * los <span class="text-pos"> de las cards de AyresKDS/AyresIA en index y
 * productos quedan sin color. Las paginas de modulo son self-contained y
 * definen .text-pos en su <style> interno. Valor = --pos-500 oficial. */
.text-pos { color: #007ACC !important; }
.text-erp { color: #05A7AD !important; }  /* AyresERP teal oficial (brand-spec) */

/* §10 · Mobile: botones pill no desbordan el viewport (medido CDP 2026-08-12:
   el CTA "Contanos cual necesitas" de integraciones media 594px en un
   viewport de 390 -> horizontal wobble en toda la pagina). */
@media (max-width: 575.98px) {
  .btn.rounded-pill { white-space: normal; max-width: 100%; }
}
