/* =========================================================
   PROYECTOS - CSS (ESTÁNDAR INDEX)
========================================================= */

/* =========================================================
   VARIABLES (PALETA OFICIAL)
========================================================= */
:root {
  --color-text-body: #373636;
  --color-secondary: #3f5e73;
  --color-background-light: #f2e8cf;
  --color-accent: #7d8f84;
  --color-primary: #c47a5a;

  --color-background-gray: #f2e8cf;

  --box-shadow-dark: 3px 3px 5px 1.8px rgba(0, 0, 0, 0.3),
    inset -5px -5px 5px rgba(0, 0, 0, 0.3),
    inset 5px 5px 5px rgba(203, 213, 225, 0.3);

  --border-radius: 0.25rem;
  --height-navbar: 6rem;

  --font-size-h1: 3rem;
  --font-size-h2: 2.6rem;
  --font-size-h3: 1.8rem;
  --font-size-h4: 1.5rem;
  --font-size-h5: 1.4rem;
  --font-size-paragraph: 1.3rem;

  --padding-box: 1.5rem;

  --ease-snap: cubic-bezier(0.2, 0.9, 0.2, 1);
  --ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);

  --dur-xxfast: 120ms;
  --dur-xfast: 160ms;
  --dur-fast: 220ms;
  --dur-med: 320ms;
}

/* =========================================================
   RESET / BASE
========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html,
body {
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: var(--color-text-body);
  background: #fff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

main.container {
  overflow: hidden;
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: min-content;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* =========================================================
   WRAPPERS
========================================================= */
.navbar__wrapper,
.banner__wrapper,
.projects-intro__wrapper,
.projects__wrapper,
.footer__wrapper {
  max-width: 75rem;
  width: 90%;
  margin: 0 auto;
  text-align: center;
}

/* =========================================================
   NAVBAR (IGUAL INDEX)
========================================================= */
.navbar {
  position: relative;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  background: var(--color-primary);
}

.navbar__wrapper {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: var(--height-navbar);
}

.logo-brand {
  width: 8rem;
  height: 100%;
  text-decoration: none;
  display: grid;
  justify-self: start;
  align-items: center;
  grid-column: 1/2;
  grid-row: 1/2;
}

.logo-brand__image {
  width: 100%;
  height: auto;
  cursor: pointer;
}

.menu-btn {
  font-size: 1.8rem;
  background: transparent;
  border: none;
  cursor: pointer;
  display: grid;
  justify-self: end;
  align-items: center;
  padding: 0.5rem;
  grid-column: 2/3;
  grid-row: 1/2;
}

.menu-icon {
  color: var(--color-background-light);
}

.menu-icon--close {
  display: none;
}

.menu-list {
  position: absolute;
  top: var(--height-navbar);
  left: 0;
  z-index: 110;
  background-color: #c47a5a;
  width: 100%;
  height: calc(100vh - var(--height-navbar));
  border-top: 0.5px solid var(--color-background-light);
  overflow: hidden;

  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(5, 3.5rem);

  transform: translateX(-100%);
  transition: transform var(--dur-med) var(--ease-snap);
  will-change: transform;
}

.menu-list__item {
  border-bottom: 0.5px solid rgba(242, 232, 207, 0.5);
}

.menu-list__link {
  text-decoration: none;
  display: block;
  color: var(--color-background-light);
  font-size: var(--font-size-paragraph);
  font-weight: 300;
  height: 3.5rem;
  line-height: 3.5rem;
  text-align: center;
  padding-left: 7.5%;
  transition: background-color var(--dur-fast) var(--ease-soft),
    color var(--dur-fast) var(--ease-soft);
}

.menu-list__link:hover {
  background-color: rgba(242, 232, 207, 0.15);
}

.show {
  transform: translateX(0);
}

/* =========================================================
   BANNER
========================================================= */
.banner {
  position: relative;
  height: calc(100vh - var(--height-navbar));
  display: grid;
  place-items: center;
  color: var(--color-background-light);
}

.banner picture,
.banner .banner-image__container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.banner .banner__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner .banner__overlay {
  position: absolute;
  inset: 0;
  background-color: #000;
  opacity: 0.5;
  z-index: 2;
}

.banner .banner__wrapper {
  position: relative;
  z-index: 3;
}

.banner__wrapper {
  display: grid;
}

.banner__text {
  text-align: center;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 1.5rem;
}

.banner__title--h2 {
  font-size: var(--font-size-h1);
  font-weight: 900;
}

.banner__buttons {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 1.2rem;
  align-items: center;
}

.banner__button {
  position: relative;
  display: flex;
  width: 100%;
  height: 60px;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.01rem;
  border-radius: 0.3rem;
  overflow: hidden;

  transition: transform var(--dur-fast) var(--ease-snap),
    box-shadow var(--dur-fast) var(--ease-soft),
    background-color var(--dur-fast) var(--ease-soft);
  will-change: transform;
}

.banner__button--primary {
  background-color: var(--color-text-body);
  color: var(--color-background-light);
}

.banner__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.15);
}

.banner__button--text {
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 1px;
}

/* =========================================================
   PROJECTS INTRO
========================================================= */
.projects-intro {
  background: var(--color-background-light);
  display: grid;
}

.projects-intro__wrapper {
  margin: 5rem auto;
}

.projects-intro__title {
  font-size: var(--font-size-h2);
  color: var(--color-primary);
  font-weight: 900;
  margin-bottom: 2rem;
}

.projects-intro__paragraph {
  font-size: var(--font-size-paragraph);
  font-weight: 400;
  color: var(--color-text-body);
  text-align: center;
  max-width: 80ch;
  margin: 0.75rem auto 0;
}

/* =========================================================
   PROJECTS GRID
========================================================= */
.projects {
  background: #3f5e73;
  display: grid;
}

.projects__wrapper {
  margin: 5rem auto;
  display: grid;
  gap: 3rem;
}

.projects__title--h2 {
  font-size: var(--font-size-paragraph);
  color:#f2e8cf;
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: 1px;
  line-height: 1.3;
  text-transform: uppercase;
}

.projects__paragraph {
  font-size: var(--font-size-paragraph);
  color:#f2e8cf;
  font-weight: 400;
  max-width: 80ch;
  margin: 0 auto;
}

.projects__boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 2rem;
}

.projects__item {
  background: #ffffff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;

  transition: transform var(--dur-fast) var(--ease-snap),
    box-shadow var(--dur-fast) var(--ease-soft);
  will-change: transform;

  display: grid;
  grid-template-rows: auto 1fr;
}

.projects__item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.15);
}

.projects__image {
  width: 100%;
  height: 200px;   /* fija una altura */
  object-fit: cover;
  object-position: center;
  display: block;
}


.projects__content {
  text-align: start;
  padding: 2rem 1.5rem;
}

.projects__subtitle {
  font-size: var(--font-size-h4);
  font-weight: 900;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
}

.projects__sector,
.projects__services,
.projects__address {
  font-size: var(--font-size-paragraph);
  font-weight: 400;
  color: var(--color-text-body);
}

.projects__address {
  margin-bottom: 1rem;
}

.projects__button {
  text-decoration: none;
  color: var(--color-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  transition: transform var(--dur-fast) var(--ease-snap);
}

.projects__button:hover {
  transform: translateX(2px);
}

.projects__button--text {
  font-size: var(--font-size-paragraph);
  font-weight: 600;
}

.icon {
  font-size: 18px;
}

/* Controles carrusel (si luego lo activas) */
.carousel__controls {
  display: none;
}

.carousel__controls button {
  background: rgba(199, 122, 90, 0.08);
  border: 1px solid var(--color-primary);
  padding: 12px 24px;
  border-radius: 0.3rem;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  transition: transform var(--dur-fast) var(--ease-snap),
    background-color var(--dur-fast) var(--ease-soft);
}

.carousel__controls button:hover {
  transform: translateY(-2px);
}

/* =========================================================
   SCROLL TO TOP + WHATSAPP (igual index)
========================================================= */
#scrollToTopBtn {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 25px;
  z-index: 999;
  border: none;
  outline: none;
  background-color: var(--color-accent);
  color: var(--color-background-light);
  cursor: pointer;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

  transition: transform var(--dur-fast) var(--ease-snap),
    background-color var(--dur-fast) var(--ease-soft),
    opacity var(--dur-fast) var(--ease-soft),
    visibility var(--dur-fast) var(--ease-soft);
  will-change: transform;
}

#scrollToTopBtn:hover {
  background-color: var(--color-secondary);
  transform: translateY(-2px);
}

#scrollToTopBtn i {
  color: var(--color-background-light);
}

.whatsapp__button {
  position: fixed;
  display: grid;
  width: 50px;
  height: 50px;
  background-color: #25d366;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  bottom: 25px;
  right: 25px;
  box-shadow: var(--box-shadow-dark);

  transition: transform var(--dur-fast) var(--ease-snap),
    box-shadow var(--dur-fast) var(--ease-soft);
  will-change: transform;
}

.whatsapp__button:hover {
  transform: translateY(-2px);
}

.whatsapp__button--float i {
  color: #ffffff;
  font-size: 24px;
}

/* =========================================================
   FOOTER (igual index, sin bugs de underline)
========================================================= */
.footer {
  background-color: #24262b;
  padding: 70px 0;
  display: grid;
  justify-items: center;
}

.footer__wrapper {
  width: 90%;
  max-width: 75rem;
  margin: 0 auto;
  text-align: left;
}

.row {
  display: flex;
  flex-wrap: wrap;
}

.footer-col {
  width: 25%;
  padding: 0 15px;
  text-align: left;
}

.footer-col h4 {
  font-size: 18px;
  color: #ffffff;
  text-transform: capitalize;
  margin-bottom: 35px;
  font-weight: 500;
  position: relative;
  display: inline-block;
}

.footer-col h4::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  background-color: var(--color-primary);
  height: 2px;
  width: 50px;
}

.footer-col ul li:not(:last-child) {
  margin-bottom: 10px;
}

.footer-col ul li a {
  font-size: 16px;
  text-transform: capitalize;
  text-decoration: none;
  font-weight: 300;
  color: #bbbbbb;
  display: block;

  transition: color var(--dur-fast) var(--ease-soft),
    transform var(--dur-fast) var(--ease-snap);
}

.footer-col ul li a:hover {
  color: #ffffff;
  transform: translateX(8px);
}

.footer-col .social-links a {
  display: inline-block;
  height: 40px;
  width: 40px;
  background-color: rgba(242, 232, 207, 0.12);
  margin: 0 10px 10px 0;
  text-align: center;
  line-height: 40px;
  border-radius: 50%;
  color: #ffffff;

  transition: transform var(--dur-fast) var(--ease-snap),
    background-color var(--dur-fast) var(--ease-soft),
    color var(--dur-fast) var(--ease-soft);
}

.footer-col .social-links a:hover {
  color: #24262b;
  background-color: var(--color-background-light);
  transform: translateY(-2px);
}

/* Footer responsive */
@media (max-width: 767px) {
  .footer-col {
    width: 50%;
    margin-bottom: 30px;
  }
}

@media (max-width: 574px) {
  .footer-col {
    width: 100%;
  }
}

/* =========================================================
   MEDIA QUERIES NAV + BANNER (igual index)
========================================================= */
@media (min-width: 768px) {
  .banner__title--h2 {
    font-size: 4rem;
  }

  .banner__buttons {
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
  }

  .banner__button {
    width: 300px;
  }
}

@media (min-width: 910px) {
  .menu-btn {
    display: none;
  }

  .navbar__wrapper {
    grid-template-columns: 1fr auto;
    grid-column-gap: 0.5rem;
  }

  .menu-list {
    display: grid;
    grid-template-columns: repeat(5, auto);
    grid-template-rows: var(--height-navbar);
    align-items: center;
    grid-column: 2/3;
    grid-row: 1/2;
    grid-column-gap: 3rem;

    position: static;
    width: 100%;
    height: var(--height-navbar) !important;
    overflow: visible !important;
    border-top: none;
    background: transparent;
    transition: none;
    transform: none;
  }

  .menu-list__item {
    border-bottom: none;
    width: 100%;
  }

  .menu-list__link {
    padding: 0;
    position: relative;
    color: #ffffff;
  }

  .menu-list__link:hover {
    background: none;
  }

  .menu-list__link::before,
  .menu-list__link::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-background-light);
    transform: scaleX(0);
    transition: transform var(--dur-med) var(--ease-snap);
  }

  .menu-list__link::before {
    top: 5px;
    transform-origin: left;
  }

  .menu-list__link::after {
    bottom: 5px;
    transform-origin: right;
  }

  .menu-list__link:hover::before,
  .menu-list__link:hover::after {
    transform: scaleX(1);
  }
}

@media (min-width: 1080px) {
  .banner__title--h2 {
    font-size: 5rem;
  }
}
/* =========================================================
   FIX CARRUSEL PROYECTOS (MÓVIL + FLECHAS VISIBLES)
   Pegar al FINAL del CSS para que gane prioridad
========================================================= */

/* En el fondo azul, define un color de texto para que currentColor funcione */
.projects {
  color: var(--color-background-light);
}

/* Flechas: por defecto ocultas en desktop */
.carousel__controls {
  display: none;
}

/* MÓVIL: carrusel horizontal + flechas */
@media (max-width: 767px) {
  .projects__boxes {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }

  .projects__boxes::-webkit-scrollbar {
    display: none;
  }

  .projects__item {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }

  .carousel__controls {
    display: block;
    margin-top: 14px;
  }

  .controls__wrapper {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  .carousel-prev,
  .carousel-next {
    appearance: none;
    border: 1px solid var(--color-background-light);
    color: var(--color-background-light);
    background: rgba(0, 0, 0, 0.18);
    border-radius: 999px;
    padding: 10px 14px;
    line-height: 1;
    cursor: pointer;
    transition: transform var(--dur-fast) var(--ease-snap),
      background-color var(--dur-fast) var(--ease-soft),
      opacity var(--dur-fast) var(--ease-soft);
  }

  .carousel-prev:hover,
  .carousel-next:hover {
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.28);
  }

  .carousel-prev[disabled],
  .carousel-next[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
  }
}

/* DESKTOP: grid normal (sin carrusel ni flechas) */
@media (min-width: 768px) {
  .projects__boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 2rem;
  }
}
