/* --- Variables & Global Styles --- */
:root {
  --primary-color: #f97316;
  --secondary-color: #111827;
  --accent-color: #374151;
  --light-gray-color: #f9fafb;
  --dark-gray-color: #333333;
  --text-color: #333;
  --white-color: #ffffff;
  --font-primary: "Poppins", sans-serif;
  --font-secondary: "Roboto", sans-serif;
  --header-height: 100px;
}

html {
  /* Previene saltos de layout en móviles */
  overflow-y: scroll;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-secondary);
  color: var(--text-color);
  line-height: 1.7;
  background-color: var(--white-color);
  overflow-x: hidden; /* Previene scroll horizontal por animaciones */
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--secondary-color);
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.section {
  padding: 100px 0;
}
.section-title {
  font-size: 2.8rem;
  margin-bottom: 20px;
}
.text-center {
  text-align: center;
}
.section-subtitle {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto 50px;
}

/* --- Botones Mejorados --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-primary);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background-image: linear-gradient(to right, #f97316 0%, #ea580c 51%, #f97316 100%);
  background-size: 200% auto;
  color: var(--white-color);
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}
.btn-primary:hover {
  background-position: right center;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.3);
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-bottom-color: #eee;
}
.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
.logo img {
  height: 85px;
  width: auto;
  transition: height 0.3s ease;
}
.header.scrolled .logo img {
  height: 70px;
}
.nav-list {
  display: flex;
  list-style: none;
  gap: 40px;
}
.nav-link {
  text-decoration: none;
  color: var(--secondary-color);
  font-weight: 500;
  position: relative;
  padding: 5px 0;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}
.nav-link:hover::after {
  width: 100%;
}
.btn-header-cta {
  display: inline-flex;
}
.hamburger {
  display: none;
}

/* --- Hero Section con Imagen Fija --- */
.hero {
  position: relative;
  height: 100vh; /* Fallback */
  height: calc(var(--vh, 1vh) * 100); /* Solución definitiva para móviles */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white-color);
  background: url("https://logisticaharoldosa.com/camionhero.jpg")
    no-repeat center center;
  background-size: cover;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 24, 39, 0.6);
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero-title {
  font-size: 4.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--white-color);
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}
.hero-subtitle {
  font-size: 1.3rem;
  max-width: 650px;
  margin: 0 auto 40px;
  color: rgba(255, 255, 255, 0.9);
}

/* --- Stats Section --- */
.stats-section {
  background-color: var(--light-gray-color);
}
.stats-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  text-align: center;
}
.stat-number {
  font-size: 3.5rem;
  color: var(--primary-color);
  font-weight: 700;
}
.stat-label {
  font-size: 1rem;
  color: var(--accent-color);
}

/* --- About Us Section --- */
.about-us {
  background-color: var(--white-color);
}
.about-us-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.about-us-content p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 15px;
}
.about-us-image img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* --- Services Section --- */
.services {
  background-color: var(--light-gray-color);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.service-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  min-height: 350px;
  color: var(--white-color);
  display: flex;
  align-items: flex-end;
  padding: 30px;
  transition: transform 0.4s ease;
}
.service-card:hover {
  transform: translateY(-10px);
}
.service-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
}
.service-card:hover .service-card-bg {
  transform: scale(1.05);
}
.service-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 60%);
}
.service-content {
  position: relative;
  z-index: 2;
}
.service-title {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--white-color);
}

/* --- Process Section (Timeline) --- */
.process-section {
  background-color: var(--white-color);
}
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
.timeline::after {
  content: "";
  position: absolute;
  width: 4px;
  background-color: var(--primary-color);
  opacity: 0.3;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
}
.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
}
.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}
.timeline-item:nth-child(even) {
  left: 50%;
}
.timeline-item::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--white-color);
  border: 4px solid var(--primary-color);
  top: 25px;
  border-radius: 50%;
  z-index: 1;
}
.timeline-item:nth-child(odd)::after {
  right: -10px;
}
.timeline-item:nth-child(even)::after {
  left: -10px;
}
.timeline-content {
  padding: 20px 30px;
  background-color: var(--white-color);
  position: relative;
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* --- Fleet Section --- */
.fleet-section {
  background-color: var(--light-gray-color);
}
.fleet-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 30px;
  margin-top: 50px;
}
.fleet-item {
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.fleet-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.fleet-item:hover img {
  transform: scale(1.1);
}

/* --- Contact Section --- */
.contact {
  position: relative;
  background: url("https://images.unsplash.com/photo-1517404215738-15263e9f9178?q=80&w=2070&auto=format&fit=crop")
    no-repeat center center / cover;
  color: var(--white-color);
}
.contact-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.9);
}
.contact-container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: center;
}
.contact .section-title,
.contact p {
  color: var(--white-color);
}
.contact-list {
  list-style: none;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.contact-list a {
  display: flex;
  align-items: center;
  gap: 15px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 1.1rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.contact-list a:hover {
  color: var(--white-color);
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}
.contact-list a svg {
  width: 26px;
  height: 26px;
  color: var(--primary-color);
  flex-shrink: 0;
}
.contact-list a span {
  flex-grow: 1;
}
.contact-form .form-group {
  margin-bottom: 20px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--accent-color);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--white-color);
  border-radius: 5px;
  font-family: var(--font-secondary);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #9ca3af;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: rgba(255, 255, 255, 0.1);
}
.contact-form button {
  width: 100%;
}

/* --- Footer --- */
.footer {
  background-color: var(--secondary-color);
  color: #aaa;
  padding: 80px 0 40px;
}
.footer-container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-logo {
  height: 70px;
  filter: brightness(0) invert(1);
  margin-bottom: 15px;
}
.footer-about-text {
  font-size: 0.9rem;
  line-height: 1.6;
}
.footer h4 {
  color: var(--white-color);
  margin-bottom: 15px;
}
.footer ul {
  list-style: none;
}
.footer ul li {
  margin-bottom: 10px;
}
.footer a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer a:hover {
  color: var(--primary-color);
}
.footer-social a {
  margin-right: 15px;
}
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--accent-color);
}

/* --- WhatsApp Float Button --- */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 30px;
  right: 30px;
  background-color: #25d366;
  color: #fff;
  border-radius: 50px;
  text-align: center;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1001; /* Aumentado para estar sobre el header */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.3);
}
.whatsapp-float svg {
  width: 32px;
  height: 32px;
}

/* --- Animations --- */
.animate-fade-in-up {
  animation: fadeInUp 1s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
}
.delay-1 {
  animation-delay: 0.2s;
}
.delay-2 {
  animation-delay: 0.4s;
}
.delay-3 {
  animation-delay: 0.6s;
}
.delay-4 {
  animation-delay: 0.8s;
}
.delay-5 {
  animation-delay: 1.0s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.fade-in {
  transform: translateY(50px);
}
.animate-on-scroll.zoom-in {
  transform: scale(0.9);
}
.animate-on-scroll.slide-in-left {
  transform: translateX(-50px);
}
.animate-on-scroll.slide-in-right {
  transform: translateX(50px);
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-us-container,
  .contact-container {
    grid-template-columns: 1fr;
  }
  .about-us-image {
    order: -1;
    margin-bottom: 30px;
  }
  .fleet-gallery {
    grid-template-columns: 1fr 1fr;
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
  .stats-container {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .section {
    padding: 80px 0;
  }
  .section-title {
    font-size: 2.2rem;
  }
  .hero-title {
    font-size: 2.8rem;
  }
  .services-grid,
  .fleet-gallery {
    grid-template-columns: 1fr;
  }
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-about {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Timeline Responsive Fix */
  .timeline::after {
    left: 31px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    left: 0;
    text-align: left;
  }
  .timeline-item::after {
    left: 21px;
  }

  /* Mobile Nav */
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background-color: var(--white-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.4s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1002; /* Asegura que el menú esté sobre el header y el botón de WA */
  }
  .nav.active {
    right: 0;
  }
  .nav-list {
    flex-direction: column;
    gap: 40px;
    text-align: center;
  }
  .nav-link {
    font-size: 1.5rem;
  }
  .btn-header-cta {
    display: none;
  }
  .hamburger {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1003; /* El z-index más alto para estar sobre todo */
  }
  .hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 5px 0;
    transition: all 0.3s ease;
  }
  .hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}
