/* ==========================================================
   PALETA TÉCNICA INDUSTRIAL
   ========================================================== */

:root {
  --bs-body-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --bs-primary: #2c5475;
  --bs-primary-rgb: 48, 99, 141;
  --bs-secondary: #64748B;
  --bs-secondary-rgb: 100, 116, 139;
  --bs-info: #0284C7;
  --bs-info-rgb: 2, 132, 199;
  --bs-success: #16A34A;
  --bs-success-rgb: 22, 163, 74;
  --bs-warning: #D97706;
  --bs-warning-rgb: 217, 119, 6;
  --bs-danger: #DC2626;
  --bs-danger-rgb: 220, 38, 38;

  --bs-body-color: #0F172A;
  --bs-body-color-rgb: 15, 23, 42;
  --bs-secondary-color: #475569;
  --bs-body-bg: #F8FAFC;
  --bs-body-bg-rgb: 248, 250, 252;

  --bs-border-color: #CBD5E1;
  --bs-border-radius-sm: .25rem;
  --bs-border-radius: .375rem;
  --bs-border-radius-lg: .5rem;

  --bs-box-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, .05);
  --bs-box-shadow: 0 4px 6px -1px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --bs-box-shadow-lg: 0 12px 20px -4px rgba(15, 23, 42, .12);
}

/* ==========================================================
   1. TIPOGRAFÍA Y ELEMENTOS BASE
   ========================================================== */
body {
  font-family: var(--bs-body-font-family);
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--bs-primary);
  font-weight: 700;
}

/* ==========================================================
   2. SECCIONES Y CONTENEDORES
   ========================================================== */
section {
  position: relative;
  padding-block: 3.5rem;
}
@media (min-width: 992px) {
  section { padding-block: 5rem; }
}

/* Gutter horizontal ampliado; los max-width los define Bootstrap */
.container,
.container-fluid {
  padding-inline: 1.5rem;
}

/* ==========================================================
   3. BOTONES
   ========================================================== */
.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: #254e70;
  --bs-btn-hover-border-color: #254e70;
  --bs-btn-active-bg: #1f4560;
  --bs-btn-active-border-color: #1f4560;
  --bs-btn-font-weight: 600;
}

.btn-secondary { --bs-btn-bg: var(--bs-secondary); --bs-btn-border-color: var(--bs-secondary); }
.btn-info      { --bs-btn-bg: var(--bs-info);      --bs-btn-border-color: var(--bs-info); }
.btn-success   { --bs-btn-bg: var(--bs-success);   --bs-btn-border-color: var(--bs-success); }
.btn-warning   { --bs-btn-bg: var(--bs-warning);   --bs-btn-border-color: var(--bs-warning); }
.btn-danger    { --bs-btn-bg: var(--bs-danger);    --bs-btn-border-color: var(--bs-danger); }

.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-font-weight: 700;
  --bs-btn-border-width: 2px;
}

/* ==========================================================
   4. UTILIDADES DE TEXTO
   ========================================================== */
.text-secondary { color: var(--bs-secondary-color) !important; }

.text-label-uppercase {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--bs-success);
}

.ls-2 { letter-spacing: 1.5px; }

/* ==========================================================
   5. TARJETAS
   ========================================================== */
.card {
  background-color: #fff;
  border-color: var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow);
}

/* ==========================================================
   6. SECTORES – CARRUSEL HORIZONTAL
   ========================================================== */
.sectores-scroll {
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: .5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--bs-border-color) transparent;
}
.sectores-scroll::-webkit-scrollbar        { height: 6px; }
.sectores-scroll::-webkit-scrollbar-thumb  { background-color: var(--bs-border-color); border-radius: 3px; }
.sectores-scroll::-webkit-scrollbar-track  { background: transparent; }

.sectores-scroll .sector-item {
  width: 78%;
  scroll-snap-align: start;
}

.sectores-wrapper {
  position: relative;
  --sectores-fade: 255, 255, 255;
}
.sectores-wrapper::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 70px; height: 100%;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(to right,
    rgba(var(--sectores-fade), 0) 0%,
    rgba(var(--sectores-fade), .85) 60%,
    rgba(var(--sectores-fade), 1) 100%);
}

.sectores-hint {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .65rem;
  border-radius: 50rem;
  background: var(--bs-primary);
  color: #fff;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), .30);
  animation: sectores-hint-pulse 2s ease-in-out infinite;
  transition: opacity .3s ease, transform .3s ease;
}
.sectores-hint i { font-size: .625rem; }

@keyframes sectores-hint-pulse {
  0%, 100% { transform: translateY(-50%) translateX(0);  opacity: 1; }
  50%      { transform: translateY(-50%) translateX(4px); opacity: .85; }
}

.sectores-hint--hidden {
  opacity: 0;
  transform: translateY(-50%) translateX(20px);
  pointer-events: none;
}

/* ==========================================================
   7. CTA FLOTANTE WHATSAPP
   ========================================================== */
.cta-whatsapp {
  width: 56px;
  height: 56px;
  z-index: 1030;
}

/* ==========================================================
   8. NOTICIAS – ESTILO PERIÓDICO
   ========================================================== */
.noticias-estilo-periodico .mod-list {
  list-style: none;
  margin: 0; padding: 0;
}
.noticias-estilo-periodico .mod-list > li {
  display: grid;
  grid-template-columns: 170px 1fr;
  grid-template-areas: "imagen titulo" "imagen texto" "imagen leer";
  column-gap: 1.25rem;
  row-gap: .45rem;
  align-items: start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--bs-border-color);
  transition: transform .25s ease;
}
.noticias-estilo-periodico .mod-list > li:last-child { border-bottom: none; }

.noticias-estilo-periodico .newsflash-image {
  grid-area: imagen;
  margin: 0;
  overflow: hidden;
  border-radius: var(--bs-border-radius);
  background: var(--bs-tertiary-bg, #f5f5f5);
  box-shadow: var(--bs-box-shadow-sm);
}
.noticias-estilo-periodico .newsflash-image img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform .35s ease;
}

.noticias-estilo-periodico .newsflash-title {
  grid-area: titulo;
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 700;
}
.noticias-estilo-periodico .newsflash-title a {
  color: var(--bs-body-color);
  text-decoration: none;
  transition: color .25s ease;
}

.noticias-estilo-periodico .mod-list > li > p:not(.readmore) {
  grid-area: texto;
  margin: 0;
  color: var(--bs-secondary-color);
  font-size: .92rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.noticias-estilo-periodico .readmore {
  grid-area: leer;
  margin-top: .35rem;
}
.noticias-estilo-periodico .readmore .btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--bs-primary);
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: color .2s ease;
}
.noticias-estilo-periodico .readmore .btn:hover,
.noticias-estilo-periodico .readmore .btn:focus-visible {
  text-decoration: underline;
  color: var(--bs-primary);
}

/* ==========================================================
   9. BLOG / INTRO – TARJETAS
   ========================================================== */
:is(.blog-item, .com-content-category-blog__item, .com-content-featured__item) {
  background-color: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg, .5rem);
  box-shadow: var(--bs-box-shadow-sm);
  padding: 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
  will-change: transform, box-shadow;
}
:is(.blog-item, .com-content-category-blog__item, .com-content-featured__item) .item-image {
  margin-bottom: 1.25rem;
  border-radius: var(--bs-border-radius, .375rem);
  overflow: hidden;
}
:is(.blog-item, .com-content-category-blog__item, .com-content-featured__item) .item-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}
:is(.blog-item, .com-content-category-blog__item, .com-content-featured__item) .item-content {
  padding-inline: .5rem;
}
:is(.blog-item, .com-content-category-blog__item, .com-content-featured__item) .item-title       { margin-bottom: 1rem; }
:is(.blog-item, .com-content-category-blog__item, .com-content-featured__item) .item-introtext   { margin-bottom: 1.5rem; }
:is(.blog-item, .com-content-category-blog__item, .com-content-featured__item) .readmore {
  margin-top: auto;
  padding-top: 1rem;
}

/* ==========================================================
   10. ACCESIBILIDAD
   ========================================================== */
:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bs-primary);
  color: #fff;
  padding: .5rem 1rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
  transition: top .2s ease-in-out;
}
.skip-link:focus-visible { top: 0; color: #fff; }

/* ==========================================================
   11. MEDIA QUERIES
   ========================================================== */
@media (hover: hover) and (pointer: fine) {
  .noticias-estilo-periodico .mod-list > li:hover                         { transform: translateX(4px); }
  .noticias-estilo-periodico .mod-list > li:hover .newsflash-image img    { transform: scale(1.06); }
  .noticias-estilo-periodico .newsflash-title a:hover                     { color: var(--bs-primary); }

  :is(.blog-item, .com-content-category-blog__item, .com-content-featured__item):hover {
    transform: translateY(-5px);
    box-shadow: var(--bs-box-shadow-lg);
  }
}

@media (max-width: 991.98px) {
  .navbar-toggler {
    border: 2px solid var(--bs-primary);
    padding: .4rem .6rem;
    border-radius: var(--bs-border-radius);
  }
  .navbar-toggler .icon-menu { color: var(--bs-primary); }

  footer { padding-bottom: 4.5rem; }

  .noticias-estilo-periodico .mod-list > li {
    grid-template-columns: 140px 1fr;
    column-gap: 1rem;
  }
}

@media (max-width: 575.98px) {
  h1, .h1, .fs-1 { font-size: 1.75rem  !important; }
  h2, .h2, .fs-2 { font-size: 1.5rem   !important; }
  h3, .h3, .fs-3 { font-size: 1.25rem  !important; }
  h4, .h4, .fs-4 { font-size: 1.125rem !important; }

  .noticias-estilo-periodico .mod-list > li {
    grid-template-columns: 1fr;
    grid-template-areas: "imagen" "titulo" "texto" "leer";
    row-gap: .75rem;
  }
  .noticias-estilo-periodico .newsflash-image img { aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .sectores-hint { animation: none; }
  :is(.blog-item, .com-content-category-blog__item, .com-content-featured__item)          { transition: none; }
  :is(.blog-item, .com-content-category-blog__item, .com-content-featured__item):hover    { transform: none; }
}

/* ==========================================================
   12. IMPRESIÓN
   ========================================================== */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .navbar, .navbar-toggler, .skip-link, .cta-whatsapp,
  .sectores-hint, .accordion-button::after, footer,
  .sectores-wrapper::after {
    display: none !important;
  }
  img {
    display: block !important;
    visibility: visible !important;
    max-width: 100% !important;
    page-break-inside: avoid !important;
  }
  section, .card, .col-lg-6 {
    page-break-inside: avoid !important;
  }
  .btn {
    display: inline !important;
    background: transparent !important;
    color: #000 !important;
    border: none !important;
    padding: 0 !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
  }
  a { color: #000 !important; }
}