/* Reset mínimo */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #222;
  background: #fff;
} 

/* Variables de layout (ajusta si cambian alturas) */
:root {
  --topbar-h: 32px;
  --header-h: 72px;
  --tiza: #fdfcf7;
}

/* Top bar fijo con fade */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #222;
  color: #fff;
  padding: 6px 16px;
  font-size: 14px;
  z-index: 1000;
  transition: opacity 0.4s ease;
}
.topbar .left { flex: 2; }
.topbar .right { flex: 1; text-align: right; }
.topbar a { color: #fff; text-decoration: none; margin-left: 8px; }
.topbar a:hover { text-decoration: underline; }
.topbar.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Header fijo, transparente al inicio, tiza al scrollear */
.header {
  position: fixed;
  top: var(--topbar-h); /* debajo del topbar */
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 12px 5%;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, top 0.3s ease;
  z-index: 999;
}
.header.scrolled {
  top: 0; /* se pega arriba */
  background: var(--tiza);
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Logo y menú pegados con separación */
.logo {
  font-weight: 700;
  margin-right: 24px; /* separación respecto al menú */
}
.logo img {
  height: 48px;
  width: auto;
  display: block;
}
.nav {
  display: flex;
  gap: 14px;
  list-style: none;   /* 🔹 elimina los puntos */
  margin: 0;          /* 🔹 quita margen por defecto */
  padding: 0;         /* 🔹 quita padding por defecto */
}
.nav a {
  text-decoration: none;
  color: #222;
  padding: 6px 8px;
  border-radius: 6px;
}
.nav a:hover { background: #f4f4f4; }

/* Carrusel full screen detrás de topbar/header */
.carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100vh; /* ocupa toda la pantalla */
}
.slides { display: flex; transition: transform 300ms ease; height: 100%; }
.slide { min-width: 100%; height: 100%; position: relative; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.caption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.controls {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

/* Botones de navegación más elegantes */
.controls .btn {
  pointer-events: auto;
  background: rgba(255,255,255,0.9);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #222;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.controls .btn:hover {
  background: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.btn {
  pointer-events: auto;
  background: rgba(255,255,255,0.85);
  border: none;
  padding: 8px 10px;
  border-radius: 50%;
  cursor: pointer;
}
.btn:hover { background: #fff; }

/* Contenido debajo del hero */
.content {
  /* Cuando el header está fijo arriba tras el scroll,
     evitamos que el contenido quede tapado */
}
body.scrolled .content {
  padding-top: var(--header-h);
}

/* Área de impresión de textos / ancho controlado */
.container {
  width: 90%;
  margin: 0 auto;
}
img { max-width: 100%; display: block; }

/* Productos */
.products { max-width: 1100px; margin: 20px auto; padding: 0 12px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card { border: 1px solid #eee; border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.card .info { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.name { font-size: 14px; font-weight: 600; }
.price { color: #0a7; font-weight: 700; }
.cta { padding: 8px 10px; background: #222; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.cta:hover { background: #000; }

/* Footer negro con 4 columnas */
.footer {
  background: #222;
  color: #fff;
  padding: 40px 5%;
}
.footer .columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.footer h4 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--tiza);
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin-bottom: 8px; font-size: 14px; }
.footer ul li a { color: #ccc; text-decoration: none; }
.footer ul li a:hover { color: #fff; text-decoration: underline; }

/* Responsive */
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .footer .columns { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
  .footer .columns { grid-template-columns: 1fr; }
}
