:root {
  --bg: #14161a;
  --surface: #1b1e23;
  --surface-2: #20242b;
  --border: #33383f;
  --text: #eeece6;
  --text-dim: #9aa0ab;
  --accent: #ff6a1a;
  --accent-hover: #e2412c;

  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Karla', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background:
    linear-gradient(rgba(20,22,26,0.55), rgba(20,22,26,0.55)),
    url('../branding/textura-neumatico-v2.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

@media (min-width: 641px) {
  body {
    background-image:
      linear-gradient(rgba(20,22,26,0.55), rgba(20,22,26,0.55)),
      url('../branding/textura-neumatico-desktop-v2.jpg');
  }
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #000;
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: 1100px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 1.75rem;
}

.logo {
  display: block;
  width: 140px;
  height: 40px;
  flex: none;
}

.logo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.header__search {
  flex: 1;
  min-width: 0;
}

.header__search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
}

.header__search input::placeholder {
  color: var(--text-dim);
}

.header__search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.header__cart {
  position: relative;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.4rem;
  flex: none;
  margin-left: auto;
}

.header__cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- hero ---- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  letter-spacing: 0.01em;
  line-height: 1;
}

.hero__tagline {
  margin-top: 1rem;
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 40ch;
  margin-inline: auto;
}

.hero__cta {
  display: inline-block;
  margin-top: 1.75rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 2.25rem;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.hero__cta:hover {
  background: var(--accent-hover);
}

/* ---- secciones generales ---- */
main {
  max-width: 1100px;
  margin-inline: auto;
  padding: 0 1.25rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 2.5rem 0 1rem;
}

.section-note {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

/* ---- categorías ---- */
.categories {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.categories__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.category-card__icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

/* ---- productos ---- */
.destacados {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.products__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-bottom: 3rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card__photo {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
}

.product-card__photo svg {
  width: 40px;
  height: 40px;
}

.product-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem 0.25rem;
}

.product-card__stock {
  color: #4caf6d;
  font-size: 0.8rem;
  padding: 0 0.9rem;
}

.product-card__stock--low {
  color: var(--accent);
}

.product-card__stock--agotado {
  color: var(--text-dim);
}

.products__vacio {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 2.5rem 1.5rem;
}

.destacados__ver-todo {
  align-self: center;
  margin-top: 0;
  margin-bottom: 3rem;
}

.product-card__price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.4rem 0.9rem 0.75rem;
}

.btn-add {
  display: block;
  margin: 0 0.9rem 0.9rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  padding: 0.65rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-add:hover {
  background: var(--accent-hover);
}

/* El botón va siempre al fondo de la tarjeta, aunque los nombres ocupen distinta cantidad de renglones */
.product-card .btn-add {
  margin-top: auto;
}

/* ---- visitanos ---- */
.visitanos {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 3rem;
}

.visitanos__content {
  display: flex;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.visitanos__photo {
  width: 45%;
  object-fit: cover;
}

.visitanos__info {
  padding: 1.25rem 1.25rem 1.25rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.visitanos__address {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.visitanos__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.visitanos__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  transition: border-color 0.15s ease;
}

.visitanos__btn:hover {
  border-color: var(--accent);
}

.visitanos__btn--wsp {
  background: #1f8f4e;
  border-color: #1f8f4e;
  color: #fff;
}

.visitanos__btn--wsp:hover {
  background: #197a42;
  border-color: #197a42;
}

/* ---- en construcción ---- */
.building {
  min-height: calc(100vh - 65px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem;
}

.building__icon {
  width: 56px;
  height: 56px;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.building__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
}

.building__text {
  margin-top: 0.75rem;
  color: var(--text-dim);
  max-width: 40ch;
}

/* ---- footer ---- */
.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
}

.footer__legales {
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.footer__legales a {
  text-decoration: underline;
}

.footer__legales a:hover {
  color: var(--accent);
}

.footer__name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

/* ---- responsive: celular ---- */
@media (max-width: 640px) {
  .header__inner {
    gap: 0.6rem;
    padding: 0.75rem 1rem;
  }

  .logo {
    width: 90px;
    height: 28px;
  }

  .header__search input {
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
  }

  /* En el celular el portada no ocupa toda la pantalla: se asoman las categorías e invitan a bajar */
  .hero {
    min-height: 72svh;
  }

  /* Las secciones miden lo que su contenido: sin huecos vacíos entre una y otra */
  .categories,
  .destacados,
  .visitanos {
    min-height: 0;
  }

  .categories__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .products__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .visitanos__content {
    flex-direction: column;
  }

  .visitanos__photo {
    width: 100%;
    height: 180px;
  }

  .visitanos__info {
    padding: 0 1.1rem 1.1rem;
  }
}

/* Los productos se quedan en 2 columnas en el celular, como en cualquier tienda online */
@media (max-width: 420px) {
  .categories__grid {
    gap: 0.6rem;
  }

  .category-card {
    padding: 0.9rem 0.5rem;
    font-size: 0.9rem;
  }

  .products__grid {
    gap: 0.6rem;
  }

  .product-card__name {
    font-size: 0.85rem;
    padding: 0.6rem 0.6rem 0.2rem;
  }

  .product-card__stock {
    padding: 0 0.6rem;
  }

  .product-card__price {
    font-size: 1rem;
    padding: 0.3rem 0.6rem 0.6rem;
  }

  .product-card .btn-add {
    margin-inline: 0.6rem;
    margin-bottom: 0.6rem;
  }
}

.products__vacio .visitanos__btn {
  margin-top: 1rem;
}

.products__vacio-ayuda {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
