/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN (Mantenemos Footer y Header)
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap");

:root {
  --dismarex-red: #e31b23;
  --dismarex-blue: #006bbd;
  --dismarex-dark: #121212;
  --glass-white: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);

  --header-height: 70px;
  --footer-height: 80px;
  --font-main: "Inter", sans-serif;
  --overlay: rgba(0, 0, 0, 0.5);
}

/* Reset Global */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  font-size: 16px; /* Base para rem */
}

body {
  font-family: var(--font-main);
  background-color: var(--dismarex-dark);
  color: white;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ==========================================================================
   2. ESTRUCTURA FIJA (HEADER Y FOOTER)
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--dismarex-blue);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  z-index: 2000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.header__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: white;
}
.header__image {
  height: clamp(35px, 5vw, 45px);
  margin-right: 12px;
}
.header__logo {
  font-weight: 800;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
}

.nav__list {
  display: flex;
  list-style: none;
  gap: 5px;
}
.nav__link {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 4px;
  transition: 0.3s;
}
.nav__link:hover,
.nav__item--active .nav__link {
  background-color: var(--dismarex-red);
}

/* Estilos del Botón Hamburguesa */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2100;
  padding: 10px;
}
.nav__line {
  display: block;
  width: 30px;
  height: 3px;
  background: white;
  margin: 5px auto;
  transition: 0.3s;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-height);
  background-color: var(--dismarex-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  z-index: 2000;
  border-top: 1px solid var(--glass-border);
}

.footer__text {
  font-size: clamp(0.8rem, 2vw, 1rem);
  opacity: 0.7;
}
.footer__nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
}
.footer__nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.9rem;
  transition: 0.3s;
}

/* ==========================================================================
   3. SECCIONES Y FONDOS
   ========================================================================== */
.main-content {
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
}

.section,
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 5%;
  overflow: hidden;
}

.section--bg {
  background-attachment: scroll;
  background-size: cover;
  background-position: center center;
}

.section--bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  z-index: 1;
}

/* Asignación de imágenes */
.bg-inicio,
.bg-productos {
  background-image: url("../assets/images/bg-single-0.webp");
}
.bg-empresa,
.bg-mision,
.bg-vision,
.bg-servicios {
  background-image: url("../assets/images/bg-single-1.webp");
}
.bg-cobertura {
  background-image: url("../assets/images/bg-single-2.webp");
}

.bg-contacto {
  background-image: url("../assets/images/bg-single-3.webp");
}

/* ==========================================================================
   4. TARJETAS Y GRID (MEJORADO)
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1100px;
  z-index: 5;
  margin-top: 20px;
}

.service-card {
  background: var(--glass-white);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px 20px;
  text-decoration: none;
  color: white;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-card:hover {
  transform: translateY(-12px);
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--dismarex-blue);
  box-shadow: 0 15px 35px rgba(0, 107, 189, 0.3);
}

.service-card__icon {
  width: 60px;
  height: 60px;
  background: var(--dismarex-blue);
  color: white;
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  transition: 0.3s;
}

.service-card__icon svg {
  width: 30px;
  height: 30px;
}

.service-card:hover .service-card__icon {
  background: var(--dismarex-red);
  transform: scale(1.1) rotate(5deg);
}

.service-card__title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.service-card__description {
  font-size: 1rem;
  opacity: 0.8;
  margin-bottom: 20px;
}

.service-card__button {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--dismarex-blue);
  background: white;
  padding: 8px 20px;
  border-radius: 50px;
  transition: 0.3s;
}

.service-card:hover .service-card__button {
  background: var(--dismarex-red);
  color: white;
}

/* ==========================================================================
   5. TIPOGRAFÍA Y OTROS ELEMENTOS
   ========================================================================== */
.hero__title {
  font-size: clamp(2rem, 8vw, 3.5rem);
  z-index: 5;
  margin-bottom: 15px;
  font-weight: 800;
}
.hero__subtitle {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  z-index: 5;
  margin-bottom: 25px;
}
.hero__cta {
  display: inline-block;
  background: var(--dismarex-red);
  color: white;
  padding: 15px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 800;
  z-index: 5;
  transition: 0.3s;
}
.hero__cta:hover {
  transform: scale(1.05);
}

.section__title {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  z-index: 5;
  margin-bottom: 15px;
}
.section__text {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  z-index: 5;
  max-width: 800px;
  margin-bottom: 30px;
}

.contact-info {
  z-index: 5;
  font-size: 1.1rem;
}

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-label {
  color: #ffeb3b;
  font-weight: 700;
}

.map-container {
  width: 100%;
  max-width: 850px;
  height: 300px;
  border-radius: 20px;
  overflow: hidden;
  z-index: 5;
  margin-top: 20px;
}

/* ==========================================================================
   6. RESPONSIVIDAD (MÓVIL, TABLET, SMART TV)
   ========================================================================== */

/* TABLET Y MÓVIL (Menor a 1200px) */
@media (max-width: 1200px) {
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--dismarex-blue);
    transform: translateX(100%);
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2050;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  }
  .nav--open {
    transform: translateX(0);
  }
  .nav__list {
    flex-direction: column;
    gap: 30px;
    align-items: center;
  }
  .nav__link {
    font-size: 0.9rem;
  }

  .footer {
    flex-direction: column;
    justify-content: center;
    height: auto;
    padding: 15px;
    gap: 10px;
  }
  .footer__nav ul {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .main-content {
    padding-bottom: 120px;
  } /* Ajuste por footer más alto en móvil */
}

/* MÓVIL PEQUEÑO (Menor a 480px) */
@media (max-width: 480px) {
  .section,
  .hero {
    padding: 60px 20px;
    justify-content: flex-start;
  }
  .hero__title,
  .section__title {
    font-size: 1.2rem;
    line-height: 1.1;
  }
  .hero__subtitle,
  .section__text,
  .contact-info {
    font-size: 0.8rem;
  }
  .hero__cta {
    font-size: 0.8;
    padding: 0.5rem 0.8rem;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 5px;
    width: 100%;
    max-width: 260px;
  }
  .service-card {
    width: 240px;
    height: 90%;
  }
  .service-card__title {
    font-size: 0.9rem;
    margin-bottom: 5px;
  }
  .service-card__description {
    font-size: 0.6rem;
    margin-bottom: 10px;
  }
  .service-card__button {
    font-size: 0.6rem;
    padding: 8px 15px;
  }

  .map-container {
    height: 200px;
  }

  .footer__text {
    font-size: 0.55rem;
  }
  .footer__nav a {
    font-size: 0.55rem;
  }
}

/* SMART TV / MONITORES 4K (Mayor a 1921px) */
@media (min-width: 1921px) {
  :root {
    --header-height: 100px;
    --footer-height: 100px;
  }
  html {
    font-size: 22px;
  } /* Escalado global */
  .main-content {
    max-width: 1600px;
    margin: 0 auto;
  }
}
