/* =======================================================
   SIVICON MX  —  styles-sub.css
   Estilos de subpáginas (complementa styles.css)
   ======================================================= */

/* -------------------------------------------------------
   HERO DE SUBPÁGINA
------------------------------------------------------- */
.sub-hero {
  background: #111111;
  position: relative;
  overflow: hidden;
  padding: 52px 0 56px;
  border-bottom: 3px solid #CC0000;
}
.sub-hero-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(204,0,0,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(204,0,0,.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.sub-hero-inner { position: relative; z-index: 1; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.45);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumb a { color: rgba(255,255,255,.55); transition: color .18s; }
.breadcrumb a:hover { color: #ffffff; }
.breadcrumb span[aria-current] { color: #CC0000; font-weight: 600; }

/* Título */
.sub-hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 14px;
  letter-spacing: -.01em;
}
.sub-hero-title-red { color: #CC0000; }

.sub-hero-desc {
  font-size: 16px;
  color: rgba(255,255,255,.62);
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 28px;
}

/* Pills de navegación interna */
.sub-hero-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  transition: background .18s, color .18s, border-color .18s;
  white-space: nowrap;
}
.filter-pill:hover {
  background: #CC0000;
  color: #ffffff;
  border-color: #CC0000;
}

/* -------------------------------------------------------
   INTRO DE PÁGINA (texto + imagen lateral)
------------------------------------------------------- */
.page-intro {
  background: #ffffff;
  padding: 56px 0;
  border-bottom: 1px solid #eeeeee;
}
.page-intro-inner {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 56px;
  align-items: center;
}
.page-intro-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #111111;
  margin-bottom: 16px;
  line-height: 1.2;
}
.page-intro-text p {
  font-size: 15px;
  color: #555555;
  line-height: 1.7;
  margin-bottom: 14px;
}
.page-intro-img {
  position: relative;
}
.page-intro-img img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  max-height: 360px;
  border: 2px solid rgba(204,0,0,.25);
}
.page-intro-img.img-error img { display: none; }
.page-intro-img-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  height: 260px;
  background: #f6f6f6;
  border-radius: 10px;
  border: 2px dashed #dddddd;
}
.page-intro-img.img-error .page-intro-img-fallback { display: flex; }
.page-intro-stat-card {
  position: absolute;
  bottom: -18px;
  right: -18px;
  background: #CC0000;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 18px rgba(204,0,0,.4);
}
.page-intro-stat-card strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.page-intro-stat-card span { font-size: 12px; opacity: .88; }

/* -------------------------------------------------------
   SECCIÓN DE CATEGORÍA
------------------------------------------------------- */
.cat-section { background: #ffffff; padding: 60px 0; }
.cat-section-alt { background: #f6f6f6; }

/* Cabecera */
.cat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.cat-header-text { flex: 1; min-width: 260px; }
.cat-header-cta  { flex-shrink: 0; padding-top: 8px; }

.cat-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #888888;
  margin-bottom: 10px;
}
.cat-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-icon-blue   { background: #ebf4ff; color: #1a6fc4; }
.cat-icon-red    { background: #fff0f0; color: #CC0000; }
.cat-icon-amber  { background: #fff5e0; color: #a06000; }
.cat-icon-teal   { background: #e0f5f2; color: #09806a; }
.cat-icon-purple { background: #f0ecff; color: #5533cc; }

.cat-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #111111;
  margin-bottom: 10px;
  letter-spacing: -.01em;
}
.cat-desc {
  font-size: 15px;
  color: #666666;
  line-height: 1.7;
  max-width: 540px;
  margin: 0;
}

/* -------------------------------------------------------
   GRID DE TARJETAS
------------------------------------------------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.cat-card {
  background: #ffffff;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .18s;
}
.cat-section-alt .cat-card { background: #ffffff; }
.cat-card:hover {
  border-color: #CC0000;
  box-shadow: 0 6px 22px rgba(204,0,0,.12);
  transform: translateY(-2px);
}

/* Imagen */
.cat-card-img-wrap {
  position: relative;
  width: 100%;
  height: 185px;
  overflow: hidden;
  background: #f0f0f0;
}
.cat-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.cat-card:hover .cat-card-img-wrap img { transform: scale(1.04); }
.cat-card-img-wrap.img-error img { display: none; }
.cat-card-img-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: #f6f6f6;
}
.cat-card-img-wrap.img-error .cat-card-img-fallback { display: flex; }

/* Cuerpo */
.cat-card-body { padding: 18px 20px 12px; flex: 1; }
.cat-card-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  background: #fff0f0;
  color: #CC0000;
  border: 1px solid #ffc8c8;
}
.cat-card-badge-blue   { background: #ebf4ff; color: #1a6fc4; border-color: #b8d9f8; }
.cat-card-badge-dark   { background: #1a1a1a; color: #ffffff; border-color: #333333; }
.cat-card-badge-fire   { background: #fff3e0; color: #c05000; border-color: #ffd49a; }
.cat-card-badge-amber  { background: #fff5e0; color: #a06000; border-color: #fde0a0; }
.cat-card-badge-teal   { background: #e0f5f2; color: #09806a; border-color: #9de0d6; }

.cat-card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #111111;
  margin-bottom: 8px;
  line-height: 1.3;
}
.cat-card-desc {
  font-size: 13.5px;
  color: #666666;
  line-height: 1.6;
  margin-bottom: 12px;
}
.cat-card-specs { display: flex; flex-direction: column; gap: 5px; }
.cat-card-specs li {
  font-size: 13px;
  color: #555555;
  padding-left: 14px;
  position: relative;
  line-height: 1.45;
}
.cat-card-specs li::before {
  content: '';
  position: absolute;
  left: 0; top: 6px;
  width: 5px; height: 5px;
  background: #CC0000;
  border-radius: 50%;
}
.cat-card-specs strong { color: #333333; font-weight: 600; }

/* Footer de tarjeta */
.cat-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid #eeeeee;
  margin-top: auto;
  flex-wrap: wrap;
}
.cat-card-nota { font-size: 12px; color: #999999; font-style: italic; }

/* -------------------------------------------------------
   TABLA DE INFORMACIÓN
------------------------------------------------------- */
.info-table-wrap {
  background: #f6f6f6;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 24px 24px 18px;
  margin-top: 8px;
}
.cat-section-alt .info-table-wrap { background: #ffffff; }
.info-table-title {
  font-size: 16px;
  font-weight: 700;
  color: #111111;
  margin-bottom: 14px;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 480px;
}
.info-table thead tr { background: #111111; color: #ffffff; }
.info-table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .03em;
  white-space: nowrap;
}
.info-table th:first-child { border-radius: 6px 0 0 0; }
.info-table th:last-child  { border-radius: 0 6px 0 0; }
.info-table tbody tr { border-bottom: 1px solid #eeeeee; transition: background .15s; }
.info-table tbody tr:last-child { border-bottom: none; }
.info-table tbody tr:hover { background: #fff6f6; }
.info-table td { padding: 10px 16px; color: #444444; vertical-align: middle; }
.info-table-note {
  font-size: 12.5px;
  color: #888888;
  margin-top: 12px;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Badges de nivel */
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  white-space: nowrap;
}
.level-1 { background: #e8f6ea; color: #1d7033; }
.level-2 { background: #fff5e0; color: #a06000; }
.level-3 { background: #fff0f0; color: #AA0000; }
.level-4 { background: #fde8e8; color: #880000; }
.level-5 { background: #111111; color: #ffffff; }

/* -------------------------------------------------------
   BANNER DE USO
------------------------------------------------------- */
.use-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #fff8e8;
  border: 1px solid #fde0a0;
  border-left: 4px solid #CC0000;
  border-radius: 8px;
  padding: 18px 22px;
}
.use-banner-icon { font-size: 26px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.use-banner-text { font-size: 14px; color: #555555; line-height: 1.65; }
.use-banner-text strong {
  display: block;
  font-weight: 700;
  color: #111111;
  margin-bottom: 4px;
  font-size: 14.5px;
}

/* -------------------------------------------------------
   ACCESORIOS
------------------------------------------------------- */
.acc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.acc-card {
  background: #f6f6f6;
  border: 1px solid #eeeeee;
  border-radius: 10px;
  padding: 20px 18px;
  transition: border-color .2s, box-shadow .18s;
}
.acc-card:hover { border-color: #CC0000; box-shadow: 0 3px 10px rgba(204,0,0,.1); }
.acc-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.acc-card strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #111111;
  margin-bottom: 6px;
}
.acc-card p { font-size: 13px; color: #666666; line-height: 1.55; margin: 0; }

/* -------------------------------------------------------
   RELATED / OTRAS PUERTAS
------------------------------------------------------- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.related-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #f6f6f6;
  border: 1px solid #eeeeee;
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  transition: border-color .2s, box-shadow .18s, transform .16s;
  color: inherit;
}
.related-card:hover {
  border-color: #CC0000;
  box-shadow: 0 4px 12px rgba(204,0,0,.1);
  transform: translateY(-2px);
}
.related-icon { font-size: 28px; display: block; line-height: 1; }
.related-card strong { font-size: 15px; font-weight: 700; color: #111111; }
.related-card span { font-size: 12.5px; color: #888888; }

/* -------------------------------------------------------
   PÁGINA ÍNDICE DE PUERTAS — GRID
------------------------------------------------------- */
.cat-index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.cat-index-card {
  background: #ffffff;
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  transition: border-color .2s, box-shadow .2s, transform .18s;
}
.cat-index-card:hover {
  border-color: #CC0000;
  box-shadow: 0 8px 28px rgba(204,0,0,.13);
  transform: translateY(-3px);
}
.cat-index-img-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f0f0f0;
}
.cat-index-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.cat-index-card:hover .cat-index-img-wrap img { transform: scale(1.06); }
.cat-index-img-wrap.img-error img { display: none; }
.cat-index-img-wrap.img-error .cat-card-img-fallback {
  display: flex;
  height: 100%;
}
.cat-index-badge {
  position: absolute;
  bottom: 10px;
  left: 12px;
  background: rgba(17,17,17,.78);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.cat-index-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.cat-index-title {
  font-size: 19px;
  font-weight: 800;
  color: #111111;
  margin-bottom: 8px;
  line-height: 1.2;
}
.cat-index-desc {
  font-size: 13.5px;
  color: #666666;
  line-height: 1.6;
  margin-bottom: 14px;
}
.cat-index-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 18px;
}
.cat-index-items li {
  font-size: 13px;
  color: #555555;
  padding-left: 16px;
  position: relative;
}
.cat-index-items li::before {
  content: '';
  position: absolute;
  left: 0; top: 6px;
  width: 5px; height: 5px;
  background: #CC0000;
  border-radius: 50%;
}
.cat-index-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 700;
  color: #CC0000;
  margin-top: auto;
  transition: gap .18s;
}
.cat-index-card:hover .cat-index-cta { gap: 9px; }

/* -------------------------------------------------------
   RESPONSIVE — TABLET ≤992px
------------------------------------------------------- */
@media screen and (max-width: 992px) {
  .sub-hero-title { font-size: 2rem; }
  .cat-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .cat-header-cta { padding-top: 0; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-intro-inner { grid-template-columns: 1fr; }
  .page-intro-img { display: none; }
  .acc-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-index-grid { grid-template-columns: repeat(2, 1fr); }
}

/* -------------------------------------------------------
   RESPONSIVE — MÓVIL ≤640px
------------------------------------------------------- */
@media screen and (max-width: 640px) {
  .sub-hero { padding: 36px 0 42px; }
  .sub-hero-title { font-size: 1.7rem; }
  .sub-hero-filters { gap: 8px; }
  .filter-pill { font-size: 12.5px; padding: 6px 14px; }
  .cat-section, .cat-section-alt { padding: 42px 0; }
  .cat-grid { grid-template-columns: 1fr; }
  .cat-card-img-wrap { height: 200px; }
  .info-table-wrap { padding: 16px 14px; }
  .acc-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .cat-index-grid { grid-template-columns: 1fr; }
  .use-banner { flex-direction: column; gap: 10px; }
  .page-intro { padding: 36px 0; }
}
