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

html, body {
  font-family: sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 2rem;
  background: #ffffff;
}

/* Footer */
footer {
  background: #141414;
  color: white;
  text-align: center;
  padding: 1rem;
}

/* Logo */
.LogoPrincipalFerreMax{
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Navbar */
.ContenedorNavBar {
  position: relative;
  z-index: 100;
}

.navbar {
  background-color: #003366 !important;
  box-shadow: none;
  min-height: 70px;
  position: relative;
  z-index: 101;
}

/* Franja de categorías */
.menu-categorias {
  background: #003366;
  padding: 0;
  margin: 0;
}

.categorias-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0 2rem;
}

.categoria-item {
  position: relative;
}

.categoria-link {
  display: block;
  color: #fff;
  padding: 1rem 2rem;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.categoria-link:hover,
.categoria-item.show .categoria-link {
  color: #fff238;
  background: #fff;
}

/* Mega menú */
.megamenu .dropdown-menu {
  width: auto;
  min-width: 600px;
  max-width: 95vw;
  left: 0;
  right: auto;
  top: 100%;
  border-radius: 0;
  border-top: 2px solid #ffec3d;
  padding: 2rem 2rem;
  display: none;
  position: absolute;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1050;
  overflow-x: auto;
}

/* Si el menú se acerca al borde derecho, ajústalo */
.categoria-item.megamenu:last-child .dropdown-menu {
  right: 0;
  left: auto;
}

.megamenu.show .dropdown-menu {
  display: block;
}

.megamenu .dropdown-item {
  color: #003366;
  padding: 0.25rem 0;
}

.megamenu h6 {
  color: #fff238;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

/* Responsive: oculta el mega menú en móvil */
@media (max-width: 991.98px) {
  .megamenu .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    padding: 1rem 0.5rem;
  }
  .categorias-list {
    flex-direction: column;
  }
  .categoria-link {
    padding: 1rem;
  }
}

/* Botón flotante de WhatsApp */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  background: #000000;
  border-radius: 50%;
  padding: 0.7rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.whatsapp-float:hover {
  background: #fafafa;
}

.whatsapp-icon {
  width: 38px;
  height: 38px;
  display: block;
}

.boton-carrito-ferremax {
    background: linear-gradient(135deg, #1f3c88, #16306d);
    color: #ffffff;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.boton-carrito-ferremax:hover {
    background: linear-gradient(135deg, #ffcc00, #e6b800);
    color: #1f3c88;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.boton-carrito-ferremax:active {
    transform: scale(0.97);
}

/* ===============================
   BOTÓN AGREGAR AL CARRITO
=================================*/

.boton-agregar-ferremax {
    background: linear-gradient(135deg, #1f3c88, #16306d);
    color: #ffffff;
    border: none;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.boton-agregar-ferremax:hover {
    background: linear-gradient(135deg, #ffcc00, #e6b800);
    color: #1f3c88;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.boton-agregar-ferremax:active {
    transform: scale(0.96);
}

.icono-btn {
    font-size: 18px;
}

/* ===============================
   BOTÓN CARRITO NAVBAR
=================================*/

.btn-carrito-navbar {
    background-color: #ffcc00;
    color: #003366;
    padding: 6px 18px;
    border-radius: 30px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-carrito-navbar:hover {
    background-color: #ffffff;
    color: #003366;
}

.badge-carrito {
    background-color: #003366;
    color: #ffffff;
    font-size: 12px;
    padding: 3px 7px;
    border-radius: 50%;
    font-weight: bold;
}

/* ===============================
   BOTÓN ELIMINAR (BASURITA)
=================================*/

.btn-eliminar {
    background: #f8d7da;
    border: none;
    color: #842029;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
}

.btn-eliminar:hover {
    background: #dc3545;
    color: #ffffff;
    transform: scale(1.1);
}

/* ===============================
   BOTÓN VACIAR CARRITO
=================================*/

.boton-vaciar {
    margin-top: 15px;
    background: transparent;
    border: 2px solid #003366;
    color: #003366;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s ease;
}

.boton-vaciar:hover {
    background: #003366;
    color: #ffffff;
}

/* ===============================
   HERO CON IMAGEN
=================================*/

.hero {
  position: relative;
  height: 500px;
  background: url("/Images/SeñorContruccion.jpg") center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 51, 102, 0.75);
}

.hero-content {
  position: relative;
  color: white;
  max-width: 800px;
  padding: 20px;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.btn-hero {
  background: #ffcc00;
  color: #003366;
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s ease;
}

.btn-hero:hover {
  background: white;
}

/* ===============================
   SECCIONES GENERALES
=================================*/

.seccion {
  padding: 60px 20px;
  text-align: center;
}

.fondo-claro {
  background: #f4f6f9;
}

.titulo-seccion {
  margin-bottom: 40px;
  font-weight: bold;
  color: #003366;
}

/* ===============================
   PRODUCTOS HOME
=================================*/

.grid-productos-home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.card-producto-home {
  background: white;
  padding: 30px 20px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transition: 0.3s ease;
}

.card-producto-home:hover {
  transform: translateY(-5px);
}

.precio-home {
  font-weight: bold;
  color: #003366;
}

.btn-ver {
  display: inline-block;
  margin-top: 10px;
  background: #003366;
  color: white;
  padding: 8px 18px;
  border-radius: 6px;
  text-decoration: none;
}

.btn-ver:hover {
  background: #ffcc00;
  color: #003366;
}

/* ===============================
   FUNCIONAMIENTO
=================================*/

.grid-funcionamiento {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.paso span {
  display: inline-block;
  background: #003366;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  line-height: 40px;
  margin-bottom: 10px;
  font-weight: bold;
}

/* ===============================
   CTA FINAL
=================================*/

.cta-final {
  background: #003366;
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.btn-cta {
  background: #ffcc00;
  color: #003366;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: 0.3s ease;
}

.btn-cta:hover {
  background: white;
}

@media (max-width: 991.98px) {

  .btn-carrito-navbar {
      font-size: 14px;
      padding: 6px 12px;
  }

}

@media (max-width: 991.98px) {

  .btn-carrito-navbar {
      top: 18px;
      right: 15px;
  }

}