/* ===========================
   TOLCAN — Estilos Globales
   Estilo: Minimalista Blanco/Negro
   =========================== */

/* === Variables === */
:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f7;
  --dark: #1a1a1a;
  --text: #111111;
  --text-muted: #666666;
  --text-light: #999999;
  --border: #e8e8e8;
  --font: 'Montserrat', sans-serif;
  --ease: 0.3s ease;
  --container: 1200px;
}

/* === Reset === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  font-family: var(--font);
}

/* === Container === */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===========================
   NAVBAR
   =========================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background var(--ease), box-shadow var(--ease);
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(8px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  max-width: var(--container);
  margin: 0 auto;
}

.nav-logo .logo-white,
.nav-logo .logo-color {
  height: 72px;
  width: auto;
  transition: opacity var(--ease);
}

.nav-logo .logo-color { display: none; }
.nav-logo .logo-white { display: block; }

#navbar.scrolled .nav-logo .logo-white { display: none; }
#navbar.scrolled .nav-logo .logo-color { display: block; }

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  transition: color var(--ease);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform var(--ease);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

#navbar.scrolled .nav-links a {
  color: var(--text-muted);
}

.nav-links a:hover {
  color: rgba(255, 255, 255, 1) !important;
}

#navbar.scrolled .nav-links a:hover {
  color: var(--text) !important;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1100;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  transition: background var(--ease), transform 0.25s ease, opacity 0.25s ease;
}

#navbar.scrolled .nav-toggle span {
  background: var(--text);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   HERO
   =========================== */
#hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #ffffff;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}


.hero-logo-img {
  height: 240px;
  width: auto;
}

.hero-tagline {
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  opacity: 0.88;
}

.btn-hero {
  margin-top: 0.5rem;
  display: inline-block;
  padding: 0.85rem 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.btn-hero:hover {
  background: #ffffff;
  color: var(--text);
  border-color: #ffffff;
}

.gallery-cta {
  text-align: center;
  margin-top: 3rem;
}

.btn-outline {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  border: 1px solid var(--text);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background var(--ease), color var(--ease);
}

.btn-outline:hover {
  background: var(--text);
  color: #ffffff;
}

/* ===========================
   SECCIONES — BASE
   =========================== */
section {
  padding: 7rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.section-header.light h2 {
  color: #ffffff;
}

.divider {
  width: 36px;
  height: 2px;
  background: var(--text);
  margin: 0 auto;
}

.divider.light {
  background: rgba(255, 255, 255, 0.5);
}

.section-subtitle {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
}

.section-header.light .section-subtitle {
  color: rgba(255, 255, 255, 0.6);
}

/* ===========================
   NOSOTROS
   =========================== */
#nosotros {
  background: var(--bg);
}

.nosotros-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 6rem;
  align-items: center;
}

.nosotros-text p {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 1.4rem;
}

.nosotros-text p:last-child {
  margin-bottom: 0;
}

.nosotros-stats {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--text);
}

.stat-number {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===========================
   SERVICIOS
   =========================== */
#servicios {
  background: var(--bg-alt);
}

.servicios-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.servicio-card {
  background: var(--bg);
  padding: 2.5rem 1.8rem;
  text-align: center;
  transition: transform var(--ease), box-shadow var(--ease);
}

.servicio-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.07);
}

.servicio-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 1.5rem;
  color: var(--text);
}

.servicio-icon svg {
  width: 100%;
  height: 100%;
}

.servicio-card h3 {
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.servicio-card p {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ===========================
   PROYECTOS
   =========================== */
#proyectos {
  background: var(--bg);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.gallery-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--bg-alt);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  will-change: transform;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background var(--ease);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item:hover::after {
  background: rgba(0, 0, 0, 0.08);
}

/* ===========================
   CONTACTO
   =========================== */
#contacto {
  background: var(--dark);
  color: #ffffff;
}

.contacto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 0;
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 300;
  outline: none;
  transition: border-color var(--ease);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
}

.btn-submit {
  align-self: flex-start;
  margin-top: 0.5rem;
  padding: 0.9rem 2.5rem;
  background: #ffffff;
  color: var(--dark);
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity var(--ease);
}

.btn-submit:hover {
  opacity: 0.85;
}

.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-feedback {
  font-size: 0.85rem;
  font-weight: 400;
  min-height: 1.4em;
  margin-top: 0.25rem;
}

.form-feedback.success {
  color: #74d494;
}

.form-feedback.error {
  color: #f07070;
}

/* Contact info */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  padding-top: 0.25rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  font-weight: 300;
}

.contact-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.55;
}

/* ===========================
   FOOTER
   =========================== */
#footer {
  background: #111111;
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.footer-logo-img {
  height: 64px;
  width: auto;
}

.footer-brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #ffffff;
}

.footer-nav {
  display: flex;
  gap: 2rem;
}

.footer-nav a {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  transition: color var(--ease);
}

.footer-nav a:hover {
  color: rgba(255, 255, 255, 0.9);
}

.footer-copy {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.25);
}

/* ===========================
   WHATSAPP BOTÓN FLOTANTE
   =========================== */
.whatsapp-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 54px;
  height: 54px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.35);
  z-index: 998;
  transition: transform var(--ease), box-shadow var(--ease);
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.5);
}

.whatsapp-btn svg {
  width: 28px;
  height: 28px;
}

/* ===========================
   LIGHTBOX
   =========================== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

#lightboxImg {
  max-width: 88vw;
  max-height: 85vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2001;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ease);
}

.lightbox-close:hover {
  color: #ffffff;
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 3.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2001;
  padding: 1rem;
  transition: color var(--ease);
  user-select: none;
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  color: #ffffff;
}

/* ===========================
   RESPONSIVE
   =========================== */

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

  .nosotros-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  section {
    padding: 5rem 0;
  }

  .container {
    padding: 0 1.25rem;
  }

  /* Logos mobile */
  .nav-logo .logo-white,
  .nav-logo .logo-color {
    height: 48px;
  }

  .hero-logo-img {
    height: 160px;
  }

  .footer-logo-img {
    height: 48px;
  }

  /* Navbar mobile */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: all;
  }

  .nav-links a {
    color: var(--text) !important;
    font-size: 1rem;
    letter-spacing: 0.18em;
  }

  /* Nosotros */
  .nosotros-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .nosotros-stats {
    flex-direction: row;
    gap: 0;
    justify-content: space-between;
  }

  .stat {
    flex: 1;
    padding-left: 1rem;
  }

  /* Servicios */
  .servicios-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Galería */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Contacto */
  .contacto-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero-logo-img {
    height: 120px;
  }

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

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

  .nosotros-stats {
    flex-direction: column;
  }

  .stat {
    padding-left: 1.2rem;
  }

}
