/* 
  Estilos principales para SIMSA Landing Page
  Fuente: Inter
*/

:root {
  /* Colors */
  --brand-blue: #234c7b;
  --brand-blue-dark: #1a365d;
  --brand-red: #ea4335;
  --brand-red-hover: #c53030;
  --brand-green: #38bdf8; /* Para cotizar highlight - cyan/blue according to layout? Actually mockup has "cotizar" in blue/cyan */
  
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --bg-light: #f9fafb;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--brand-blue-dark);
}

.fw-black {
  font-weight: 800;
  letter-spacing: -2px;
}

/* Typography Overrides */
.text-brand-green {
  color: var(--brand-green) !important;
}
.text-brand-red {
  color: var(--brand-red) !important;
}

/* ================= Navbar ================= */
.navbar {
  transition: all 0.3s ease;
}
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
  padding: 0.8rem 0 !important;
}
.navbar-nav .nav-link {
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}
.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2.5px;
  bottom: 0px;
  left: 0;
  background-color: var(--brand-blue);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}
.navbar-nav .nav-link:hover::after, 
.navbar-nav .nav-link.active::after {
  width: 100%;
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
  color: var(--brand-blue) !important;
}

/* Dropdown styling & Hover logic */
.dropdown-menu {
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
  border: 1px solid rgba(0,0,0,0.05);
  animation: dropdownFade 0.3s ease-out;
  margin-top: 10px !important;
  padding: 0.8rem !important;
}

@media (min-width: 992px) {
  .nav-item.dropdown:hover > .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .dropdown-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
  }
}

.dropdown-item {
  font-weight: 500;
  color: var(--text-dark);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--bg-light);
  color: var(--brand-blue);
  padding-left: 1.4rem;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Social icons blue */
.nav-social-icon {
  color: #000000 !important;
  transition: all 0.3s ease;
}

.nav-social-icon:hover {
  color: var(--brand-blue) !important;
  transform: translateY(-4px);
}

/* Mobile Navbar Dropdown Auto-Expand */
@media (max-width: 991px) {
  .navbar-nav .dropdown-toggle::after {
    display: none !important;
  }
  .navbar-nav .dropdown-menu {
    display: block !important;
    position: static !important;
    float: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-left: 1.5rem !important;
    padding-top: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    margin-top: 5px !important;
  }
  .dropdown-item {
    color: var(--text-dark) !important;
    font-size: 0.9rem !important;
    padding: 0.5rem 1rem !important;
  }
  .dropdown-item:hover {
    background-color: rgba(35, 76, 123, 0.05) !important;
    color: var(--brand-blue) !important;
    padding-left: 1rem !important;
  }
}


/* ================= Buttons ================= */
.btn-brand {
  background-color: var(--brand-red);
  color: white;
  border: none;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px 0 rgba(234, 67, 53, 0.39);
}
.btn-brand:hover {
  background-color: var(--brand-red-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 67, 53, 0.4);
}

.btn-outline-brand {
  color: var(--brand-red);
  border: 1px solid var(--brand-red);
  background: transparent;
  font-weight: 500;
}
.btn-outline-brand:hover {
  background-color: var(--brand-red);
  color: white;
}

/* ================= Hero Section ================= */
.hero-section {
  min-height: 100vh;
  margin-top: 0;
  /* Background with Parallax effect */
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
              url('../imagenes/fondo.png') center/cover no-repeat;
  background-attachment: fixed;
  background-color: var(--brand-blue-dark); /* fallback */
  position: relative;
  display: flex;
  align-items: center;
}

.hero-content h1 {
  color: white !important;
  text-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

@media (max-width: 767px) {
  .hero-content h1 {
    font-size: 3.5rem !important; /* Más pequeño para cel */
  }
  .hero-content h3 {
    font-size: 1.5rem !important;
  }
  .hero-content p.lead {
    font-size: 1rem !important;
    margin-bottom: 2rem !important;
  }
}

.hero-content .reveal {
  opacity: 0;
  transform: translateX(-50px);
  filter: blur(10px);
  transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hero-content .reveal.active {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0);
}

/* Button outline light adjustments */
.btn-outline-light {
  border-width: 2px;
  font-weight: 600;
  border-color: rgba(255,255,255,0.3);
}
.btn-outline-light:hover {
  background-color: white;
  color: var(--brand-blue-dark);
  border-color: white;
}

/* ================= About Us (Image Grid) ================= */
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 240px 240px;
  gap: 20px;
  perspective: 1000px; /* Habilitar efectos 3D para contenedores hijos */
}
.image-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  border-radius: 12px;
}
.grid-img-1 {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  height: 100% !important;
  transition-delay: 0.1s;
  /* Pieza Izquierda/Superior */
  transform: translateX(-80px) translateY(-40px) rotate(-15deg);
}
.grid-img-2 {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  height: 100% !important;
  transition-delay: 0.7s;
  /* Pieza Superior */
  transform: translateY(-100px) scale(0.85);
}
.grid-img-3 {
  grid-column: 3 / 4;
  grid-row: 1 / 3;
  height: 100% !important;
  transition-delay: 1.3s;
  /* Pieza Derecha */
  transform: translateX(100px) rotateY(25deg);
}
.grid-img-4 {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  height: 100% !important;
  transition-delay: 1.9s;
  /* Pieza Inferior */
  transform: translateY(100px) rotateX(-25deg);
}

.image-grid .reveal {
  opacity: 0;
  filter: blur(8px);
  /* El transform inicial ahora se hereda de las clases grid-img-X */
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  backface-visibility: hidden;
}

.image-grid .reveal.active {
  opacity: 1;
  transform: scale(1) translate(0) rotate(0) rotateX(0) rotateY(0);
  filter: blur(0);
}

.image-grid img:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* ================= Waves Containers ================= */
.wave-container-top {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin-bottom: -1px; /* fix gap */
}
.wave-container-bottom {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin-top: -1px; /* fix gap */
  background-color: var(--brand-blue-dark);
}
.wave-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ================= Services Section ================= */
.services-section {
  background-color: var(--brand-blue-dark);
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.services-section .section-title {
  color: #ffffff;
}
.service-card {
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  background-color: #ffffff;
}
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15) !important;
}
.service-card .card-img-top {
  height: 260px;
  object-fit: cover;
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.service-card:hover .card-img-top {
  transform: scale(1.05); /* Zoom in for a more dynamic feel */
  filter: blur(8px) brightness(0.7);
  opacity: 0.9;
}
.service-card .card-body {
  background-color: #ffffff;
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 -5px 15px rgba(0,0,0,0.02);
}
.service-card:hover .card-body {
  transform: translateY(-30px);
  border-top: 1px solid transparent;
  box-shadow: 0 -15px 30px rgba(0,0,0,0.08);
}

/* Specific entrance for contact section image */
.contact-section .reveal.col-lg-4 {
  opacity: 0;
  transform: scale(0.8) rotateY(-10deg) translateX(30px);
  transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.contact-section .reveal.col-lg-4.active {
  opacity: 1;
  transform: scale(1) rotateY(0) translateX(0);
}

/* ================= Service Detail Pages ================= */
.service-info-section {
  background-color: var(--brand-blue);
}
.info-blue-left {
  border-right: 2px solid rgba(255, 255, 255, 0.2);
}
@media (max-width: 991px) {
  .info-blue-left {
    border-right: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
  }
}



/* ================= Projects Section ================= */
.project-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  z-index: 2;
  position: relative;
  transition: transform 0.5s ease;
  border-radius: 12px;
}
.project-row:hover .project-img {
  transform: scale(1.02);
}
.project-bg-blob {
  position: absolute;
  top: -20px;
  bottom: 20px;
  left: -20px;
  right: 20px;
  background-color: #f1f5f9;
  border-radius: 20px;
  z-index: 1;
}
.project-bg-blob.right {
  left: 20px;
  right: -20px;
}
.project-line {
  height: 2px;
  background-color: var(--brand-blue);
  opacity: 0.2;
}

/* ================= Contact Section ================= */
.contact-line {
  width: 50px;
  height: 3px;
  background-color: var(--brand-red);
}
.contact-info .contact-icon {
  color: var(--brand-green);
  transition: all 0.3s ease;
}
.contact-info > div:hover .contact-icon {
  background-color: var(--brand-green) !important;
  color: white !important;
  transform: rotate(10deg);
}

/* Staggered Contact Info Cards */
.contact-info .reveal {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.contact-info .reveal.active {
  opacity: 1;
  transform: translateX(0);
}
.contact-info .reveal:nth-child(1) { transition-delay: 0.1s; }
.contact-info .reveal:nth-child(2) { transition-delay: 0.25s; }
.contact-info .reveal:nth-child(3) { transition-delay: 0.4s; }

/* Premium Form Card Entrance */
.contact-section .row.justify-content-center.reveal {
  opacity: 0;
  transform: scale(0.9) rotateX(-10deg) translateY(40px);
  perspective: 1000px;
  transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.contact-section .row.justify-content-center.reveal.active {
  opacity: 1;
  transform: scale(1) rotateX(0) translateY(0);
}

/* ================= Placeholder fallback styling ================= */
.placeholder-img {
  background-color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.8rem;
}
.placeholder-img::after {
  content: "Imagen Pendiente";
}

/* Base Reveal Animation for other elements */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for Services */
.services-section .col-md-6:nth-child(1) .reveal { transition-delay: 0.1s; }
.services-section .col-md-6:nth-child(2) .reveal { transition-delay: 0.25s; }
.services-section .col-md-6:nth-child(3) .reveal { transition-delay: 0.4s; }
.services-section .col-md-6:nth-child(4) .reveal { transition-delay: 0.55s; }
.services-section .col-md-6:nth-child(5) .reveal { transition-delay: 0.7s; }

/* Scale & Fade Entry Animation (Option 1) for Service Cards */
.service-card.reveal {
  opacity: 0;
  transform: scale(0.85) translateY(20px);
  transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.service-card.reveal.active {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .hero-section {
    min-height: calc(100vh - 66px);
    margin-top: 66px;
  }
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 150px 150px 150px;
    gap: 10px;
  }
  .grid-img-1 {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }
  .grid-img-2 {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }
  .grid-img-3 {
    grid-column: 1 / 3;
    grid-row: 3 / 4;
  }
  .grid-img-4 {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
  }
}
