:root {
  --primary-color: #004aad;
  --secondary-color: #ffffff;
  --accent-color: #ff5a5f;
  --glass-color: rgba(255, 255, 255, 0.85);
  --font-family: "Montserrat", sans-serif;
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --border-glass: 1px solid rgba(0, 0, 0, 0.08);
}

/* ===========================
   HEADER GENERAL
=========================== */
header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(15px);
  background: var(--glass-color);
  box-shadow: var(--shadow);
  border-bottom: var(--border-glass);
  font-family: var(--font-family);
}

.top-row,
.bottom-row {
  max-width: 1400px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 30px;
}

/* ===========================
   LOGO
=========================== */
.logo img {
  height: 62px;
  transition: transform 0.3s ease;
  cursor: pointer;
}
.logo img:hover {
  transform: scale(1.05);
}

/* ===========================
   ICONOS DE ACCIONES
=========================== */
.actions {
  display: flex;
  gap: 20px;
  align-items: center;
}
.actions a {
  color: #333;
  font-size: 22px;
  transition: transform 0.3s ease, color 0.3s ease;
}
.actions a:hover {
  color: var(--primary-color);
  transform: scale(1.2);
}

/* ===========================
   MENÚ PRINCIPAL (desktop)
=========================== */
nav ul {
  list-style: none;
  display: flex;
  gap: 40px;
  position: relative;
  padding: 0;
  margin: 0;
}
nav ul li {
  position: relative;
}
nav ul li a {
  position: relative;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 12px 4px;
  transition: color 0.3s ease;
}
nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--primary-color);
  transition: all 0.3s ease;
  border-radius: 2px;
  transform: translateX(-50%);
}
nav ul li a:hover::after {
  width: 100%;
}
nav ul li:hover > a {
  color: var(--primary-color);
}

/* ===========================
   DROPDOWN DE CATEGORÍAS
=========================== */
.dropdown {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  background: var(--secondary-color);
  padding: 20px;
  box-shadow: var(--shadow);
  border-radius: 12px;
  min-width: 500px;
  z-index: 999;
}
.categories-toggle:hover .dropdown,
.categories-toggle.open .dropdown {
  display: block;
}

/* Oculta el enlace “Categorias” innecesario */
#dropdown-categorias > li > a {
  display: none !important;
}

/* Submenú que contiene las categorías */
#dropdown-categorias > li > ul.sub-menu {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px;
  padding: 0;
  margin: 0;
  list-style: none;
  background: transparent;
  box-shadow: none;
}

#dropdown-categorias > li > ul.sub-menu > li {
  list-style: none;
  text-align: center;
}
#dropdown-categorias > li > ul.sub-menu > li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  color: #004a7c;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
}
#dropdown-categorias > li > ul.sub-menu > li a:hover {
  color: var(--accent-color);
  transform: translateY(-2px);
}
#dropdown-categorias > li > ul.sub-menu > li a::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Iconos de categorías */
#dropdown-categorias li.cat-construccion a::before {
  background-image: url("https://peachpuff-salmon-747109.hostingersite.com/wp-content/uploads/2025/07/Recurso-construccion.png");
}
#dropdown-categorias li.cat-corte a::before {
  background-image: url("https://peachpuff-salmon-747109.hostingersite.com/wp-content/uploads/2025/07/Recurso-corte.png");
}
#dropdown-categorias li.cat-energia a::before {
  background-image: url("https://peachpuff-salmon-747109.hostingersite.com/wp-content/uploads/2025/07/Recurso-energia.png");
}
#dropdown-categorias li.cat-fumigacion a::before {
  background-image: url("https://peachpuff-salmon-747109.hostingersite.com/wp-content/uploads/2025/07/Recurso-fumigacion.png");
}
#dropdown-categorias li.cat-potencia a::before {
  background-image: url("https://peachpuff-salmon-747109.hostingersite.com/wp-content/uploads/2025/07/Recurso-potencia.png");
}
#dropdown-categorias li.cat-riego a::before {
  background-image: url("https://peachpuff-salmon-747109.hostingersite.com/wp-content/uploads/2025/07/Recurso-Riego.png");
}
#dropdown-categorias li.cat-siembra a::before {
  background-image: url("https://peachpuff-salmon-747109.hostingersite.com/wp-content/uploads/2025/07/Recurso-siembra.png");
}
#dropdown-categorias li.cat-repuestos a::before {
  background-image: url("https://peachpuff-salmon-747109.hostingersite.com/wp-content/uploads/2025/07/Recurso_Repuesto-150x150.png");
}

/* ===========================
   BUSCADOR
=========================== */
.search-container {
  flex: 1;
  max-width: 500px;
  position: relative;
}
.search-container input {
  width: 100%;
  padding: 12px 20px;
  border-radius: 50px;
  border: none;
  outline: none;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease;
}
.search-container input:focus {
  box-shadow: 0 0 15px rgba(0, 74, 173, 0.4);
}

/* ===========================
   BOTONES RESPONSIVE
=========================== */
.menu-toggle,
.menu-close {
  display: none;
  font-size: 26px;
  cursor: pointer;
  color: var(--primary-color);
}

/* ===========================
   BOTÓN WHATSAPP
=========================== */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #25d366;
  color: white;
  border-radius: 50%;
  padding: 15px;
  box-shadow: var(--shadow);
  font-size: 28px;
  z-index: 9999;
  transition: transform 0.3s ease;
}
.whatsapp-float:hover {
  transform: scale(1.15);
}

/* ===========================
   RESPONSIVE
=========================== */
.desktop-only {
  display: block;
}
.mobile-only {
  display: none;
}

@media (max-width: 992px) {
  nav ul {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 80px 20px 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease-in-out;
    z-index: 9999;
    overflow-y: auto;
  }
  nav ul.active {
    left: 0;
  }

  nav ul li {
    width: 100%;
    margin: 15px 0;
  }

  nav ul li a {
    font-size: 18px;
    display: block;
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
  }

  .menu-toggle {
    display: block;
  }
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: block;
    width: 100%;
    margin-bottom: 30px;
  }
  .mobile-only input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 50px;
    border: none;
    outline: none;
    box-shadow: var(--shadow);
  }

  .menu-close {
    display: block;
    font-size: 26px;
    color: #333;
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
  }

  .top-row {
    padding: 10px 20px;
  }

  .categories-toggle .dropdown {
    display: none;
    position: relative;
    background: #f9f9f9;
    box-shadow: none;
    border-radius: 8px;
    padding: 15px;
    width: 100%;
    margin-top: 10px;
  }
  .categories-toggle.open .dropdown {
    display: block;
  }

  #dropdown-categorias > li > ul.sub-menu {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  #dropdown-categorias > li > ul.sub-menu > li a::before {
    width: 50px;
    height: 50px;
  }
}