body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background: #f1efef;
  overflow-x: hidden; /* evita scroll horizontal */
}

/* Layout principal */
.parent {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 30px 150px 0px 0px;
  gap: 10px;
}

/* Barra superior */
.div1 {
  grid-column: 1 / -1; /* ocupar todas las columnas del grid */
  width: 100vw;
  background-color: black;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-left: calc(50% - 50vw); /* Centra y extiende el ancho más allá del contenedor padre */
}

.telegram-icon, .whatsapp-icon {
  font-size: 24px;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.telegram-icon { color: #00bfff; }
.whatsapp-icon { color: #25D366; }
.telegram-icon:hover, .whatsapp-icon:hover {
  transform: scale(1.3);
}

/* Logo */
.div2 {
  grid-row-start: 2;
  display: flex;
  justify-content: center;
}
.logo {
  width: 210px;
  height: 210px;
  object-fit: contain;
}

/* Buscador */
.div3 {
  grid-column: span 2;
  grid-row-start: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}
.search-container {
  position: relative;
  width: 100%;
  max-width: 450px;
}
.search-input {
  width: 100%;
  height: 40px;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1.2rem;
  color: #888;
}

/* Menú */
.div4 {
  grid-column-start: 4;
  grid-row-start: 2;
  display: flex;
  justify-content: center;
}
.dropdown {
  position: relative;
}
.dropbtn {
  background-color: #000;
  color: white;
  width: 250px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.arrow {
  margin-left: 10px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid white;
}
.dropdown-content {
  display: none;
  position: absolute;
  top: 20%;
  left: 0;
  background-color: #333;
  min-width: 250px;
  border-radius: 4px;
  z-index: 1;
}
.dropdown-content a {
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  display: block;
}
.dropdown-content a:hover {
  background-color: #555;
}
.dropdown:hover .dropdown-content {
  display: block;
}

/* Líneas */
.linea-divisoria,
.linea-divisoria1 {
  border-bottom: 2px solid #ccc;
  margin: 0 10px;
}
.linea-divisoria { grid-row-start: 3; grid-column: span 4; }
.linea-divisoria1 { grid-row-start: 4; grid-column: span 4; }

/* Productos grid adaptativo */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}

/* Tarjetas de producto */
.link-div {
  text-decoration: none;
  color: inherit;
}
.producto {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 40px 30px -20px rgba(0, 0, 0, 0.35);
  text-align: center;
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%; /* fuerza igual altura */
}
.producto:hover {
  transform: translateY(-5px);
}
.imagen-contenedor {
  width: 100%;
  height: 300px;
  overflow: hidden;
  flex-shrink: 0;
}
.producto1 {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.producto1:hover {
  transform: scale(1.2);
}
.nombre-producto {
  margin: 8px 0 4px 0;
  font-size: 1rem;
  font-weight: bold;
}
.precio-producto {
  color: #4db5cb;
  margin: 10px 0;
  margin-top: auto; /* empuja hacia abajo si hay espacio */
}

/* Responsive */
@media (max-width: 1100px) {
  .div1 {
    grid-column: 1 / -1;
    width: 100vw;
    margin-left: calc(50% - 50vw);
  }

  .parent {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 30px 75px 75px 0px 0px;
    gap: 10px;
  }

  .div1 {
    grid-column: span 6;
  }

  .div2 {
    grid-column-start: span 2;
    grid-row-start: span 2;
  }

  .div3 {
    grid-column-start: 3;
    grid-column-end: span 2;
    grid-row-start: 2; /* buscador arriba */
    height: fit-content;
  }

.div4 {
    grid-column-start: 3;
    grid-column-end: span 2;
    grid-row-start: 3; /* menú abajo */

  }

  .dropdown-content {
    top: 30%;
  }

  .linea-divisoria {
    grid-row-start: 4;
    grid-column: span 6;
  }

  .linea-divisoria1 {
    grid-row-start: 5;
    grid-column: span 6;
  }
}

@media (max-width: 790px) {
    .parent {
        display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }
  .parent > * {
      width: 100%;
      max-width: 790px;
    }
    .div1 {
      grid-column: 1 / -1;
      width: 100vw;
      margin-left: calc(50% - 50vw);
    }
  .div2 { height: 150px; }
  .div3 { margin-left: -30px; }
}
