 body {
     font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
 }

 .topbar {
     background: #292929;
     color: #fff;
     font-size: 0.95rem;
     font-weight: bold;
     padding: 12px 0;
     font-family: "PT Sans", sans-serif;
 }

 .topbar a {
     color: #fff;
     text-decoration: none;
 }

 .topbar-search-link {
     text-decoration: none !important;
     color: #fff;
     font-weight: 600;
     gap: 0.25rem;
     padding: 0.18rem 0.7rem 0.18rem 0.5rem;
     border-radius: 2rem;
     transition: background 0.15s;
     display: flex;
     align-items: center;
 }

 .topbar-search-link:hover {
     background: rgba(255, 255, 255, 0.12);
     color: #fff;
 }

 .main-nav {
     background: #d82632;
     min-height: 84px;
     box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
 }

 .navbar-brand {
     margin-right: 1.5rem;
 }

 .logo-box {

     border-radius: 0;

     min-width: 210px;
     display: flex;
     align-items: center;
     height: 74px;
 }

 .logo-box img {
     height: 70px;
     width: auto;
 }

 .navbar-nav {
     width: 100%;
     height: 74px;
     align-items: stretch !important;
 }

 .navbar-nav>.nav-item {
     display: flex;
     align-items: stretch;
     position: relative;
     height: 100%;
 }

 .navbar-nav>.nav-item>.nav-link {
     color: #fff !important;
     font-weight: 600;
     font-size: 1.06rem;
     display: flex;
     align-items: center;
     justify-content: center;
     height: 100%;
     padding: 0 2.2rem;
     border-right: 1.5px solid #be232d;
     border-radius: 0;
     transition: background 0.17s;
     position: relative;
     z-index: 1;
 }

 .navbar-nav>.nav-item:last-child>.nav-link,
 .navbar-nav>.nav-item.ms-3,
 .navbar-nav>.nav-item.ms-lg-3 {
     border-right: none !important;
 }

 .navbar-nav>.nav-item>.nav-link:hover,
 .navbar-nav>.nav-item>.nav-link:focus,
 .navbar-nav>.nav-item.show>.nav-link {
     background: rgba(0, 0, 0, 0.17) !important;
     color: #fff !important;
     box-shadow: none;
 }

 .icon-nav {
     min-width: 44px;
     min-height: 44px;
     align-items: center;
     justify-content: center;
     display: flex !important;
 }

 .navbar-nav>.nav-item.ms-3 .nav-link,
 .navbar-nav>.nav-item.ms-lg-3 .nav-link {
     padding: 0 !important;
     background: none !important;
 }

 .navbar-nav>.nav-item.ms-2.d-flex,
 .navbar-nav>.nav-item.ms-3.d-flex {
     align-items: center;
 }

 .dropdown-mega {
     position: static;
 }

 .dropdown-menu.mega-menu {
     left: 0;
     right: 0;
     top: 100%;
     margin-top: 0;
     padding: 30px;
     border-radius: 0;
     border: none;
     background: #fff;
     box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
     width: 100%;
     min-width: 0;
 }

 .mega-title {
     font-weight: 700;
     color: #c20000;
     margin-bottom: 10px;
 }

 .mega-menu a {
     color: #333 !important;
     font-size: 0.95rem;
 }

 .mega-menu a:hover {
     color: #c20000 !important;
     background: #f9ecec;
 }

 @media (max-width: 991px) {
     .dropdown-menu.mega-menu {
         padding: 15px;
         width: 100%;
     }
 }

 @media (min-width: 992px) {
     .navbar-nav>.dropdown-mega:hover>.dropdown-menu {
         display: block !important;
         opacity: 1;
         pointer-events: auto;
         margin-top: 0;
     }

     .navbar-nav>.dropdown-mega>.dropdown-toggle::after {
         transition: transform 0.2s;
     }

     .navbar-nav>.dropdown-mega:hover>.dropdown-toggle::after {
         transform: rotate(180deg);
     }

     .navbar-nav>.dropdown-mega>.dropdown-menu {
         display: none;
         opacity: 0;
         pointer-events: none;
     }
 }

 .dropdown-menu {
     border-radius: 0;
     margin-top: 0;
     border: none;
     box-shadow: 0 12px 32px rgba(0, 0, 0, 0.13);
 }

 .hero-carousel {
     position: relative;
     min-height: 70vh;
 }

 .hero-carousel .carousel-item {
     height: 70vh;
     min-height: 420px;
     position: relative;
     color: #fff;
     transition: transform 1.1s ease-in-out, opacity 1s ease-in-out !important;
 }

 .hero-media-wrapper {
     position: absolute;
     inset: 0;
     overflow: hidden;
 }

 .hero-media-wrapper video,
 .hero-media-wrapper img {
     width: 100%;
     height: 100%;
     object-fit: cover;
     filter: brightness(0.55);
 }

 .hero-overlay-content {
     position: relative;
     z-index: 2;
 }

 .hero-title {
     font-size: clamp(2.5rem, 5vw, 3.75rem);
     font-weight: 800;
     line-height: 1.05;
 }

 .hero-subtitle {
     font-size: clamp(1.1rem, 2vw, 1.35rem);
 }

 .hero-gradient {
     position: absolute;
     inset: 0;
     background: radial-gradient(circle at center, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.75));
     z-index: 1;
 }

 .red-strip {
     background: #c20000;
     padding: 16px 0;
 }

 .feature-blocks {
     background: #202124;
     color: #f5f5f5;
 }

 .feature-card {
     background: #2b2c30;
     color: #f5f5f5;
     border-radius: 25px;
     border-left: 4px solid #c20000;
     height: 100%;
     transition: transform 0.2s ease, box-shadow 0.2s ease;
 }

 .feature-card:hover {
     transform: translateY(-4px);
     box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
 }

 .feature-card .card-title {
     font-weight: 700;
     font-size: 1.1rem;
 }

 .section-title {
     color: #c20000;
     font-weight: 800;
     text-align: center;
     margin-bottom: .6rem;
 }

 .section-subtitle {
     text-align: center;
     max-width: 680px;
     margin: 0 auto 2.4rem;
     color: #555;
 }

 .clients-strip {
     background: #f7f7f7;
 }

 .clients-strip img {
     max-height: 60px;
     filter: grayscale(100%);
     opacity: 0.85;
     transition: filter 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
 }

 .clients-strip img:hover {
     filter: grayscale(0%);
     opacity: 1;
     transform: translateY(-3px);
 }

 footer {
     background: #111;
     color: #bbb;
     font-size: 0.9rem;
 }

 footer a {
     color: #bbb;
 }

 footer a:hover {
     color: #fff;
 }

 .footer-bottom {
     border-top: 1px solid rgba(255, 255, 255, 0.1);
     font-size: 0.8rem;
 }

 #searchOverlay {
     position: fixed;
     inset: 0;
     background: rgba(0, 0, 0, 0.88);
     backdrop-filter: blur(4px);
     display: none;
     justify-content: center;
     align-items: center;
     z-index: 2000;
 }

 #searchOverlay.active {
     display: flex;
 }

 .search-box {
     text-align: center;
     width: 100%;
     max-width: 550px;
     padding: 20px;
 }

 .close-btn {
     position: absolute;
     top: 30px;
     right: 40px;
     border: none;
     background: transparent;
     color: #fff;
     font-size: 2rem;
     cursor: pointer;
 }

 .youtube-bg {
     position: absolute;
     inset: 0;
     overflow: hidden;
     z-index: 0;
 }

 .youtube-bg iframe {
     position: absolute;
     top: 50%;
     left: 50%;
     min-width: 100%;
     min-height: 100%;
     width: 200%;
     height: 200%;
     transform: translate(-50%, -50%);
     pointer-events: none;
 }

 @media (max-width: 991px) {
     .navbar-nav>.nav-item>.nav-link {
         padding: 0.7rem 1.3rem;
         border-right: none;
         height: auto;
     }

     .logo-box {
         min-width: 140px;
         padding: 6px 12px;
         height: 48px;
     }

     .logo-box img {
         height: 35px;
     }

     .dropdown-menu.mega-menu {
         min-width: 260px;
     }
 }

 /* =========================
   AJUSTES FINALES MEGA MENÚ
   ========================= */

 /* Más espacio entre columnas y filas dentro del mega menú */
 .mega-menu .row {
     row-gap: 1rem;
 }

 .mega-menu .dropdown-item {
     padding: 0.25rem 0;
     white-space: normal;
     /* Que el texto pueda hacer salto de línea */
     line-height: 1.3;
 }

 /* Versión escritorio: mega menú ancho y centrado tipo "Amerex" */
 @media (min-width: 992px) {
     .navbar .dropdown-menu.mega-menu {
         position: absolute;
         left: 50%;
         transform: translateX(-50%);
         width: 100vw;
         /* ocupa todo el ancho de la ventana */
         max-width: 1320px;
         /* límite razonable para pantallas grandes */
         padding-inline: 60px;
         /* espacio a los lados */
         z-index: 1050;
     }
 }

 /* En pantallas medianas/pequeñas que no se “derrame” raro */
 @media (max-width: 991.98px) {
     .navbar .dropdown-menu.mega-menu {
         position: static;
         width: 100%;
         max-width: 100%;
         transform: none;
         padding-inline: 15px;
     }
 }

 .product-page .product-img-box {
     border: 1px solid #ddd;
     padding: 12px;
     background: #fff;
     position: relative;
 }

 .product-page .zoom-icon {
     position: absolute;
     top: 12px;
     left: 12px;
     background: #333;
     color: #fff;
     padding: 5px 7px;
     border-radius: 4px;
     font-size: 0.85rem;
 }

 .product-page .product-title {
     font-size: 2.2rem;
     font-weight: 800;
     color: #c20000;
 }

 .product-page .info-box {
     border: 1px solid #ddd;
     background: #fafafa;
     border-radius: 6px;
     padding: 20px;
 }

 .product-page .related-title {
     font-weight: 800;
     color: #c20000;
     border-left: 4px solid #c20000;
     padding-left: 10px;
 }

 .product-page .related-card img {
     height: 220px;
     object-fit: contain;
     padding: 10px;
 }

 .tf-breadcrumb {
     display: inline-flex;
     align-items: center;
     padding: 0.45rem 1.1rem;
     border-radius: 999px;
     background: #f5f5f5;
     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
     margin-bottom: 1rem;
 }

 .tf-breadcrumb .breadcrumb {
     margin-bottom: 0;
     background: transparent;
     padding: 0;
 }

 .tf-breadcrumb .breadcrumb-item+.breadcrumb-item::before {
     content: "›";
     color: #c20000;
     font-weight: 700;
 }

 .tf-breadcrumb .breadcrumb-item a {
     color: #555;
     text-decoration: none;
     font-weight: 500;
 }

 .tf-breadcrumb .breadcrumb-item a:hover {
     color: #c20000;
     text-decoration: underline;
 }

 .tf-breadcrumb .breadcrumb-item.active {
     color: #000;
     font-weight: 600;
 }
 .banner-avisos-card {
    background: #ffffff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-avisos-img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
}

@media (min-width: 992px) {
    .banner-avisos-img {
        height: 230px;
    }
}

.clients-strip {
    background: #f7f7f7;
}

.clients-logo {
    max-height: 46px;      /* altura fija tipo cintillo */
    width: auto;
    object-fit: contain;   /* que no se distorsione */
    display: block;
    margin: 0 auto;
    filter: grayscale(100%);
    opacity: 0.9;
    transition: filter 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.clients-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: translateY(-2px);
}


/* =========================
   TARJETAS DE PRODUCTO
   ========================= */

.card .ratio {
    background: #fff; /* fondo limpio */
    overflow: hidden;
}

.card .ratio img {
    width: 100%;
    height: 100%;
    object-fit: contain;     /*  NO se deforma */
    object-position: center; /* centrada */
    padding: 10px;           /* aire alrededor */
}

/* =========================
   DETALLE DE PRODUCTO - IMAGEN PRINCIPAL
   ========================= */

.product-page .product-img-box {
    height: 420px;                 /* altura fija visual */
    display: flex;
    align-items: center;           /* centra vertical */
    justify-content: center;       /* centra horizontal */
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    overflow: hidden;
}

.product-page #mainProductImg {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;           /* CLAVE */
}

/* =========================
   ZOOM ICON
   ========================= */

.product-img-box {
    position: relative;
}

.product-img-box .zoom-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0,0,0,.65);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.product-img-box .zoom-icon:hover {
    background: #c20000;
    transform: scale(1.1);
}

/* =========================
   MODAL ZOOM
   ========================= */

#modalZoomImg .modal-dialog {
    max-width: 90vw;
}

#modalZoomImg img {
    max-width: 100%;
    max-height: 85vh;   /* CLAVE */
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

@media (max-width: 991px) {
    .navbar-nav {
        height: auto !important;
        max-height: calc(100vh - 90px);
        overflow-y: auto;
    }
}
/* =========================
   MEGA MENÚ – ESTILO OSCURO (DESKTOP)
   ========================= */

@media (min-width: 992px) {

    .navbar .dropdown-menu.mega-menu {
        background: rgba(0, 0, 0, 0.88);
        backdrop-filter: blur(6px);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    }

    /* Títulos dentro del mega menú */
    .navbar .mega-menu .mega-title {
        color: #ffffff;
        font-weight: 800;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        padding-bottom: 6px;
        margin-bottom: 12px;
    }

    /* Links normales */
    .navbar .mega-menu a,
    .navbar .mega-menu .dropdown-item {
        color: #e5e5e5 !important;
        background: transparent;
    }

    /* Hover de links */
    .navbar .mega-menu a:hover,
    .navbar .mega-menu .dropdown-item:hover {
        color: #ffffff !important;
        background: rgba(194, 0, 0, 0.25);
        padding-left: 6px;
    }

    /* Texto pequeño o descripciones */
    .navbar .mega-menu p,
    .navbar .mega-menu small {
        color: #cfcfcf;
    }
}

/* Mega-menu compacto para Contacto */
.slim-mega-menu {
    width: 320px !important;
    max-width: 94vw !important;
    min-width: 220px !important;
    left: 0;
    right: auto;
    margin: 0;
    padding: 22px 16px 18px 18px !important;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
}

@media (min-width: 992px) {
    .navbar .dropdown-menu.slim-mega-menu {
        left: auto !important;
        right: 0 !important;
        transform: none !important;
        margin-right: 10px;
        width: 320px !important;
    }
}
/* Justificar textos (contenido) */
main p,
main li,
main .lead,
main small,
main .card-text {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}


/* =========================
   MEGA MENÚ COMPACTO PRODUCTOS (TRIFUEGO)
   ========================= */

.tf-mega-menu{
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden;
}

/* Contenedor general (desktop) */
@media (min-width: 992px){
  .tf-mega .dropdown-menu.tf-mega-menu{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: min(1100px, calc(100vw - 40px));
    max-width: 1100px;
    margin-top: 0;
    border-radius: 0 0 18px 18px;
    background: rgba(0,0,0,.86);
    backdrop-filter: blur(8px);
    box-shadow: 0 22px 55px rgba(0,0,0,.55);
  }
}

.tf-mega-inner{
  padding: 14px;
}

.tf-mega-grid{
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 14px;
  align-items: stretch;
}

.tf-mega-label{
  font-weight: 800;
  font-size: .92rem;
  color: rgba(255,255,255,.92);
  letter-spacing: .2px;
  margin-bottom: 10px;
}

/* Columna izquierda: categorías */
.tf-mega-left{
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.06);
}

.tf-mega-cats{
  max-height: 60vh;
  overflow: auto;
  padding-right: 4px;
}

.tf-mega-cats::-webkit-scrollbar{ width: 8px; }
.tf-mega-cats::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.18);
  border-radius: 10px;
}

.tf-mega-cat-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(255,255,255,.88) !important;
  transition: background .16s ease, transform .16s ease;
  font-weight: 700;
  font-size: .98rem;
}

.tf-mega-cat-item:hover{
  background: rgba(194,0,0,.25);
  color: #fff !important;
}

.tf-mega-cat-item.is-active{
  background: rgba(194,0,0,.34);
  color: #fff !important;
}

.tf-mega-cat-arrow{
  opacity: .85;
  font-size: .9rem;
}

/* Panel derecho */
.tf-mega-right{
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0,0,0,.18);
}

.tf-mega-panels{
  min-height: 240px;
  max-height: 60vh;
  overflow: auto;
  padding-right: 4px;
}

.tf-mega-panels::-webkit-scrollbar{ width: 8px; }
.tf-mega-panels::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.18);
  border-radius: 10px;
}

.tf-mega-panel{
  display: none;
}

.tf-mega-panel.is-active{
  display: block;
}

.tf-mega-panel-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 12px;
}

.tf-mega-panel-title{
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
}

.tf-mega-all{
  color: rgba(255,255,255,.88) !important;
  text-decoration: none;
  font-weight: 800;
  font-size: .9rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
}

.tf-mega-all:hover{
  background: rgba(194,0,0,.28);
  border-color: rgba(194,0,0,.35);
  color: #fff !important;
}

/* Subcategorías en “grid” compacto */
.tf-mega-subgrid{
  column-count: 2;
  column-gap: 12px;
}

@media (min-width: 1200px){
  .tf-mega-subgrid{ column-count: 3; }
}

.tf-mega-subitem{
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  padding: 7px 10px;
  margin: 0 0 8px 0;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(255,255,255,.88) !important;
  background: rgba(255,255,255,.06);
  font-weight: 700;
  font-size: .95rem; /* igual a Servicios/Garantías */
  transition: background .16s ease, transform .16s ease, padding-left .16s ease;
}

.tf-mega-subitem:hover{
  background: rgba(194,0,0,.22);
  color: #fff !important;
  padding-left: 14px;
}

/* Mensaje cuando no hay subcategorías */
.tf-mega-empty{
  color: rgba(255,255,255,.75);
  font-size: .95rem;
  line-height: 1.35;
}

/* Responsive: en móvil que se apile */
@media (max-width: 991.98px){
  .tf-mega-grid{
    grid-template-columns: 1fr;
  }
}

.hero-anim {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpHero 0.8s ease forwards;
    animation-delay: 7s;
}

@keyframes fadeUpHero {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
