/**
 * Inicio - SIIEHD
 * Developed by: Atenciones Web
 * https://atencionesweb.com | contacto@atencionesweb.com
 */

/* =========================
   Base / Layout
========================= */
.home{
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Panel dinámico */
.dynamic-panel[hidden]{ display: none; }
.dynamic-panel{
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Panel tipo “Lean” (cuando se abre un catálogo) */
.catalog-panel{
  max-width: 1080px;
  margin: 18px auto 60px;
  padding: 0 16px;
}

.catalog-topbar{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin: 6px 0 16px;
}

.catalog-topbar [data-action="back"]{
  border: 1px solid #d9d9d9;
  background: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}
.catalog-topbar [data-action="back"]:hover{ background: #f5f5f5; }

.catalog-error{
  max-width: 1080px;
  margin: 18px auto 60px;
  padding: 18px 16px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
}

/* =========================
   Slider (Hero)
========================= */
.hero-slider{
  width: 100%;
  margin: 0;
  padding: 0;
}

.hero-slider .slider{
  position: relative;
  overflow: hidden;
}

.hero-slider .slides{ display: block; }

.hero-slider .slide{
  display: none;
  width: 100%;
  height: auto;
  cursor: pointer;
  position: relative;
}
.hero-slider .slide.is-active{ display: block; }

.hero-slider .slide img{
  width: 100%;
  height: auto;
  display: block;
}

/* Flechas */
.hero-slider .slider-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(0,0,0,0.45);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 26px;
  line-height: 44px;
  text-align: center;
  z-index: 9999;
  pointer-events: auto;
}

.hero-slider .slider-btn.prev{ left: 12px; }
.hero-slider .slider-btn.next{ right: 12px; }

.hero-slider .slider-btn:hover{ background: rgba(0,0,0,0.65); }

/* =========================
   Overlay del Banner
========================= */
.hero-slider .slide-overlay{
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 18px;
  background: rgba(0,0,0,.45);
  pointer-events: none;
}

.hero-slider .slide-box{
  max-width: 980px;
  width: min(980px, 92%);
  text-align: center;
  padding: 22px 18px;
  border-radius: 18px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
}

.hero-slider .slide-title{
  margin: 0;
  color: #fff;
  font-weight: 800;
  letter-spacing: .2px;
  font-size: clamp(1.6rem, 3.6vw, 3.1rem);
  line-height: 1.12;
  opacity: 0;
  transform: translateY(26px);
  will-change: transform, opacity;
}

.hero-slider .slide-sub{
  margin: 10px 0 0;
  color: rgba(255,255,255,.92);
  font-size: clamp(.95rem, 1.6vw, 1.2rem);
  line-height: 1.35;
  opacity: 0;
  transform: translateY(22px);
  will-change: transform, opacity;
}

.hero-slider .slide.is-active .animate-in{
  animation: siiehdSlideFadeUp .85s ease-out forwards;
}
.hero-slider .slide.is-active .slide-sub.animate-in{
  animation-delay: .08s;
}

@keyframes siiehdSlideFadeUp{
  to{ opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce){
  .hero-slider .slide-title,
  .hero-slider .slide-sub{
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

@media (max-width: 768px){
  .hero-slider .slide-overlay{ padding: 18px 14px; }
  .hero-slider .slide-box{
    padding: 18px 14px;
    border-radius: 16px;
  }
}

/* =========================
   Sistemas / Soluciones
========================= */
.systems,
.solutions{
  max-width: 1080px;
  margin: 26px auto 0;
  padding: 0 16px;
}

.systems-head h2,
.solutions-head h2{
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 800;
}

.systems-grid,
.solutions-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Cards generales */
.system-card,
.solution-card{
  border: 1px solid #eee;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.system-card:hover,
.solution-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
.system-card img,
.solution-card img{
  width: 84px;
  height: 84px;
  object-fit: contain;
  display: block;
}
.system-card span,
.solution-card span{
  font-weight: 700;
  font-size: 14px;
}

/* =========================
   Catálogo portada pequeña
========================= */
.systems-grid--single{
  grid-template-columns: 1fr !important;
}

.catalog-card{
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: none;
}

.catalog-card--compact{
  align-items: flex-start;
}

.catalog-title{
  font-weight: 800;
  font-size: 16px;
}

.thumb{
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
}

/* portada solamente */
.thumb--cover-only{
  width: 220px;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  margin: 0;
}

.thumb-img--cover-only{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* cualquier iframe/pdf previo se oculta */
.thumb-pdf,
.thumb-pdf--compact{
  display: none !important;
}

.catalog-actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}

.btn-mini{
  display: inline-block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  color: #222;
  background: #fff;
}

.btn-mini.primary{
  background: #0b5cff;
  color: #fff;
  border-color: #0b5cff;
}

/* =========================
   Visor PDF (si el panel dinámico sigue existiendo)
========================= */
.pdf-viewer{
  max-width: 760px;
  margin: 0 auto;
  padding: 18px;
}

.pdf-topbar{
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pdf-title{ font-weight: 800; }

.pdf-back,
.pdf-prev,
.pdf-next{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  cursor: pointer;
}

.pdf-download{
  padding: 10px 12px;
  border-radius: 12px;
  background: #0b5cff;
  color: #fff;
  text-decoration: none;
}

.pdf-controls{
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pdf-page-input{
  width: 90px;
  padding: 9px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  text-align: center;
}

.pdf-stage{
  display: flex;
  justify-content: center;
}

.pdf-canvas{
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
}

.pdf-fallback{
  width: 100%;
  height: 80vh;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
  background: #fff;
}

/* =========================
   Sección inferior
========================= */
.info-2cols{
  max-width: 1080px;
  margin: 30px auto 60px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.col{
  border: 1px solid #eee;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}

.col-head h2{
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
}

/* Accordion */
.accordion .acc-item{
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid #eee;
  background: #fafafa;
  padding: 12px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  margin: 10px 0 8px;
}

.accordion .acc-panel{
  border: 1px solid #eee;
  border-top: 0;
  padding: 12px;
  border-radius: 0 0 12px 12px;
  margin-top: -8px;
  background: #fff;
}

.why-box{
  border: 1px solid #eee;
  border-radius: 14px;
  background: #fafafa;
  padding: 14px;
}

.why-link{
  display: inline-block;
  margin-top: 10px;
  font-weight: 800;
  text-decoration: none;
}

/* =========================
   Modo Catálogo
========================= */
body.catalog-open #home-cover,
body.catalog-open #home-lower{
  display: none !important;
}
body.catalog-open #dynamic-panel{
  display: block;
  padding-top: 20px;
}

/* =========================
   Responsive
========================= */
@media (max-width: 980px){
  .systems-grid,
  .solutions-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-2cols{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px){
  .thumb--cover-only{
    width: 180px;
  }

  .system-card img,
  .solution-card img{
    width: 72px;
    height: 72px;
  }

  .hero-slider .slider-btn{
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 40px;
  }
}

/* ==========================================
   HERO SLIDER – Ajuste móvil
========================================== */
@media (max-width: 768px){
  .hero-slider .slide-overlay{
    background: rgba(0,0,0,.35);
  }

  .hero-slider .slide.is-active{
    display: block;
  }

  .hero-slider .slide img{
    width: 100%;
    height: calc(200% + 90px);
    margin-top: 0;
    object-fit: cover;
    display: block;
  }

  .hero-slider .slide-overlay{
    padding: 30px 10px;
  }

  .hero-slider .slide-box{
    padding: 7px 7px;
    border-radius: 7px;
  }
}

/* ==========================================
   HERO SLIDER – Ajuste SOLO vertical
========================================== */
@media (max-width: 768px) and (orientation: portrait){
  .hero-slider .slide.is-active{
    min-height: 38vh;
  }

  .hero-slider .slide.is-active img{
    height: 100%;
    object-fit: cover;
  }

  .hero-slider .slide-overlay{
    padding-top: 26px;
    padding-bottom: 26px;
  }
}