/* Identidad visual por fabricante. Se enlaza DESPUES de styles.css.
   Se activa con <html data-theme="...">; el home no lleva el atributo y no cambia.
   Reutiliza los tokens de styles.css (--blue acento sobre claro, --blue-hi acento sobre oscuro,
   --navy secciones oscuras/hover, --night hero y pie, --paper secciones alternas, --r radio, --font).
   Tokens nuevos: --btn-r radio de botones, --glow resplandor del hero, --on-hi texto sobre --blue-hi.
   Fuentes: solo Archivo (autoalojada) o pila del sistema; las tipografias propias de cada marca NO se cargan.
   Estado de cada dato: VERIFICADO = leido en el sitio oficial (URL y sitio); INFERIDO = estimado.
   Contraste AA comprobado: texto sobre acento >= 4.5:1, acento vs fondo (enlace/foco) >= 3:1; ver notas por marca.
   Autorizacion: se usan colores de marca como referencia visual; sin logos ni imagenes de terceros. */

[data-theme] .btn { border-radius: var(--btn-r, var(--r)); }
[data-theme] .btn--primary:hover { background: var(--navy); }
[data-theme] .dark .btn--primary { background: var(--blue-hi); color: var(--on-hi); }
[data-theme] .dark .btn--primary:hover { background: var(--white); color: var(--night); }
[data-theme] .hero { background: var(--night) radial-gradient(60rem 28rem at 85% -10%, var(--glow), transparent 70%); }
[data-theme] ::selection { background: var(--blue-hi); color: var(--on-hi); }

/* TP-Link: teal.
   VERIFICADO #4acbd6 (https://static.tp-link.com/assets/css/common.css: outline de foco y boton); #1d2529 y #36444b
   (mismo CSS, texto oscuro); #f8f9fb (tp-link.com/co, fondo claro). Tipografia aktivGrotesk-corp (common.css): propietaria,
   se usa Archivo. INFERIDO: radio 4px y acento #007585 (teal de #4acbd6 oscurecido: #4acbd6 sobre blanco = 1.9:1 no pasa AA).
   Contraste: blanco/#007585 5.41; #007585 sobre paper 5.13; #4acbd6 sobre #1d2529 8.01; #0b1f24 sobre #4acbd6 8.74. */
:root[data-theme="tp-link"] {
  --blue: #007585; --blue-hi: #4acbd6; --on-hi: #0b1f24; --navy: #36444b; --night: #1d2529;
  --paper: #f8f9fb; --ink: #1d2529; --steel: #4b5a60; --line: rgba(29, 37, 41, .14);
  --r: 4px; --btn-r: 4px; --glow: rgba(74, 203, 214, .32);
}

/* Ajax Systems: negro y verde menta, botones pildora.
   VERIFICADO --bs-primary #5ae4aa, --bs-dark-4 #181818, gris #f7f7f7, radio de boton 50rem
   (https://ajax.systems/_next/static/chunks/0m8cpie9cialr.css); theme-color #000000 (https://ajax.systems/);
   tipografias Roboto y ajaxSpace (mismo CSS): se usa la pila del sistema (incluye Roboto si esta instalada).
   INFERIDO: acento sobre claro #007a52 (verde de #5ae4aa oscurecido; #5ae4aa sobre blanco = 1.7:1 no pasa AA).
   Contraste: blanco/#007a52 5.38; #007a52 sobre paper 5.02; #5ae4aa sobre #000 13.11; #06130d sobre #5ae4aa 11.85. */
:root[data-theme="ajax"] {
  --blue: #007a52; --blue-hi: #5ae4aa; --on-hi: #06130d; --navy: #181818; --night: #000;
  --paper: #f7f7f7; --ink: #181818; --steel: #4b4f54; --line: rgba(24, 24, 24, .12);
  --r: 16px; --btn-r: 999px; --glow: rgba(90, 228, 170, .22);
}
[data-theme="ajax"] .note { border-left-width: 0; border-radius: var(--r); }
/* Ajax: miniaturas de 250 px nativos. Cuadro 1:1 por imagen (sin CLS), contain, sin estirar mas de 250 px;
   el ancho por imagen depende de cuantas hay (1: grande y centrada, 2 y 4: dos por fila, 3 y 5: tres por fila). */
[data-theme="ajax"] .cell__imgs { display: flex; flex-wrap: wrap; height: auto; align-items: center; justify-content: center; gap: .5rem; }
[data-theme="ajax"] .cell__imgs img { flex: 0 0 calc((100% - 1rem) / 3); width: calc((100% - 1rem) / 3); max-width: 250px; height: auto; aspect-ratio: 1; }
[data-theme="ajax"] .cell__imgs img:only-child { flex-basis: min(100%, 11rem); width: min(100%, 11rem); }
[data-theme="ajax"] .cell__imgs:has(> img:nth-child(2):last-child) img,
[data-theme="ajax"] .cell__imgs:has(> img:nth-child(4):last-child) img { flex-basis: calc((100% - .5rem) / 2); width: calc((100% - .5rem) / 2); }
/* Ultima fila incompleta: fondo blanco (no el gris de las lineas) y separadores propios en cada tarjeta */
[data-theme="ajax"] .grid { background: var(--white); }
[data-theme="ajax"] .cell { box-shadow: 0 0 0 1px var(--line); }

/* Dahua: azul sobre negro calido.
   VERIFICADO #3a66fb (43 usos) y #231815 (47 usos, texto) en https://www.dahuasecurity.com/assets/css/common.css;
   Montserrat (mismo CSS, no se carga: se usa Archivo). Rojo #e60012 del mismo CSS (no se usa como acento).
   INFERIDO: acento #3459eb (#3a66fb oscurecido un paso: sobre paper daba 4.35, bajo AA), fondo #1b2a5c, radio 2px (escuadrado).
   Contraste: ver tabla del script (blanco/acento >= 4.5, #8fa9ff sobre #231815 7.66). */
:root[data-theme="dahua"] {
  --blue: #3459eb; --blue-hi: #8fa9ff; --on-hi: #10162e; --navy: #1b2a5c; --night: #231815;
  --paper: #f3f6ff; --ink: #231815; --steel: #4d4947; --line: rgba(35, 24, 21, .15);
  --r: 2px; --btn-r: 2px; --glow: rgba(58, 102, 251, .5);
}

/* Hikvision: rojo sobre grafito. Sitio bloqueado (reto anti-bot en https://www.hikvision.com/es-la/): TODO INFERIDO.
   Rojo de marca conocido ~#e31e24 (no se pudo leer); para texto/boton sobre claro se usa #d0101f (blanco/acento 5.56),
   #ff6b6b sobre oscuro (6.52 sobre #161616). Tipografia: Hikvision usa Arial/Helvetica (INFERIDO): pila del sistema. Radio 0-2px (INFERIDO).
   Contraste: acento sobre paper 5.10; #1a0507 sobre #ff6b6b 7.08. Re-verificar con acceso manual al sitio.
   El color del tema es INFERIDO; sin imagenes de producto (el sitio oficial bloquea la lectura): las categorias van como filas compactas. */
:root[data-theme="hikvision"] {
  --blue: #d0101f; --blue-hi: #ff6b6b; --on-hi: #1a0507; --navy: #2b2b2b; --night: #161616;
  --paper: #f5f5f5; --ink: #1a1a1a; --steel: #4d4d4d; --line: rgba(26, 26, 26, .14);
  --r: 2px; --btn-r: 0; --glow: rgba(227, 30, 36, .38);
}

/* ZKTeco: verde y grafito.
   VERIFICADO #7ac143 (9 usos), #2c2d33 (4), tipografias Poppins/Inter/Montserrat en https://zktecolatinoamerica.com/ (CSS inline);
   no se cargan, se usa Archivo. INFERIDO: acento sobre claro #3f7a14 (#7ac143 sobre blanco = 2.2:1 no pasa AA), radio 10px, fondo #1a1b1f.
   Contraste: blanco/#3f7a14 5.24; sobre paper 4.89; #7ac143 sobre #1a1b1f 7.81; #10200a sobre #7ac143 7.73. */
:root[data-theme="zkteco"] {
  --blue: #3f7a14; --blue-hi: #7ac143; --on-hi: #10200a; --navy: #2c2d33; --night: #1a1b1f;
  --paper: #f5f8f1; --ink: #1a1b1f; --steel: #4b4f45; --line: rgba(44, 45, 51, .14);
  --r: 10px; --btn-r: 10px; --glow: rgba(122, 193, 67, .3);
}
[data-theme="zkteco"] .seg-h:not(.seg-h--sec) { border-top-color: var(--blue); }

/* Imagenes de producto (tp-link.html): caja de altura fija (sin CLS), object-fit contain, fondo claro uniforme */
.cell__imgs { display: flex; gap: .5rem; align-items: center; justify-content: center; height: 10rem; padding: .5rem; background: var(--img-bg); border-radius: var(--r); }
.cell__imgs img { flex: 1 1 0; min-width: 0; max-width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.cell h4, .cell h5 { font-size: 1.25rem; line-height: 1.22; font-weight: 800; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
.img-note { margin-top: .5rem; font-size: .875rem; color: var(--steel); }

/* Indice y segmentos (tp-link.html). Negocios = lineas que atiende Inntelligent (celdas blancas);
   Hogar e ISP = lineas del portafolio del fabricante (celdas en --paper, titulo de segmento mas discreto). */
.seg-index { margin-bottom: 2.5rem; padding: 1rem 1.25rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.seg-index ul { display: grid; gap: .25rem; }
.seg-index li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; padding-block: .6rem; border-top: 1px solid var(--line); }
.seg-index li:first-child { border-top: 0; }
.seg-index strong { flex: 0 0 100%; font-size: .9375rem; }
.seg-index a, .seg-chips a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .4rem .8rem; font-weight: 600; font-size: .9375rem; line-height: 1.2; color: var(--blue); background: var(--white); border: 1px solid var(--line); border-radius: var(--btn-r, var(--r)); text-decoration: none; }
.seg-index a:hover, .seg-chips a:hover { border-color: var(--blue); }
.seg-index a:active, .seg-chips a:active { background: var(--blue); color: var(--white); }
.seg-h { margin: 3rem 0 1rem; padding-top: 1.25rem; border-top: 3px solid var(--night); font-size: 1.75rem; text-wrap: balance; }
.seg-h:first-of-type { margin-top: 0; }
.seg-h--sec { border-top-color: var(--steel); font-size: 1.5rem; }
.seg-lead { margin-bottom: 1rem; }
.seg-sub { margin: 2rem 0 .75rem; font-size: 1.0625rem; font-weight: 800; color: var(--ink); text-wrap: balance; scroll-margin-top: 5.5rem; }
.grid--sec .cell { background: var(--sec-bg); }
.grid--sec .cell__imgs { background: var(--white); }
.seg-top { margin-top: 1rem; text-align: right; }
.seg-top a, .back a, .crumb a { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: .25rem; }
.back { margin-top: 1.5rem; }
.crumb { margin-top: 0; }
.cell[id], .seg-h[id], .seg-sub[id], .seg-index[id], .sec[id], .lead[id], .seg-bar[id] { scroll-margin-top: 5.5rem; }
@media (min-width: 48rem) { .seg-index strong { flex: 0 0 15rem; } .seg-index li { flex-wrap: wrap; } }
/* Enlaces en linea dentro de textos: area tactil de 44px sin alterar el interlineado */
.lead a { padding-block: .8rem; margin-block: -.8rem; }

/* Dahua (y genericas): filas de categoria sin imagen. Titulo a la izquierda, lista de nombres a la derecha;
   en movil se apilan. Sustituye a tarjetas vacias de imagen (Dahua prohibe descargar sus imagenes). */
.stack--cat { margin-top: 1rem; }
.stack--cat > li { gap: .5rem 2rem; align-items: start; scroll-margin-top: 5.5rem; }
.stack--cat .stack__h { display: grid; gap: .4rem; justify-items: start; align-content: start; }
.stack--cat .stack__b { display: grid; gap: .4rem; max-width: 46rem; }
.stack--cat h3, .stack--cat h4 { font-size: 1.125rem; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; margin: 0; }
@media (min-width: 48rem) { .stack--cat > li { grid-template-columns: 17rem 1fr; } }
/* Seis tarjetas: 1 / 2 / 3 columnas, sin ultima fila incompleta */
.grid--6 { grid-template-columns: 1fr; }
@media (min-width: 40rem) { .grid--6 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .grid--6 { grid-template-columns: repeat(3, 1fr); } }
/* Nota regulatoria: medida legible, fuentes como botones de 44 px */
.note--reg { max-width: 60rem; margin-top: 2rem; border-left-width: 0; border: 1px solid var(--line); border-radius: var(--r); }
.note--reg h3 { font-size: 1.125rem; margin-bottom: .6rem; text-wrap: balance; }
.note--reg p + p { margin-top: .6rem; }
.note--reg p, .note--reg li { max-width: 70ch; }
.src { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .25rem; }
.src a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .4rem 1rem; font-weight: 600; color: var(--blue); background: var(--white); border: 1px solid var(--blue); border-radius: var(--btn-r, var(--r)); }
.src a:hover { background: var(--blue); color: var(--white); }
[data-theme="dahua"] .two > .sec__head, [data-theme="hikvision"] .two > .sec__head, [data-theme="zkteco"] .two > .sec__head { margin-bottom: 0; }
/* Enlaces en linea dentro de filas de lista (stack): area tactil de 44px sin alterar el interlineado */
.stack a { padding-block: .8rem; margin-block: -.8rem; }

/* Líneas del portafolio: una sección por línea; los chips de categoría viven dentro de su línea */
.seg-bar-wrap { padding-block: 2rem 0; }
.seg-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.seg-bar .seg-chips { margin-bottom: 0; }
.seg .rows { margin-bottom: 2rem; }
.seg-bar { margin-top: 1.5rem; }
.rows + .seg-chips { margin-top: 1.5rem; }
