/* ==========================================================================
   GNB Ferretería — Hoja de estilos principal
   Tema oscuro industrial · Acento naranja
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
  --bg: #0f1216;
  --bg-alt: #151a21;
  --surface: #1c232d;
  --surface-2: #242d39;
  --border: #2e3947;
  --text: #e8edf2;
  --text-muted: #9aa7b4;
  --accent: #ff7a1a;
  --accent-dark: #e5670f;
  --accent-soft: rgba(255, 122, 26, 0.12);
  --wa: #25d366;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --transition: 0.25s ease;
  --max-w: 1100px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

/* ---------- Utilidades ---------- */
.container {
  width: min(100% - 2rem, var(--max-w));
  margin-inline: auto;
}

.section {
  padding: 4.5rem 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__title {
  text-align: center;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.section__title--left {
  text-align: left;
}

.section__lead {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
  color: var(--text-muted);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.btn--primary {
  background: var(--accent);
  color: #1a1000;
}

.btn--primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.btn--ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--wa {
  background: var(--wa);
  color: #06220f;
}

.btn--wa:hover {
  filter: brightness(1.1);
}

.btn--block {
  width: 100%;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 18, 22, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo__icon {
  font-size: 1.6rem;
}

.logo__dot {
  color: var(--accent);
}

.nav__list {
  display: flex;
  gap: 1.75rem;
}

.nav__link {
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 0.25rem 0;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}

.nav__link:hover,
.nav__link.active {
  color: var(--text);
}

.nav__link.active::after,
.nav__link:hover::after {
  width: 100%;
}

/* Menú hamburguesa */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 6rem 0 5rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, var(--accent-soft), transparent),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  text-align: center;
}

.hero__tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero__title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.highlight {
  color: var(--accent);
}

.hero__subtitle {
  max-width: 560px;
  margin: 0 auto 2rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero__actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.hero__stats li {
  display: flex;
  flex-direction: column;
}

.hero__stats strong {
  font-size: 1.9rem;
  color: var(--accent);
}

.hero__stats span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.hero__decor {
  position: absolute;
  right: -20px;
  bottom: -30px;
  font-size: 11rem;
  opacity: 0.06;
  transform: rotate(-15deg);
  pointer-events: none;
  user-select: none;
}

/* ---------- Features (Nosotros) ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.feature-card__icon {
  font-size: 2rem;
  margin-bottom: 0.9rem;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ---------- Chips de filtro ---------- */
.categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.25rem;
}

.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1000;
  font-weight: 700;
}

/* ---------- Grid de productos ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.card.hidden {
  display: none;
}

.card__emoji {
  font-size: 2.6rem;
  margin-bottom: 1rem;
}

.card__title {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.card__desc {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ---------- Contacto ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact__list {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.contact__list li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contact__icon {
  font-size: 1.4rem;
  background: var(--accent-soft);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  flex-shrink: 0;
}

.contact__list strong {
  display: block;
  margin-bottom: 0.15rem;
}

.contact__list span {
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* Formulario */
.contact__form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.contact__form h3 {
  margin-bottom: 1.4rem;
  font-size: 1.2rem;
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.field input,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form__msg {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  min-height: 1.3em;
}

.form__msg.ok {
  color: var(--wa);
}

.form__msg.error {
  color: #ff6b6b;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.2rem 0;
  background: var(--bg-alt);
  text-align: center;
}

.footer__logo {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.footer__logo span {
  color: var(--accent);
}

.footer__copy {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ---------- Botón subir ---------- */
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1000;
  font-size: 1.2rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 90;
  box-shadow: var(--shadow);
}

.to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- Animaciones (reveal on scroll) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .contact {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 720px) {
  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem 1.5rem;
    transform: translateY(-130%);
    transition: transform 0.35s ease;
    z-index: 99;
  }

  .nav.open {
    transform: translateY(0);
  }

  .nav__list {
    flex-direction: column;
    gap: 1.1rem;
  }

  .btn--wa {
    display: none;
  }

  .hero {
    padding: 4rem 0 3.5rem;
  }

  .hero__stats {
    gap: 1.5rem;
  }

  .section {
    padding: 3.25rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
