/* ══════════════════════════════════════════════════════════════════════════════
   main.css — Estilos globales SuperHogar /nuevaweb/
   Principio: claridad comercial. Sin efectos innecesarios.
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --color-primary:     #c0392b;   /* rojo outlet */
  --color-primary-dk:  #a93226;
  --color-wa:          #25d366;   /* WhatsApp verde */
  --color-wa-dk:       #1ebe57;
  --color-bg:          #f5f5f5;
  --color-surface:     #ffffff;
  --color-text:        #1a1a1a;
  --color-text-muted:  #666666;
  --color-border:      #e0e0e0;
  --color-badge-new:   #2563eb;
  --color-badge-offer: #c0392b;
  --color-badge-feat:  #7c3aed;

  --radius:  8px;
  --shadow:  0 1px 4px rgba(0,0,0,.10);
  --font:    'Inter', sans-serif;
  --max-w:   1200px;
}

/* ── Reset ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: var(--font); background: var(--color-bg); color: var(--color-text); line-height: 1.5; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); }

/* ── Contenedor ─────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Botones ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  border: none;
}
/* Botones en tarjetas de producto: wrap en móvil */
.card-acciones .btn {
  white-space: normal;
  line-height: 1.25;
  text-align: center;
  font-size: .8rem;
}
.btn-wa {
  background: var(--color-wa);
  color: #fff;
  width: 100%;
  padding: 11px;
  font-size: .88rem;
}
.btn-wa:hover { background: var(--color-wa-dk); }

.btn-wa-fotos {
  background: #fff;
  color: var(--color-wa);
  border: 1.5px solid var(--color-wa);
  width: 100%;
  padding: 9px;
  font-size: .82rem;
  margin-top: 5px;
}
.btn-wa-fotos:hover { background: #f0fdf4; }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dk); }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; }

/* ── Topbar de anuncio (franja superior pública) ────────────────────────────── */
.topbar-anuncio {
  background: #0a1f5c;
  color: #c8d8ff;
  font-size: .78rem;
  font-weight: 500;
  text-align: center;
  padding: 7px 0;
}
body.has-adminbar .topbar-anuncio {
  margin-top: 34px;   /* queda debajo de la barra admin fija */
}
.topbar-anuncio-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ta-div {
  opacity: .35;
  font-size: .9rem;
}

/* ── Barra admin (visible solo cuando hay sesión activa) ─────────────────────── */
.sh-adminbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 34px;
  background: #1a1a2e;
  color: #c0c8e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: .73rem;
  z-index: 200;
  gap: 12px;
}
.sh-adminbar-links { display: flex; gap: 8px; }
.sh-adminbar a {
  color: #fff;
  text-decoration: none;
  padding: 3px 9px;
  border-radius: 3px;
  background: rgba(255,255,255,.1);
}
.sh-adminbar a:hover { background: rgba(255,255,255,.22); }
.sh-adminbar .adminbar-logout { color: #fca5a5; }
body.has-adminbar .site-header { top: 34px; }

/* Botones admin sobre tarjetas del catálogo */
.card-admin-bar {
  position: absolute;
  top: 6px; left: 6px;
  display: flex;
  gap: 4px;
  z-index: 5;
}
.card-admin-btn {
  background: rgba(26,26,46,.82);
  color: #fff;
  font-size: .7rem;
  padding: 3px 7px;
  border-radius: 3px;
  text-decoration: none;
  white-space: nowrap;
}
.card-admin-btn:hover { background: #1a1a2e; color: #fff; }

/* Barra admin en página de producto */
.producto-adminbar {
  background: #1a1a2e;
  color: #c0c8e0;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  border-radius: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.producto-adminbar span { opacity: .7; }
.producto-adminbar a {
  color: #fff;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(255,255,255,.12);
}
.producto-adminbar a:hover { background: rgba(255,255,255,.22); }

/* ── Header ──────────────────────────────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 60px;
}
.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  flex-shrink: 0;
}
.logo-nombre {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -.5px;
  line-height: 1;
}
.logo-super { color: #1a3fa8 !important; }
.logo-hogar { color: var(--color-primary) !important; }
.logo-sub {
  font-size: .68rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.site-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.site-nav a {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--color-text);
}
.site-nav a:hover { background: var(--color-bg); }
.site-nav a.active { color: var(--color-primary); font-weight: 700; }

.btn-wa-header {
  background: var(--color-wa);
  color: #fff;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 600;
  flex-shrink: 0;
}
.btn-wa-header:hover { background: var(--color-wa-dk); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  margin-left: auto;
  color: var(--color-text);
}

/* ── Menú móvil ──────────────────────────────────────────────────────────────── */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
}
.nav-mobile-overlay.active { display: block; }
.nav-mobile {
  background: #fff;
  width: 260px;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-mobile a {
  padding: 12px 10px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}
.nav-mobile a:hover { background: var(--color-bg); }
.btn-wa-mobile {
  background: var(--color-wa) !important;
  color: #fff !important;
  text-align: center;
  margin-top: 12px;
  border-bottom: none !important;
}
.nav-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  align-self: flex-end;
  margin-bottom: 10px;
  color: var(--color-text-muted);
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.site-footer {
  background: #1a1a1a;
  color: #ccc;
  margin-top: 60px;
  padding: 40px 0 0;
  font-size: .875rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 28px;
  padding-bottom: 32px;
}
.footer-col strong {
  display: block;
  color: #fff;
  margin-bottom: 10px;
  font-size: .9rem;
}
.footer-col p { color: #aaa; line-height: 1.7; }
.footer-col a {
  display: block;
  color: #aaa;
  padding: 3px 0;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #333;
  padding: 14px 0;
  text-align: center;
  font-size: .8rem;
  color: #777;
}

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-nuevo    { background: var(--color-badge-new);   color: #fff; }
.badge-oferta   { background: var(--color-badge-offer); color: #fff; }
.badge-destacado{ background: var(--color-badge-feat);  color: #fff; }
.badge-vendido  { background: #555; color: #fff; }
.badge-estado   { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* ── Sección genérica ────────────────────────────────────────────────────────── */
.seccion {
  padding: 36px 0;
}
.seccion-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.seccion-titulo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}
.seccion-titulo span {
  color: var(--color-primary);
}
.seccion-link {
  font-size: .85rem;
  color: var(--color-primary);
  font-weight: 600;
}
.seccion-link:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-nav, .btn-wa-header { display: none; }
  .nav-toggle { display: block; }
  .seccion { padding: 24px 0; }
  .seccion-titulo { font-size: 1.05rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 20px; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
}
