/*
            Professional Mode CSS:
            Impeccably structured, clean, highly optimized, and robust.
            Adheres to modern web design best practices for aesthetics and maintainability.
        */

/* --- CSS Variables (Color Palette Mastery) --- */
:root {
  --color-primary: #003366;
  /* Deep Blue for trust/navigation */
  --color-secondary: #c00000;
  /* Vibrant Strategic Red for CTAs */
  --color-text-dark: #333333;
  --color-text-light: #555555;
  --color-background-light: #f8f8f8;
  /* Light grey */
  --color-background-white: #ffffff;
  --color-border: #dddddd;
  --color-hover-blue: #0055aa;
  --color-hover-red: #e03333;

  --font-heading: "Montserrat", sans-serif;
  --font-body: "Lato", sans-serif;
  --font-alt: "Open Sans", sans-serif;

  --max-width-desktop: 1200px;
  --padding-section: 60px;
  --border-radius-default: 8px;
  --transition-speed: 0.3s ease-in-out;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* Base font size for better responsiveness with rem */
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--color-text-light);
  background-color: var(--color-background-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--color-secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  /* Removes extra space below images */
}

ul {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--color-text-dark);
  line-height: 1.2;
  margin-bottom: 0.8em;
}

h1 {
  font-size: 2.8rem;
  font-weight: 900;
}

h2 {
  font-size: 2.2rem;
  font-weight: 700;
}

h3 {
  font-size: 1.7rem;
  font-weight: 700;
}

h4 {
  font-size: 1.4rem;
  font-weight: 700;
}

p {
  margin-bottom: 1em;
}

/* --- Utility Classes --- */
.container {
  max-width: var(--max-width-desktop);
  margin: 0 auto;
  padding: 0 20px;
}

.section-padding {
  padding: var(--padding-section) 0;
}

.bg-light-grey {
  background-color: var(--color-background-light);
}

.text-center {
  text-align: center;
}

/* --- Buttons (CTAs) --- */
.btn {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 50px;
  /* Pill shape */
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition-speed),
    color var(--transition-speed), transform 0.2s ease;
}

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

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

.btn-primary:hover {
  background-color: var(--color-hover-blue);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-background-white);
}

.btn-secondary:hover {
  background-color: var(--color-hover-red);
}

/* --- Header & Navigation --- */
.main-header {
  background-color: var(--color-background-white);
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo img {
  height: 40px;
  /* Adjust as needed */
  width: auto;
}

.main-nav .nav-list {
  display: flex;
  gap: 25px;
}

.main-nav .nav-list a {
  color: var(--color-text-dark);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  padding: 5px 0;
}

.main-nav .nav-list a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-secondary);
  transition: width var(--transition-speed);
}

.main-nav .nav-list a:hover::after,
.main-nav .nav-list a.active::after {
  width: 100%;
}

/* Submenu */
.main-nav .has-submenu {
  position: relative;
}

.main-nav .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-background-white);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius-default);
  min-width: 200px;
  padding: 10px 0;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition-speed),
    transform var(--transition-speed);
}

.main-nav .has-submenu:hover .submenu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.main-nav .submenu li a {
  padding: 10px 20px;
  display: block;
  white-space: nowrap;
  font-weight: 400;
  color: var(--color-text-light);
}

.main-nav .submenu li a:hover {
  background-color: var(--color-background-light);
  color: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.language-switcher {
  display: flex;
  gap: 5px;
}

.lang-btn {
  background-color: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  padding: 8px 12px;
  border-radius: var(--border-radius-default);
  font-family: var(--font-alt);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-speed),
    color var(--transition-speed);
}

.lang-btn.active,
.lang-btn:hover {
  background-color: var(--color-primary);
  color: var(--color-background-white);
}

.hamburger {
  display: none;
  /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--transition-speed),
    opacity var(--transition-speed);
}

/* Mobile Nav Open State */
.main-nav.nav-open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-background-white);
  padding-top: 80px;
  overflow-y: auto;
  z-index: 999;
  align-items: center;
  justify-content: flex-start;
  transform: translateX(100%);
  transition: transform 0.4s ease-out;
}

.main-nav.nav-open .nav-list {
  flex-direction: column;
  width: 100%;
  padding: 20px;
  align-items: center;
  gap: 15px;
}

.main-nav.nav-open .nav-list li {
  width: 100%;
  text-align: center;
}

.main-nav.nav-open .nav-list a {
  display: block;
  padding: 15px 0;
  font-size: 1.2rem;
  color: var(--color-text-dark);
}

.main-nav.nav-open .submenu {
  position: static;
  display: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  min-width: unset;
  background-color: var(--color-background-light);
  transform: none;
  opacity: 1;
  visibility: visible;
  width: 100%;
  margin-top: 5px;
}

.main-nav.nav-open .has-submenu.open .submenu {
  display: block;
}

.main-nav.nav-open .submenu li a {
  padding: 10px;
  font-size: 1rem;
}

/* Hamburger animation on open */
.hamburger.is-active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* --- Hero Section --- */
.hero-section {
  position: relative;
  height: 70vh;
  /* Responsive height */
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-background-white);
  text-align: center;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.55);
  /* Dark overlay */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.hero-content {
  max-width: 800px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 15px;
  color: var(--color-background-white);
}

.hero-subtitle {
  font-size: 1.4rem;
  font-family: var(--font-alt);
  margin-bottom: 25px;
  color: var(--color-background-white);
}

.since-year {
  font-size: 1.1rem;
  font-weight: 700;
  background-color: var(--color-secondary);
  display: inline-block;
  padding: 8px 15px;
  border-radius: var(--border-radius-default);
  margin-bottom: 30px;
}

.segment-selector {
  margin-top: 30px;
}

.segment-selector p {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--color-background-white);
}

.segment-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  /* Allow wrapping on smaller screens */
}

/* --- About Section --- */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

.about-section .content-grid {
  grid-template-columns: 1fr 1fr;
}

.about-section .text-content {
  padding-right: 20px;
}

.about-section .section-title {
  color: var(--color-primary);
}

.image-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  border-radius: var(--border-radius-default);
  overflow: hidden;
}

.image-gallery img {
  border-radius: var(--border-radius-default);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Specific image sizes for a balanced gallery */
.image-gallery img:first-child {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  height: 100%;
  object-fit: cover;
}

.image-gallery img:nth-child(2) {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  height: 100%;
  object-fit: cover;
}

.image-gallery img:nth-child(3) {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  height: 100%;
  object-fit: cover;
}

/* --- Products Section --- */
.products-section .section-title {
  margin-bottom: 50px;
}

.product-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  /* Default to responsive */
  gap: 30px;
  margin-top: 30px;
  perspective: 1000px;
  width: 100%;
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Scoped Flipping Card Effect for grids */
.product-grid .product-card {
  background-color: transparent;
  /* The card itself is a container */
  height: 380px;
  /* Fixed height */
  border: none;
  box-shadow: none;
  cursor: pointer;
  padding: 0;
  /* Reset padding for the container */
  display: block;
  /* Override flex properties */
  min-height: auto;
  /* Reset min-height */
}

.product-grid .card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.product-grid .product-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.product-grid .card-front,
.product-grid .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--border-radius-default);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
}

.product-grid .card-front {
  background-color: var(--color-background-white);
}

.product-grid .card-back {
  background-color: var(--color-primary);
  color: white;
  transform: rotateY(180deg);
  justify-content: center;
  padding: 30px;
}

.product-grid .card-back h4 {
  color: white;
}

.product-grid .card-back p {
  font-size: 0.9rem;
}

.product-grid .product-card img {
  width: 100%;
  height: 180px;
  /* Fixed height for images */
  object-fit: contain;
  /* Ensure entire image is visible */
  margin-bottom: 20px;
  /* Slightly reduced margin */
  padding: 0;
  /* Reset padding */
  border-radius: 0;
  /* Reset border-radius */
}

.product-grid .product-card h4 {
  color: var(--color-primary);
  margin-bottom: 15px;
  font-size: 1.2rem;
  /* Adjusted font size */
}

.product-grid .product-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
  /* Remove margin for better fit */
  flex-grow: 0;
  /* Reset flex-grow */
}

.product-grid .product-card:hover {
  transform: none;
  /* Disable hover effect on the container */
  box-shadow: none;
}

.product-grid .card-front:hover,
.product-grid .card-back:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  /* Apply hover effect to faces */
}

/* Static Product Card (for category pages like automotriz.html) */
.product-categories .product-card {
  background-color: var(--color-background-white);
  border-radius: var(--border-radius-default);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  padding: 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition: transform var(--transition-speed),
    box-shadow var(--transition-speed);
  min-height: 380px;
}

.product-categories .product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-categories .product-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: var(--border-radius-default);
  margin-bottom: 20px;
  padding: 10px;
}

.product-categories .product-card h3 {
  color: var(--color-primary);
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.product-categories .product-card p {
  font-size: 0.95rem;
  margin-bottom: 25px;
  flex-grow: 1;
}

/* --- Services Section --- */
.services-section .section-title {
  margin-bottom: 50px;
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.service-card {
  background-color: var(--color-background-white);
  border-radius: var(--border-radius-default);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  padding: 30px;
  text-align: center;
  transition: transform var(--transition-speed),
    box-shadow var(--transition-speed);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.service-card h3 {
  color: var(--color-primary);
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.service-card p {
  font-size: 0.95rem;
}

/* --- Brands Section (Carousel concept) --- */
.brands-section .section-title {
  margin-bottom: 50px;
}

.brands-carousel {
  display: flex;
  flex-wrap: wrap;
  /* Allows wrapping on smaller screens */
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 20px;
  background-color: var(--color-background-white);
  border-radius: var(--border-radius-default);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.brands-carousel img {
  max-width: 120px;
  height: auto;
  filter: grayscale(80%);
  /* Subtle desaturation */
  opacity: 0.7;
  transition: filter var(--transition-speed),
    opacity var(--transition-speed);
}

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

.brands-carousel video {
  max-width: 120px;
  height: auto;
  filter: grayscale(80%);
  /* Subtle desaturation */
  opacity: 0.7;
  transition: filter var(--transition-speed),
    opacity var(--transition-speed);
}

.brands-carousel video:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* --- Branches Section (Google Maps) --- */
.branches-section .section-title {
  margin-bottom: 20px;
}

.branches-section .text-center {
  margin-bottom: 40px;
}

.map-container {
  height: 450px;
  width: 100%;
  background-color: var(--color-border);
  border-radius: var(--border-radius-default);
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

#map {
  height: 100%;
  width: 100%;
}

.branch-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.branch-item {
  background-color: var(--color-background-white);
  padding: 25px;
  border-radius: var(--border-radius-default);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--color-primary);
}

.branch-item h3 {
  color: var(--color-primary);
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.branch-item p {
  font-size: 0.95rem;
  margin-bottom: 5px;
}

/* --- Contact Section --- */
.contact-section .content-grid {
  grid-template-columns: 1fr 1.5fr;
  align-items: flex-start;
}

.contact-info {
  padding-right: 30px;
}

.contact-info .section-title {
  color: var(--color-primary);
}

.contact-info p {
  margin-bottom: 10px;
  font-family: var(--font-alt);
  font-size: 1rem;
}

.contact-info p strong {
  color: var(--color-text-dark);
}

.social-links {
  margin-top: 25px;
  display: flex;
  gap: 15px;
}

.social-links img {
  width: 30px;
  height: 30px;
  transition: transform 0.2s ease;
}

.social-links img:hover {
  transform: translateY(-3px);
}

.contact-form-container {
  background-color: var(--color-background-light);
  padding: 40px;
  border-radius: var(--border-radius-default);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-text-dark);
  font-family: var(--font-alt);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-default);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition-speed),
    box-shadow var(--transition-speed);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
  /* Primary color with alpha */
  outline: none;
}

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

select {
  appearance: none;
  /* Remove default arrow */
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23003366%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13.6-6.4H18.9c-5%200-9.4%201.8-13.6%206.4-4.2%204.6-6.4%2010.2-6.4%2016.9%200%206.7%202.2%2012.3%206.4%2016.9l128%20127.9c4.2%204.6%209.7%206.9%2015.6%206.9s11.4-2.3%2015.6-6.9l128-127.9c4.2-4.6%206.4-10.2%206.4-16.9%200-6.7-2.2-12.3-6.4-16.9z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 35px;
}

/* --- Footer --- */
.main-footer {
  background-color: var(--color-primary);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--padding-section) 0 30px;
  font-family: var(--font-alt);
}

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

.footer-col h3 {
  color: var(--color-background-white);
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: 700;
}

.footer-about .footer-logo img {
  height: 50px;
  margin-bottom: 15px;
}

.footer-about p {
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.footer-col ul {
  padding-left: 0;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-col ul li a:hover {
  color: var(--color-background-white);
}

.footer-about .social-links a {
  color: rgba(255, 255, 255, 0.7);
}

.footer-about .social-links a:hover {
  color: var(--color-background-white);
}

.footer-contact-info p {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.footer-contact-info a {
  color: rgba(255, 255, 255, 0.7);
}

.footer-contact-info a:hover {
  color: var(--color-background-white);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
}

/* --- WhatsApp Button --- */
.whatsapp-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #25d366;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.whatsapp-button:hover {
  transform: translateY(-5px);
  background-color: #1da851;
}

.whatsapp-button img {
  width: 35px;
  height: 35px;
}

/* --- Responsive Design (Mobile-First, Adaptive) --- */
@media (max-width: 992px) {
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    height: 100vh;
    background-color: var(--color-background-white);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    padding: 80px 20px 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
  }

  .main-nav.nav-open {
    transform: translateX(0);
  }

  .main-nav .nav-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .main-nav .nav-list li {
    margin-left: 0;
  }

  .main-nav .nav-list a {
    color: var(--color-text-dark);
    font-size: 1.1rem;
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
  }

  /* Mobile Submenu Styles */
  .main-nav .submenu {
    position: static;
    box-shadow: none;
    padding: 0 0 0 20px;
    background-color: transparent;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: none;
    /* Hidden by default */
    min-width: auto;
  }

  .main-nav .has-submenu.open .submenu {
    display: block;
    /* Show when open */
  }

  .main-nav .submenu li a {
    font-size: 1rem;
    padding: 8px 0;
    border-bottom: none;
    color: var(--color-text-light);
  }

  .main-nav .header-actions {
    /* Keep actions visible in header, not inside nav */
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1001;
  }

  .hamburger {
    display: flex;
    z-index: 1002;
    /* Above nav */
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .segment-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .segment-buttons .btn {
    width: 100%;
    max-width: 300px;
  }

  .about-section .content-grid {
    grid-template-columns: 1fr;
    /* Stack on mobile */
  }

  .about-section .text-content {
    padding-right: 0;
  }

  .image-gallery {
    grid-template-columns: 1fr;
    /* Single column for images */
  }

  .image-gallery img:first-child,
  .image-gallery img:nth-child(2),
  .image-gallery img:nth-child(3) {
    grid-column: auto;
    grid-row: auto;
    height: auto;
  }

  .product-categories,
  .service-cards {
    grid-template-columns: 1fr;
    /* Single column */
  }

  .contact-section .content-grid {
    grid-template-columns: 1fr;
    /* Stack contact info and form */
  }

  .contact-info {
    padding-right: 0;
    margin-bottom: 30px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    /* Stack footer columns */
    text-align: center;
  }

  .footer-col.footer-about .social-links {
    justify-content: center;
  }

  .footer-col ul {
    padding-left: 0;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  h3 {
    font-size: 1.4rem;
  }

  .section-padding {
    padding: 40px 0;
  }

  .whatsapp-button {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
  }

  .whatsapp-button img {
    width: 30px;
    height: 30px;
  }

  .header-content {
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-content .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .product-card,
  .service-card,
  .branch-item {
    padding: 20px;
  }

  .contact-form-container {
    padding: 30px 20px;
  }

  .logo img {
    height: 35px;
  }

  .main-header {
    padding: 10px 0;
  }

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

/* --- IMLAR Catalog Modal --- */
.modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  /* Stay in place */
  z-index: 1001;
  /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  /* Full width */
  height: 100%;
  /* Full height */
  overflow: auto;
  /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.6);
  /* Black w/ opacity */
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 1400px;
  border-radius: var(--border-radius-default);
  position: relative;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  perspective: 1000px;
  justify-content: center;
  /* Centrar items si no llenan el ancho */
  justify-items: center;
  /* Centrar el contenido de cada celda */
}

.catalog-item-card {
  height: 400px;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  cursor: pointer;
}

.catalog-item-card.flipped {
  transform: rotateY(180deg);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--border-radius-default);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.card-front {
  background-color: var(--color-background-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.card-front img {
  max-height: 150px;
  margin-bottom: 15px;
}

.card-front h4 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.card-back {
  background-color: var(--color-primary);
  color: white;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
}

.card-back h4 {
  color: white;
}

.catalog-marketing {
  text-align: center;
  margin-top: 40px;
}

.catalog-marketing p {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
}

.catalog-marketing video {
  margin-top: 20px;
  max-width: 150px;
  display: inline-block;
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    padding: 20px;
  }

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

  .catalog-item-card {
    height: 350px;
  }

  .card-back {
    padding: 20px;
  }
}

/* --- HOTFIX FOR CARD FLIPPING --- */
.product-card.flipped .card-inner {
  transform: rotateY(180deg) !important;
}

.whatsapp-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  font-size: 35px;
  /* Size of the icon */
}

.whatsapp-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.whatsapp-button i {
  margin-top: 2px;
  /* Slight adjustment for visual centering */
}