/* General.css - Estilos globales optimizados */

/* Estilos base */
body {
  font-family: "Poppins", Arial, sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #f7f7f7;
  color: #333;
  overflow-x: hidden;
  font-size: clamp(14px, 1vw, 16px);
  height: 100%;
}

/* Encabezado rediseñado */
.header {
  background: linear-gradient(to right, #c71b6a, #c71b6a);
  color: white;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  padding: 0.5rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  height: auto;
  min-height: 70px;
  gap: 1rem;
}

/* Contenedor del logo - mejorado y como botón */
.header__logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  order: 1;
  flex: 1;
  min-width: 150px;
  max-width: 250px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.header__logo-container:hover {
  transform: scale(1.05);
}

.header__logo {
  width: clamp(60px, 8vw, 100px);
  height: clamp(60px, 8vw, 100px);
  transition: transform 0.3s ease;
  object-fit: contain;
}

.header__title {
  font-family: "Playfair Display", serif;
  font-size: clamp(1rem, 3vw, 2rem);
  font-weight: 700;
  background: linear-gradient(45deg, #fff, #e6e6e6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

/* Barra de búsqueda optimizada */
.header__search-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 2;
  order: 2;
  min-width: 200px;
  max-width: 500px;
  margin: 0 1rem;
}

.header__search-input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #ccc;
  border-radius: 25px;
  outline: none;
  font-size: clamp(14px, 1.5vw, 16px);
  transition: 0.3s ease-in-out;
}

.header__search-input:focus {
  border-color: #f4a261;
}

.header__search-button {
  background: #f4a261;
  border: none;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  margin-left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s ease;
}

.header__search-button .material-icons {
  color: white;
  font-size: 20px;
}

.header__search-button:hover {
  background: #e76f51;
}

/* Botón del menú hamburguesa (oculto por defecto) */
.header__menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  order: 4;
  padding: 0.5rem;
}

/* Navegación mejorada */
.header__nav {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  order: 3;
  flex: 1;
  justify-content: flex-end;
  min-width: 150px;
}

.header__nav-link {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  padding: 0.5em 0.8em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  border-radius: 5px;
}

.header__nav-link .material-icons {
  font-size: 22px;
}

.header__nav-link:hover {
  color: orange;
  background-color: #ff8c00;
  transform: translateY(-2px);
}

/* Menú de categorías - SEPARADO del encabezado */
.categories-nav {
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  background: #333;
  padding: 0.8rem;
  display: flex;
  justify-content: space-around;
  z-index: 999;
  flex-wrap: wrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border-top: 1px solid #444;
}

.category-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: clamp(0.8rem, 1vw, 1rem);
  border-radius: 4px;
}

.category-link:hover {
  background-color: #ff8c00;
  transform: translateY(-2px);
}

/* Contenedor principal ajustado */
.container {
  max-width: 1200px;
  margin: 8rem auto 1rem auto;
  padding: 1.5rem;
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

/* Pie de página optimizado */
.footer {
  background: #99bb2e;
  color: white;
  text-shadow: 1px 1px 2px #5a5a5a;
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.footer__info {
  flex: 1;
  min-width: 200px;
}

.footer__social {
  display: flex;
  gap: 1rem;
}

.footer__social-icon {
  width: 45px;
  height: 45px;
  transition: transform 0.3s ease;
}

.footer__social-icon:hover {
  transform: scale(1.15);
}

/* Media Queries para responsividad */
@media (max-width: 992px) {
  .header {
    padding: 0.5rem 1rem;
    min-height: 70px;
  }

  .header__logo {
    width: clamp(50px, 7vw, 80px);
    height: clamp(50px, 7vw, 80px);
  }

  .categories-nav {
    top: 70px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: row;
    padding: 0.5rem 1rem;
    min-height: 70px;
    gap: 0.5rem;
  }

  .header__logo-container {
    order: 1;
    flex: 1;
    max-width: none;
    justify-content: flex-start;
  }

  .header__search-container {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: 0.5rem 0;
  }

  .header__menu-toggle {
    display: block;
    order: 2;
  }

  .header__nav {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    background: #1a1a1a;
    margin-top: 0.5rem;
    padding: 1rem;
    border-radius: 5px;
  }

  .header__nav--active {
    display: flex;
  }

  .header__nav-link {
    width: 100%;
    padding: 0.8rem;
    flex-direction: row;
    justify-content: flex-start;
  }

  .categories-nav {
    position: static;
    margin-top: 0;
    padding: 0.5rem;
  }

  .container,
  #container-productos {
    padding-top: 20px;
  }
}

@media (max-width: 480px) {
  .header__title {
    font-size: 1.5rem;
  }

  .header__nav-link {
    padding: 0.6rem;
    font-size: 0.9rem;
  }

  .header__nav-link .material-icons {
    font-size: 20px;
  }

  .category-link {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .footer__social {
    justify-content: center;
  }
}

/* Asegurar box-sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* Estilos para el menú hamburguesa */
.header__menu-toggle {
  display: none; /* Oculto por defecto */
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0.5rem;
}
/* Ajustes para evitar que el menú hamburguesa se encime */
.menu-hamburguesa {
  position: fixed;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: #222;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1001; /* Mayor que el submenú */
}

.menu-hamburguesa.activo {
  transform: translateX(0);
}

.menu-hamburguesa ul {
  list-style: none;
  padding: 20px;
}

.menu-hamburguesa ul li {
  padding: 10px 0;
  text-align: left;
}

.menu-hamburguesa ul li a {
  text-decoration: none;
  color: white;
  font-size: 16px;
  display: block;
  padding: 10px;
  transition: 0.3s;
}

.menu-hamburguesa ul li a:hover {
  background: #f4a261;
  color: white;
}

/* Evita que el menú hamburguesa quede oculto debajo del submenú */
@media (max-width: 1357px) {
  .menu-hamburguesa {
    top: 0;
  }

  .header__menu-toggle {
    display: block;
  }

  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1a1a1a;
    flex-direction: column;
    padding: 1rem;
  }

  .header__nav--active {
    display: flex;
  }

  .header__nav-link {
    width: 100%;
    padding: 0.8rem;
    border-bottom: 1px solid #333;
  }
}

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

.bubbles-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.bubble {
  position: absolute;
  bottom: -10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: float linear infinite;
  opacity: 0.6;
  filter: blur(1px);
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0.6;
    bottom: -10px;
  }
  100% {
    transform: translateY(-100vh) translateX(20px) rotate(180deg);
    opacity: 0;
    bottom: 100%;
  }
}

.preloader__logo {
  width: 150px;
  height: auto;
  animation: pulse 1.5s infinite ease-in-out;
  z-index: 2;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.2));
}
