/* ===============================
   RESET
================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: #0f2a44;
  background: #ffffff;
  line-height: 1.6;
}

/* ===============================
   NAV / HEADER
================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 16px 56px;

  background: linear-gradient(
    to right,
    rgba(255,255,255,0.97) 0%,
    rgba(235,245,255,0.92) 35%,
    rgba(180,210,235,0.9) 65%,
    rgba(47,111,178,0.95) 100%
  );

  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.4);
}

.logo img {
  height: 46px;
}

.menu a {
  margin-left: 26px;
  text-decoration: none;
  font-weight: 500;
  color: #0f2a44;
}

.menu a:hover {
  color: #2f6fb2;
}

/* ===============================
   HERO
================================ */
.hero {
  height: 100vh;
  background: url("../img/hero.webp") center / cover no-repeat;
  margin-top: 78px; /* altura del nav */
  position: relative;
}

.hero .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(15,42,68,0.65) 0%,
    rgba(15,42,68,0.55) 40%,
    rgba(15,42,68,0.35) 70%,
    rgba(15,42,68,0.15) 100%
  );

  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 620px;
  margin-left: 72px;
  color: #ffffff;
}

.hero h1 {
  font-size: 44px;
  margin-bottom: 20px;
}

.hero p {
  font-size: 18px;
  margin-bottom: 28px;
}

.btn {
  display: inline-block;
  background: #2f6fb2;
  color: #ffffff;
  padding: 14px 28px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

.btn:hover {
  background: #255a91;
}

/* ===============================
   SECCIONES
================================ */
.section {
  padding: 96px 0;
}

.gray {
  background: #f5f7fa;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

.section h2 {
  font-size: 32px;
  margin-bottom: 24px;
}

/* ===============================
   EMPRESA
================================ */
#empresa p {
  max-width: 900px;
  margin-bottom: 18px;
  text-align: justify;
  hyphens: auto;
  color: #3e4f63;
}

/* ===============================
   BRAND / DISHEALTH
================================ */
.brand-product {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 56px;
}

.brand-product img {
  max-height: 80px;
}

.brand-text {
  max-width: 700px;
  color: #5f6f82;
  text-align: justify;
  hyphens: auto;
}

/* ===============================
   LÍNEAS DE PRODUCTOS
================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.card {
  background: #ffffff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15,42,68,0.08);
}

.card img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 16px;
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  color: #5f6f82;
  text-align: justify;
  hyphens: auto;
}

/* ===============================
   CATÁLOGO DE PRODUCTOS
================================ */

.section-intro {
  max-width: 760px;
  margin-bottom: 48px;
  color: #5f6f82;
  line-height: 1.7;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 36px;
  align-items: start;
}

.catalog-item {
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.catalog-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(15, 42, 68, 0.14);
}

.catalog-item:hover {
  transform: translateY(-6px);
}

/* ===============================
   CALIDAD
================================ */
.quality-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.quality-card {
  background: #ffffff;
  padding: 28px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,42,68,0.08);
}

.quality-card h3 {
  margin-bottom: 14px;
}

.quality-card p,
.quality-card li {
  color: #4f5f73;
  line-height: 1.7;
  text-align: justify;
}

.quality-card ul {
  padding-left: 18px;
}

/* ===============================
   CONTACTO
================================ */
.contact-box {
  margin-top: 24px;
  background: #ffffff;
  padding: 28px;
  border-radius: 8px;
  max-width: 500px;
  box-shadow: 0 8px 24px rgba(15,42,68,0.08);
}

/* ===============================
   FOOTER
================================ */
.footer {
  background: #0f2a44;
  color: #ffffff;
  text-align: center;
  padding: 24px;
  font-size: 14px;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quality-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 14px 20px;
  }

  .hero-content {
    margin: 0 20px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .brand-product {
    flex-direction: column;
    text-align: center;
  }

  #empresa p,
  .brand-text,
  .card p,
  .quality-card p,
  .quality-card li {
    text-align: left;
    hyphens: none;
  }
}

@media (max-width: 768px) {
  .product-anchors {
    gap: 16px;
  }

  .product-anchors a {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* ===============================
   PRODUCTOS POR LÍNEA
================================ */

.product-line {
  margin-bottom: 96px;
  scroll-margin-top: 110px; /* altura del header */
}

.product-line-header {
  max-width: 820px;
  margin-bottom: 40px;
}

.product-line-header h2 {
  font-size: 30px;
  margin-bottom: 12px;
}

.product-line-header p {
  color: #5f6f82;
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
}

/* ===============================
   ANCLAS DE PRODUCTOS
================================ */

.product-anchors {
  display: flex;
  gap: 24px;
  margin: 48px 0 72px;
  flex-wrap: wrap;
}

.product-anchors a {
  padding: 10px 20px;
  border-radius: 24px;
  border: 1px solid #2f6fb2;
  color: #2f6fb2;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.product-anchors a:hover {
  background: #2f6fb2;
  color: #ffffff;
}

/* ===============================
   MODAL DE PRODUCTO
================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.modal.active {
  display: block;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 42, 68, 0.85);
}

.modal-content {
  position: relative;
  z-index: 2;

  max-width: 520px;      /* clave: más estrecho */
  max-height: 85vh;      /* no se sale de pantalla */
  margin: 6vh auto;

  background: #ffffff;
  padding: 20px;
  border-radius: 10px;

  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content img {
  max-width: 100%;
  max-height: 75vh;   /* controla altura */
  height: auto;
  width: auto;
  border-radius: 6px;
}


.modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  background: #2f6fb2;
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}

.modal-close:hover {
  background: #255a91;
}

/* ===============================
   MODAL - AJUSTES MÓVIL
================================ */

@media (max-width: 768px) {

  .modal-content {
    max-width: 95%;
    max-height: 90vh;
    margin: 5vh auto;
    padding: 14px;
    border-radius: 12px;
  }

  .modal-content img {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
  }

  .modal-close {
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}
