:root {
  --primary-color: #1a2332;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --accent-hover: #c0392b;
  --text-color: #333333;
  --text-light: #666666;
  --bg-color: #ffffff;
  --bg-light: #f8f9fa;
  --border-color: #e0e0e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  backdrop-filter: blur(0px);
  z-index: 1000;
  transition: all 0.4s ease;
  box-shadow: none;
}

.header.scrolled {
  background: linear-gradient(135deg, rgba(74, 21, 75, 0.98), rgba(41, 14, 40, 0.98));
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--bg-color);
  letter-spacing: 2px;
  text-decoration: none;
}

.logo i {
  color: var(--accent-color);
  font-size: 1.8rem;
}

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

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: color 0.3s ease;
  position: relative;
  text-transform: uppercase;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-color);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--bg-color);
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Hero Carousel */
.hero {
  position: relative;
  height: 100vh;
  min-height: 700px;
  overflow: hidden;
}

.carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carousel-item.active {
  opacity: 1;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: brightness(0.5);
  /* Prevent image distortion on different screen sizes */
  min-height: 100%;
  min-width: 100%;
}

.carousel-content {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  text-align: center;
  color: var(--bg-color);
  z-index: 2;
}

.carousel-content h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.7);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.carousel-content p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  margin-bottom: 2.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.7);
  font-weight: 400;
  padding: 0 1rem;
}

/* Carousel Controls */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: var(--bg-color);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 3;
  backdrop-filter: blur(5px);
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
  left: 20px;
}

.carousel-btn.next {
  right: 20px;
}

.carousel-indicators {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: var(--accent-color);
  width: 30px;
  border-radius: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--bg-color);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(231, 76, 60, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--bg-color);
  border: 2px solid var(--bg-color);
  padding: 1rem 2.5rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn-outline:hover {
  background: var(--bg-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

.btn-submit {
  width: 100%;
  background: var(--accent-color);
  color: var(--bg-color);
  justify-content: center;
}

.btn-submit:hover {
  background: var(--accent-hover);
}

.btn-large {
  padding: 1.2rem 3rem;
  font-size: 1.1rem;
}

/* Sections */
.section {
  padding: 5rem 0;
}

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

.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.section-header p {
  font-size: clamp(1rem, 2vw, 1.1rem);
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* Products */
.products {
  background: var(--bg-light);
}

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

.product-card {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.product-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--bg-color);
}

.product-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.product-card p {
  color: var(--text-light);
  line-height: 1.6;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 12px;
  border-left: 4px solid var(--accent-color);
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.service-card:hover {
  transform: translateX(10px);
  box-shadow: var(--shadow-lg);
}

.service-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-color);
  opacity: 0.2;
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.service-card p {
  color: var(--text-light);
}

/* Brands */
.brands {
  background: var(--bg-light);
  overflow: hidden;
}

.brands-carousel {
  overflow: hidden;
  position: relative;
}

.brands-track {
  display: flex;
  gap: 3rem;
  animation: scroll 30s linear infinite;
  will-change: transform;
}

.brand-item {
  flex-shrink: 0;
  width: 200px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.brand-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.brand-item:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Contact Hero Section */
.contact-hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("public/canalizacion.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
}

.contact-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1;
}

.contact-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--bg-color);
  max-width: 900px;
  padding: 2rem;
}

.contact-hero-content h2 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 900;
  margin-bottom: 2rem;
  letter-spacing: 2px;
  line-height: 1.2;
  text-transform: uppercase;
}

.contact-hero-content p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.8;
  margin-bottom: 3rem;
  font-weight: 400;
  opacity: 0.95;
}

/* Contact Form Section */
.contact-form-section {
  background: var(--bg-color);
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-info h3 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.contact-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-color);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.contact-item h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.contact-item p {
  color: var(--text-light);
  margin: 0;
}

.contact-form {
  background: var(--bg-light);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-color);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

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

/* Footer */
.footer {
  background: var(--primary-color);
  color: var(--bg-color);
  padding: 3rem 0 1rem;
}

.footer-content,
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.footer-logo i {
  color: var(--accent-color);
}

.footer-col h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-col ul li i {
  color: var(--accent-color);
}

.footer-col a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-col a:hover {
  color: var(--accent-color);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--accent-color);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* WhatsApp Float */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--bg-color);
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7);
  }
}

/* AOS Animations */
[data-aos] {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos].aos-animate {
  opacity: 1;
}

[data-aos="fade-up"] {
  transform: translateY(30px);
}

[data-aos="fade-up"].aos-animate {
  transform: translateY(0);
}

[data-aos="fade-right"] {
  transform: translateX(-30px);
}

[data-aos="fade-right"].aos-animate {
  transform: translateX(0);
}

[data-aos="fade-left"] {
  transform: translateX(30px);
}

[data-aos="fade-left"].aos-animate {
  transform: translateX(0);
}

/* Services Page Specific Styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(74, 21, 75, 0.98), rgba(41, 14, 40, 0.98));
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 0;
}

.nav-menu {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.page-header {
  position: relative;
  height: 50vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  margin-top: 70px;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
}

.page-title {
  position: relative;
  z-index: 2;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--bg-color);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.page-subtitle {
  position: relative;
  z-index: 2;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--bg-color);
  text-align: center;
  margin-top: 1rem;
}

.section-dark {
  background: var(--bg-color);
}

.section-light {
  position: relative;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.section-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
}

.section-light .container {
  position: relative;
  z-index: 2;
}

.grid {
  display: grid;
  gap: 2rem;
}

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

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

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

.service-detail-card {
  background: var(--bg-light);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.service-detail-card .service-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.service-detail-card h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.service-list {
  list-style: none;
  margin-top: 1.5rem;
}

.service-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-light);
}

.service-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.1rem);
  color: var(--text-light);
}

.process-card,
.industry-card {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.process-card:hover,
.industry-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.process-number {
  width: 60px;
  height: 60px;
  background: var(--accent-color);
  color: var(--bg-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 auto 1rem;
}

.process-card h3,
.industry-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.process-card p,
.industry-card p {
  color: var(--text-light);
}

.cta-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.cta-content .section-title {
  margin-bottom: 1rem;
}

.cta-content .section-subtitle {
  margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .contact-wrapper {
    gap: 3rem;
  }

  .carousel-btn {
    width: 45px;
    height: 45px;
  }

  /* Better carousel image handling on tablets */
  .carousel-item img {
    object-position: center center;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav,
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: linear-gradient(135deg, rgba(74, 21, 75, 0.98), rgba(41, 14, 40, 0.98));
    flex-direction: column;
    padding: 2rem;
    transition: left 0.3s ease;
    align-items: flex-start;
  }

  .nav.active,
  .nav-menu.active {
    left: 0;
  }

  .nav-link {
    font-size: 1.2rem;
    padding: 1rem 0;
    width: 100%;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .hero {
    height: 100vh;
    min-height: 600px;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .carousel-btn.prev {
    left: 10px;
  }

  .carousel-btn.next {
    right: 10px;
  }

  .section {
    padding: 3rem 0;
  }

  .products-grid,
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-hero {
    height: 80vh;
    background-attachment: scroll;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-form {
    padding: 2rem;
  }

  .footer-content,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-float {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    bottom: 20px;
    right: 20px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .header-content,
  .nav-container {
    padding: 1rem 0;
  }

  .logo {
    font-size: 1.2rem;
  }

  .logo i {
    font-size: 1.5rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .product-card,
  .service-card {
    padding: 1.5rem;
  }

  .btn {
    padding: 0.9rem 2rem;
    font-size: 0.9rem;
  }

  .btn-large {
    padding: 1rem 2.5rem;
    font-size: 1rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.9rem;
    font-size: 0.95rem;
  }

  .whatsapp-float {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
    bottom: 15px;
    right: 15px;
  }

  .service-detail-card {
    padding: 2rem;
  }

  .process-card,
  .industry-card {
    padding: 1.5rem;
  }

  /* Further optimize carousel for small mobile screens */
  .hero {
    min-height: 500px;
  }

  .carousel-item img {
    object-fit: cover;
    object-position: center 40%;
  }
}

/* Performance: Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .header,
  .whatsapp-float,
  .carousel-btn,
  .carousel-indicators {
    display: none;
  }
}
