/* ===========================
   FUENTES
=========================== */

@font-face {
  font-family: "Encode Sans Condensed";
  src: url("../assets/fonts/EncodeSans/EncodeSansCondensed-Regular.ttf");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Trade Gothic";
  src: url("../assets/fonts/TradeGothic/TradeGothic-CondensedBold.otf");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===========================
   VARIABLES GLOBALES
=========================== */

:root {
  box-sizing: border-box;
  --scale: 1;

  /* Colors */
  --color-primary: #1d3863;
  --color-accent: #f07e1b;
  --color-white: #ffffff;
  --color-gray: #646464;

  /* Font families */
  --font-trade-gothic: "Trade Gothic";
  --font-encode-condensed: "Encode Sans Condensed";

  /* Weights */
  --font-bold: 700;
  --font-regular: 400;

  /* Font sizes */
  --fs-sm: 18px;
  --fs-md: 20px;
  --fs-lg: 26px;
  --fs-xl: 30px;
  --fs-xxl: 55px;
  --fs-hero: 60px;
  --fs-display: 80px;

  /* Line heights */
  --lh-sm: 24px;
  --lh-md: 26px;
  --lh-lg: 52px;
  --lh-xl: 80px;
}

/* ===========================
   SISTEMA TIPOGRÁFICO
=========================== */

/* Título principal */
.title-primary {
  font-family: var(--font-trade-gothic);
  font-weight: var(--font-bold);
  font-size: var(--fs-xxl);
  line-height: var(--lh-lg);
  color: var(--color-primary);
}

/* Título destacado naranja */
.title-accent {
  font-family: var(--font-trade-gothic);
  font-weight: var(--font-bold);
  font-size: var(--fs-xxl);
  line-height: var(--lh-md);
  color: var(--color-accent);
}

/* Título gigante uppercase */
.title-hero {
  font-family: var(--font-trade-gothic);
  font-weight: var(--font-bold);
  font-size: var(--fs-display);
  line-height: var(--lh-xl);
  color: var(--color-primary);
  text-transform: uppercase;
}

/* Subtítulo naranja */
.subtitle-accent {
  font-family: var(--font-trade-gothic);
  font-weight: var(--font-bold);
  font-size: var(--fs-xl);
  line-height: var(--lh-md);
  color: var(--color-accent);
}

/* Texto normal gris */
.text-body {
  font-family: var(--font-encode-condensed);
  font-weight: var(--font-regular);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  color: var(--color-gray);
}

/* Texto secundario gris */
.text-secondary {
  font-family: var(--font-encode-condensed);
  font-weight: var(--font-regular);
  font-size: var(--fs-md);
  line-height: var(--lh-md);
  color: var(--color-gray);
}

/* Texto blanco uppercase */
.text-inverse-uppercase {
  font-family: var(--font-encode-condensed);
  font-weight: var(--font-regular);
  font-size: var(--fs-md);
  line-height: 25px;
  color: var(--color-white);
  text-transform: uppercase;
}

/* Texto blanco especial (23px uppercase) */
.text-inverse-large {
  font-family: var(--font-encode-condensed);
  font-weight: var(--font-regular);
  font-size: 23px;
  line-height: 29px;
  color: var(--color-white);
  text-transform: uppercase;
}

/* Título grande 60px */
.title-large {
  font-family: var(--font-trade-gothic);
  font-weight: var(--font-bold);
  font-size: 60px;
  line-height: 26px;
  color: var(--color-primary);
}

html,
body {
  margin: 0;
  padding: 0;
  min-width: 360px;
  min-height: 430px;
}

.barra-menu {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  left: 0;
  width: 100%;
  height: calc(98px * var(--scale));
  background: url("../assets/images/Barra Menu.svg") no-repeat center/cover;
  z-index: 3;
}

.barra-menu-logo {
  background: transparent url("../assets/images/Iso Nostro.svg") center/contain no-repeat;
  width: 52px;
  height: 57px;
  margin-left: 125px;
}

.menu-texto {
  position: relative;
  right: 7.13%;
  gap: 10px;
  display: flex;
  align-items: center;
}

.menu-texto a,
.menu-texto span {
  text-decoration: none;
  transition: color 0.3s ease;
}

.menu-texto a {
  padding: 4px 0 4px 0;
}

.menu-texto a:hover {
  color: #ff6600;
}

.menu-texto .space-icon-instagram {
  width: 10px;
  height: 10px;
}

.menu-texto .instagram-icon {
  background: url("../assets/images/Logo Instagram.svg") no-repeat center/contain;
  width: 23px;
  height: 23px;
  right: 7.13%;
}

.menu-texto .instagram-icon:hover svg {
  fill: #ff6600;
}

.hero {
  position: relative;
  display: flex;
  height: calc(100svh - 197px);
  min-height: calc(430px - 197px);
  padding-left: 125px;
  gap: 30px;
  overflow: hidden;
  margin: 0 auto;
}

.historia-container {
  display: flex;
  flex-direction: column;
  padding-top: 2%;
  padding-bottom: 2%;
  width: 40.95%;
}

.historia-titulo {
  font-size: 3.52vw;
  line-height: 111%;
  color: var(--color-primary);
  top: 137px;
  width: 100%;
}

.historia-video {
  display: flex;
  justify-content: center;
  align-items: center;
  top: 383px;
  width: clamp(230px, 41.5%, 300px);
  height: 7.35%;
  background: var(--color-accent) 0% 0% no-repeat padding-box;
  border-radius: 33px;
  margin-top: 2%;
  margin-bottom: 3%;
  gap: 20px;
}

.historia-video p {
  font-size: clamp(17px, 1.04vw, 20px);
}

.historia-texto {
  top: 448px;
  left: 125px;
  width: 100%;
  height: 404px;
  overflow-y: auto;
}

.historia-texto div {
  font-size: clamp(15.5px, 1.24vw, 20px);
  margin-bottom: 3%;
}

.imagen-container {
  display: flex;
  align-items: start;
  justify-content: start;
  width: 59.05%;
}

.imagen-quienes-somos {
  background: url("../assets/images/quienes-somos/Imagen Quienes Somos.png") no-repeat center/contain;
  width: 100%;
  height: calc(100svh - 197px);
  min-height: calc(430px - 197px);
}

.imagen-quienes-somos.menu-open-image {
  background-image: url("../assets/images/quienes-somos/DSC09854.png");
  height: 450px;
}

.fondo-menu {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 99px;
  background-color: var(--color-accent);
  color: var(--color-white);
  overflow: visible;
  z-index: 10;
}

.fondo-menu-top {
  display: flex;
  justify-content: start;
  align-items: center;
  width: 100%;
  height: 99px;
  min-height: 99px;
  gap: 20px;
  flex-shrink: 0;
}

.fondo-menu-texto {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-left: 125px;
  font-size: var(--fs-hero);
  line-height: 26px;
  color: var(--color-white);
  margin: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fondo-menu.menu-open .fondo-menu-texto {
  opacity: 0;
  visibility: hidden;
}

.fondo-menu-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--fs-hero);
  line-height: 26px;
  color: var(--color-white);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-trade-gothic);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  transition: transform 0.3s ease;
  margin-top: 15px;
}

.fondo-menu-icon:hover {
  opacity: 0.8;
}

.fondo-menu-icon.active {
  transform: rotate(180deg) translateY(15px);
}

.fondo-menu-content {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  background-color: var(--color-accent);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.4s ease;
  z-index: 11;
}

.fondo-menu.menu-open .fondo-menu-content {
  max-height: min(500px, calc(100svh - 197px));
  min-height: calc(430px - 197px);
  opacity: 1;
  overflow-y: auto;
}

.menu-section,
.menu-right {
  border-left: 1px solid black;
  border-bottom: 1px solid black;
}

.menu-section:last-child {
  margin-bottom: 0;
}

.menu-title {
  line-height: var(--lh-lg);
  color: var(--color-white);
  padding-left: 20px;
  padding-bottom: 20px;
  margin: 0;
  text-transform: uppercase;
}

.menu-text {
  color: var(--color-white);
  font-size: clamp(15.5px, 1.04vw, 20px);
  padding-left: 20px;
  padding-bottom: 20px;
  margin: 0;
}

.menu-grid {
  display: grid;
  padding: 70px 125px 0 125px;
  grid-template-columns: 40% 60%;
  gap: 30px;
}

.menu-left .menu-section {
  margin-bottom: 8.75%;
  max-width: 645px;
}

.menu-right {
  display: flex;
  flex-direction: column;
  height: 320px;
  width: 91.84%;
}

.nav-toggle {
  display: none;
  position: absolute;
  top: 50px;
  width: 50px;
  height: 58.5px;
  background: transparent;
  background-color: var(--color-primary);
  border: none;
  cursor: pointer;
  z-index: 10;
  flex-direction: column;
  justify-content: space-around;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--color-white);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(13.5px, 13.5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(13.5px, -13.5px);
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 108.5px;
  width: auto;
  min-width: 200px;
  background-color: var(--color-primary);
  padding: 20px;
  border-radius: 0;
  z-index: 9;
  flex-direction: column;
  gap: 15px;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mobile-nav.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.mobile-nav a {
  text-decoration: none;
  color: var(--color-white);
  padding: 8px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.mobile-nav a:hover {
  color: var(--color-accent);
}

.mobile-nav-logo {
  background: transparent url("../assets/images/Iso Nostro.svg") center/contain no-repeat;
  width: 52px;
  height: 57px;
  padding: 0;
  display: block;
}

.mobile-nav-logo:hover {
  opacity: 0.8;
}

.valores-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: 30px;
}


.valor-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-left: 20px;
  padding-bottom: 20px;
}

.valor-item div {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 80px;
}

@media (max-width: 1440px) and (min-width: 1081px) {
  .menu-right {
    height: 405px;
  }
  .valores-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .valor-item div {
    width: 70%;
    height: 60px;
  }
}

.valor-item p {
  font-size: clamp(15.5px, 1.04vw, 20px);
}

.icono-compromiso {
  background: url("../assets/images/quienes-somos/CompromisoNostro.png") no-repeat center/contain;
  width: 100%;
  height: 100%;
}

.icono-trazabilidad {
  background: url("../assets/images/quienes-somos/TrazabilidadNostro.png") no-repeat center/contain;
  width: 100%;
  height: 100%;
}

.icono-produccion {
  background: url("../assets/images/quienes-somos/ProducciónNostro.png") no-repeat center/contain;
  width: 100%;
  height: 100%;
}

.icono-respeto {
  background: url("../assets/images/quienes-somos/RespetoNostro.png") no-repeat center/contain;
  width: 100%;
  height: 100%;
}

.icono-orgullo {
  background: url("../assets/images/quienes-somos/OrgulloNostro.png") no-repeat center/contain;
  width: 100%;
  height: 100%;
}

.icono-calidad {
  background: url("../assets/images/quienes-somos/CalidadNostro.png") no-repeat center/contain;
  width: 100%;
  height: 100%;
}

footer {
  width: 100%;
  height: calc(88px * var(--scale));
  background-color: var(--color-white);
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4.48%;
  width: 100%;
  height: 73.86%;
}

.footer-logo {
  width: calc(233px * var(--scale));
  height: calc(57px * var(--scale));
  background: transparent url("../assets/images/Logo Spuches Horizontal.png")
    center/contain no-repeat;
}

.footer-copyright {
  text-align: center;
}

/* Botones de navegación móvil */
.mobile-nav-buttons {
  display: none;
}

.mobile-nav-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 25px 30px;
  text-decoration: none;
  gap: 10px;
  border: none;
  cursor: pointer;
  font-family: var(--font-encode-condensed);
  font-weight: var(--font-regular);
  font-size: clamp(18px, 4vw, 22px);
  text-transform: uppercase;
  transition: opacity 0.3s ease;
  letter-spacing: 0.5px;
}

.mobile-nav-text {
  flex: 1;
  text-align: left;
  max-width: 320px;
}

.mobile-nav-arrow {
  flex-shrink: 0;
  text-align: right;
}

.mobile-nav-button:hover {
  opacity: 0.9;
}

.mobile-nav-button-white {
  background-color: var(--color-white);
  color: var(--color-primary);
}

.mobile-nav-button-orange {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.mobile-nav-button-orange .mobile-nav-text {
  color: var(--color-white);
}

.mobile-nav-button-orange .mobile-nav-arrow {
  color: var(--color-white);
}

/* Modal Overlay */
.modal-overlay {
  display: block;
  width: 100%;
  height: 741px;
  position: relative;
  background-color: var(--color-white);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
}

.modal-overlay:not(.active) {
  display: none;
}

.modal-overlay.active {
  opacity: 0;
  visibility: visible;
  animation: fadeToFull 0.4s ease forwards;
}

@keyframes fadeToFull {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Ocultar modales en pantallas mayores a 1080px */
@media (min-width: 1081px) {
  .modal-overlay {
    display: none !important;
  }
  
  .modal-overlay.active {
    display: none !important;
  }
}

/* Modal con fondo naranja */
.modal-overlay.modal-orange {
  background-color: var(--color-accent);
}

.modal-overlay.modal-orange .modal-container {
  background-color: var(--color-accent);
}

.modal-overlay.modal-orange .modal-content {
  background-color: var(--color-accent);
}

.modal-overlay.modal-orange .modal-close-btn {
  background-color: var(--color-white);
}

.modal-overlay.modal-orange .modal-close-btn .modal-arrow {
  color: var(--color-accent);
}

.modal-container {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--color-white);
  display: flex;
  flex-direction: column;
}

/* Ocultar contenido principal cuando el modal está activo */
main.modal-active .hero,
main.modal-active .mobile-nav-buttons,
main.modal-active .fondo-menu,
main.modal-active .textura-quienes-somos {
  display: none;
}

.modal-close-btn {
  position: absolute;
  background-color: var(--color-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  z-index: 10;
  transition: opacity 0.3s ease;
  border-radius: 60px 0 0 60px;
}

.modal-close-btn:hover {
  opacity: 0.8;
}

.modal-arrow {
  width: 60px;  
  margin-top: 7px;
  color: var(--color-white);
}

.modal-content {
  width: 100%;
  height: 100%;
  position: relative;
  background-color: var(--color-white);
  padding: 20px;
  box-sizing: border-box;
}

/* Estilos para el contenido del modal (historia-container) */
.modal-content .historia-container {
  width: 100%;
  max-width: 100%;
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.modal-content .historia-titulo {
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.2;
  margin-bottom: 20px;
  width: 100%;
}

.modal-content .historia-video {
  width: 100%;
  max-width: 300px;
  margin-bottom: 20px;
  margin-top: 10px;
}

.modal-content .historia-texto {
  width: 100%;
  height: 560px;
  top: 0;
  left: 0;
  margin-top: 10px;
  overflow-y: auto;
}

.modal-content .historia-texto div {
  margin-bottom: 15px;
  font-size: clamp(15.5px, 4vw, 20px);
  line-height: 1.1;
}

/* Estilos para el contenido del modal naranja (menu-content) */
.modal-content .menu-grid {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 30px;
}

.modal-content .menu-left {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.modal-content .menu-section {
  border: none;
}

.modal-content .menu-title {
  color: var(--color-white);
  padding-left: 0;
  padding-bottom: 15px;
  margin: 0;
}

.modal-content .menu-text {
  color: var(--color-white);
  font-size: clamp(16px, 4vw, 20px);
  padding-left: 0;
  padding-bottom: 0;
  margin: 0;
}

.modal-content .menu-right {
  width: 100%;
  border: none;
  height: auto;
}

.modal-content .valores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.modal-content .valor-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0;
  gap: 10px;
}

.modal-content .valor-item div {
  width: 60px;
  height: 60px;
}

.modal-content .valor-item p {
  color: var(--color-white);
  font-size: clamp(12px, 3vw, 16px);
  margin: 0;
}

@media (max-width: 1080px) {
  .barra-menu {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .mobile-nav {
    display: flex;
  }

  /* Hero - diseño móvil */
  .hero {
    background: url("../assets/images/quienes-somos/Textura Nostro Movil.png") no-repeat center/cover;
    flex-direction: column;
    height: auto;
    padding: 0;
    gap: 0;
  }

  .historia-container {
    height: calc(100svh - 328px);
    min-height: calc(430px - 328px);
    display: none;
  }

  .imagen-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 328px;
    margin: 0 auto;
    order: -1;
    position: relative;
  }

  .imagen-quienes-somos {
    background: url("../assets/images/quienes-somos/Imagen Quienes Somos Movil.png") no-repeat center/contain;
    background-size: contain;
    width: 100%;
    height: 102%;
  }

  .imagen-quienes-somos.menu-open-image {
    background-image: url("../assets/images/Imagen Quienes Somos Movil.png");
    padding-bottom: 75%;
  }

  /* Botones de navegación móvil */
  .mobile-nav-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  /* Fondo menu - ocultar en móvil inicialmente */
  .fondo-menu {
    display: none;
  }

  .fondo-menu.menu-open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100svh;
    min-height: 430px;
    z-index: 1000;
    overflow-y: auto;
    background-color: var(--color-accent);
  }

  .fondo-menu-top {
    position: sticky;
    top: 0;
    z-index: 1001;
    background-color: var(--color-accent);
    padding: 20px;
  }

  .fondo-menu-texto {
    padding-left: 20px;
    font-size: clamp(24px, 5vw, 40px);
  }

  .fondo-menu.menu-open .fondo-menu-texto {
    opacity: 1;
    visibility: visible;
  }

  .fondo-menu-content {
    position: relative;
    bottom: auto;
    max-height: none;
    opacity: 1;
    overflow: visible;
    padding: 20px;
  }

  .fondo-menu.menu-open .fondo-menu-content {
    max-height: none;
    opacity: 1;
  }

  .textura-quienes-somos {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: calc(100svh - 636px);
  }
  .textura-quienes-somos-imagen {
    background: url("../assets/images/quienes-somos/Textura Nostro Movil.png") no-repeat center/cover;
    width: 100%;
    height: 100%;
  }
  
  /* Estilos responsive del modal */
  .modal-overlay {
    height: 100svh;
    min-height: 430px;
  }
  
  .modal-content {
    padding-top: 50px;
    padding-bottom: 45px;
    padding-left: 60px;
    padding-right: 60px;
    height: 100svh;
    overflow-y: auto;
  }
  
  .modal-content .historia-video,
  .modal-content .historia-texto {
    height: auto;
  }
  
  .modal-content .historia-container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .modal-content .menu-grid {
    gap: 25px;
  }
  
  .modal-content .menu-left {
    gap: 25px;
  }
  
  .modal-content .valores-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
  
  .modal-content .valor-item div {
    width: 50px;
    height: 50px;
  }
  
  .modal-close-btn {
    top: 50px;
    right: 0;
    width: 50px;
    height: 50px;
  }
  
  .footer-container {
    padding: 0 20px 0 20px;
  }
}

@media (max-width: 430px) {
  .frase-slide {
    width: 340px;
    top: 4px;
  }
  .nav-toggle {
    height: 50px;
  }
  .mobile-nav {
    top: 100px;
  }
  .mobile-nav-text{
    max-width: 260px;
    font-size: 45px;
  }
  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(11.3px, 11.3px);
  }   
  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(11.3px, -11.3px);
  }
  .logo-nostro {
    width: 380px;
    height: 1220px;
  }
}

@media (max-height: 636px) and (max-width: 1080px) {
  
  .imagen-container {
    height: 250px;
  }

  .mobile-nav-button {
    padding: 10px 30px;
  }

  .mobile-nav-text {
    font-size: 35px;
    line-height: 35px;
  }

  .textura-quienes-somos {
    height: calc(100svh - 422px);
  }

}