/* Importar nueva fuente */
@font-face {
  font-family: "Ramadhan";
  src: url("../fonts/RamadhanMubarok-Regular.otf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --header-height: 10vh;
  --main-padding: 2rem;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.footer {
  position: relative; /* Cambiado de fixed a relative */
  width: 100%;
  background-color: rgba(0, 0, 0, 0.062);
  color: #E29205;
  padding: 1rem 0;
  margin-top: 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  color: #E29205;
}

.footer-content a {
  color: #E29205;
  text-decoration: none;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.footer-content a:hover {
  color: #cccccc;
}

.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
  width: 100%;
  text-align: center;
  gap: 2rem;
  position: relative;
  z-index: 1; /* Asegura que esté por encima del fondo pero debajo del título */
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  margin: 0 1rem;
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #ffd700;
}

.nav a {
  position: relative;
  padding: 0.5rem 0.5rem;
  transition: all 0.3s ease;
}

.nav a:hover {
  color: #fff;
}

.nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #E29205;
  transition: width 0.3s ease;
}

.nav a:hover::after {
  width: 100%;
}

.titulo {
  color: #E29205;
  text-align: center;
  font-family: "Ramadhan", sans-serif;
  letter-spacing: 2px;
  position: relative;
  font-size: clamp(7rem, 8vw, 7rem);
  z-index: 2;
  margin: 0;
  transform: none;
  white-space: nowrap;
}

.contact-title {
  transform: none !important;
  font-size: clamp(5rem, 6vw, 6rem);
  margin: 0 auto;
  display: block;
  width: fit-content;
}

.section {
  font-weight: lighter;
  text-align: center;
  color: #E29205;
  font-size: 18px;
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
  animation-delay: 0.5s;
  margin-top: 2rem; /* Añadido margen superior */
}

.section h2 {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.body {
  position: relative;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
  display: flex; /* Añadido */
  flex-direction: column; /* Añadido */
}

.body a {
  color: #E29205;
  text-decoration: none;
}

body::after {
  content: "";
  position: fixed; /* Cambiado de absolute a fixed */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: -1;
  pointer-events: none;
}

hr {
  border: 1px solid #E29205;
  margin: 0;
}

.container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  height: auto;
  display: flex;
  justify-content: center; /* Cambiado a center */
  align-items: center;
  margin: 1rem auto;
  animation: fadeIn 1s ease-in;
  padding: 2rem 1rem;
  flex-direction: column;
  flex: 1;
}

header {
  display: grid;
  grid-template-columns: 1fr minmax(150px, auto) 1fr; /* Ajustado para desplazar más los logos hacia el exterior */
  align-items: center;
  justify-items: center;
  width: 100%;
  padding: 1rem;
  position: relative;
  max-width: 1600px;
  margin: 0 auto 2rem;
  box-sizing: border-box;
  gap: 2rem;
}

header a:first-child {
  justify-self: start; /* Alineado al borde izquierdo */
  padding-right: 2rem; /* Aumentado padding para desplazar más hacia el borde */
}

header a:last-child {
  justify-self: end; /* Alineado al borde derecho */
  padding-left: 2rem; /* Aumentado padding para desplazar más hacia el borde */
}

/* Reset todas las reglas anteriores de imágenes */
header img,
header a img {
  height: 12vh;
  width: auto;
  transition: transform 0.3s ease;
}

header a:last-child {
  margin-left: auto;
  padding-right: 0;
}

header a:last-child img {
  height: 12vh;
}

/* Opcional: añadir un efecto hover */
header img:hover {
  transform: scale(1.05);
}

header .titulo {
  grid-column: 2;
  text-align: center;
  width: 100%;
  margin: 0 auto;
  transform: none;
  font-size: clamp(4rem, 6vw, 7rem);
  white-space: nowrap;
}

#background-video {
  position: fixed; /* Simplificado para evitar repetir posiciones */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  z-index: -2; /* Asegura que esté detrás del overlay */
  filter: brightness(3.2); /* Mantiene el brillo */
  will-change: transform; /* Optimización de rendimiento */
}

.body.no-video #background-video {
  display: none;
}

.services h2 {
  text-align: center;
  width: 100%;
  margin-bottom: 2rem;
  color: #E29205;
  font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
}

.service-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.service-grid a {
  transition: all 0.3s ease;
  display: inline-block;
}

.service-grid a:hover {
  color: #eee9e9;
  transform: scale(1.02);
  text-shadow: 0 0 10px #bc8112;
}

.portfolio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(150px, 20vw, 250px), 1fr));
  gap: clamp(0.5rem, 1vw, 1rem);
  width: 100%;
  margin: 0 auto;
  padding: var(--main-padding);
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  transition: transform 0.3s ease;
  aspect-ratio: 16/9;
}

.portfolio-item:hover {
  transform: scale(1.05);
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  padding: 1rem;
  color: #E29205;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.portfolio-item:hover .overlay {
  transform: translateY(0);
}

.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.5rem;
}

.overlay h3 {
  color: #E29205;
  margin: 0;
  font-size: clamp(0.8rem, 1.5vw, 1.2rem);
  text-align: center;
}

.text-center {
  text-align: center;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Media query para pantallas más pequeñas */
@media (max-width: 768px) {
  #background-video {
    width: 100%;
    height: auto;
  }

  .titulo {
    position: relative;
    font-size: 60px;
    margin: 0.5rem 0;
    transform: translateX(-3%); /* Ajuste más sutil para móviles */
    left: auto;
    margin: 0 2rem;
    grid-column: 2;
  }

  .nav {
    flex-direction: column;
    gap: 1rem;
    margin-top: 3rem; /* Reducir espacio en móviles */
    gap: 0.5rem;
  }

  .container {
    margin: 1rem auto; /* Reducir el margen */
    width: 95%;
    padding: 0.5rem;
    margin-bottom: 80px; /* Ajustar margen en móviles */
  }

  header {
    grid-template-columns: minmax(50px, 1fr) minmax(200px, 2fr) minmax(50px, 1fr);
    gap: 1rem;
    padding: 0.5rem;
  }

  header img,
  header a img {
    height: 10vh;
  }

  header a:last-child img {
    height: 7vh;
    margin-right: 0;
  }

  header a:last-child img {
    height: 6vh;
  }

  header .titulo {
    grid-column: 2;
    justify-self: center;
    align-self: center;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0;
    justify-self: center; /* Asegura que el título esté centrado */
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin: 0;
    transform: none;
    padding: 0;
  }

  header a {
    display: block;
    text-decoration: none;
  }

  header img:first-child {
    grid-column: 1;
    justify-self: start; /* Alinea el logo al inicio */
  }

  header img:last-child {
    height: clamp(40px, 6vh, 85px);
    width: auto;
    margin-right: 25px;
  }

  header a:first-child img,
  header a:last-child img {
    height: inherit;
    width: auto;
  }

  header .titulo {
    grid-column: 2;
    justify-self: center;
    align-self: center;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0;
    justify-self: center; /* Asegura que el título esté centrado */
  }

  header a {
    display: block;
    text-decoration: none;
  }

  header a:first-child img {
    width: 200px;
    height: auto;
  }

  header a:last-child img {
    width: 85px;
    height: auto;
    margin-right: 25px;
  }

  .titulo {
    font-size: clamp(3rem, 6vw, 5rem);
    margin: 0.5rem 0;
  }

  .nav {
    flex-direction: column;
    padding: 0.5rem;
  }

  .nav a {
    width: 100%;
    text-align: center;
    margin: 0.2rem 0;
  }

  .portfolio {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: clamp(0.3rem, 0.8vw, 0.8rem);
  }

  main.section {
    margin-bottom: 60px; /* Espacio para el footer */
  }

  .body {
    padding-bottom: 60px; /* Ajustar padding en móviles */
  }

  :root {
    --header-height: 10vh;
    --main-padding: 1rem;
  }

  .portfolio {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  header {
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    gap: 1rem;
  }

  .titulo {
    position: relative;
    transform: none;
    left: auto;
    margin: 1rem 0;
    font-size: clamp(3rem, 6vw, 5rem);
    width: 100%;
  }

  header img,
  header a img {
    height: 10vh;
  }

  header a:last-child img {
    height: 8vh;
  }

  .nav {
    margin-top: 1rem;
    padding: 0.5rem;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  header {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  header img,
  header a img {
    height: 8vh;
    max-width: 100%;
    object-fit: contain;
  }

  header a:first-child,
  header a:last-child {
    padding: 0;
  }

  header a:first-child {
    justify-self: center;
  }

  header a:last-child {
    justify-self: center;
  }
}

@media (max-width: 480px) {
  header {
    grid-template-columns: minmax(40px, 1fr) minmax(150px, 2fr) minmax(40px, 1fr);
    gap: 0.5rem;
  }

  header .titulo {
    font-size: clamp(2rem, 4vw, 3rem);
  }

  header img,
  header a img {
    height: 8vh;
    width: auto;
  }

  header {
    padding: 0.3rem;
    flex-wrap: nowrap;
  }

  .titulo {
    margin: 0 1rem;
  }

  header {
    padding: 0.3rem;
    margin-bottom: 1rem;
  }

  header img,
  header a img {
    height: clamp(30px, 10vh, 80px);
  }

  header img:last-child,
  header a:last-child img {
    height: clamp(25px, 6vh, 60px);
  }

  .nav {
    margin-top: 2rem;
  }

  .container {
    width: 95%;
    padding: 0.5rem;
    margin: 0.5rem auto;
  }

  .section {
    font-size: 16px;
  }

  .portfolio {
    grid-template-columns: 1fr; /* Una sola columna */
    gap: clamp(0.2rem, 0.5vw, 0.5rem);
  }

  .nav a {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
  }

  .footer-content {
    padding: 0 1rem;
  }

  .portfolio {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .titulo {
    font-size: clamp(2.5rem, 5vw, 4rem);
  }

  header {
    padding: 0.3rem;
    flex-wrap: wrap;
  }

  .titulo {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin: 0.5rem 0;
  }

  header img,
  header a img {
    height: 8vh;
  }

  header a:last-child img {
    height: 7vh;
  }

  header {
    grid-template-columns: auto 1fr auto;
    gap: 0.3rem;
  }

  header img,
  header a img {
    height: 6vh;
    max-width: 100%;
    object-fit: contain;
  }

  header .titulo {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
  }
}

/* Media query para ajustar el diseño en pantallas medianas */
@media (min-width: 769px) and (max-width: 1024px) {
  header {
    min-height: 100px;
  }

  header img {
    width: 180px;
  }

  .titulo {
    font-size: 4rem;
  }
}

/* Nueva media query para pantallas grandes */
@media (min-width: 1200px) {
  .container {
    max-width: 1400px;
  }

  .portfolio {
    grid-template-columns: repeat(3, 1fr); /* Tres columnas fijas */
  }
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
