:root {
  --bg: #ffffff;
  --surface: #f6f6f7;
  --border: #e5e5e7;
  --text: #1c1c1e;
  --text-muted: #6b6b70;
  --dark: #1c1c1e;
  --whatsapp: #25d366;
  --whatsapp-dark: #1ea952;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

.share-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.product-description {
  margin: 16px 0;
  line-height: 1.5;
  color: var(--text);
}

.product-description-list {
  margin: 16px 0;
  padding-left: 20px;
  line-height: 1.6;
  color: var(--text);
}

.product-description-list li {
  margin-bottom: 6px;
}

/* ---------- Header ---------- */
#siteHeader {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-link { display: flex; align-items: center; }
.logo-img { height: 40px; width: auto; }

#navToggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
  margin-left: auto;
}
#navToggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

#mainNav {
  display: flex;
  gap: 24px;
  margin-left: 32px;
  flex: 1;
}
#mainNav a {
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
}
#mainNav a:hover { color: var(--whatsapp-dark); }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  text-align: center;
}
.btn-pill {
  background: var(--dark);
  color: #fff;
}
.btn-pill:hover { background: #333; }

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
}
.btn-whatsapp:hover { background: var(--whatsapp-dark); }

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

.btn-block { display: block; text-align: center; }

/* ---------- Avisos (carrusel de comunicación interna: saludo, lo más compartido, herramienta del día, mensaje de Ronal) ---------- */
#avisos {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  overflow: hidden;
  background: #111;
  text-align: center;
}

.aviso-media {
  position: absolute;
  inset: 0;
}
.aviso-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  filter: blur(1px) brightness(0.75);
  transition: opacity 0.4s ease;
}

.aviso-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  color: #fff;
  background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.55));
  width: 100%;
  height: 100%;
  justify-content: center;
}

#avisoTitle {
  max-width: 640px;
  font-size: 32px;
  margin: 0 0 10px;
  font-weight: 700;
}
#avisoDesc {
  max-width: 560px;
  margin: 0 auto 20px;
  font-size: 17px;
  color: rgba(255,255,255,0.9);
}

#avisoCta.btn-pill {
  border: 1.5px solid #fff;
  color: #fff;
  background: transparent;
}
#avisoCta.btn-pill:hover { background: #fff; color: #111; }

.hero-dots {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
}
.hero-dot.active { background: #fff; }

/* ---------- Por qué Muebles y Colchones El Rey ---------- */
#porQue {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px 0;
}

.why-card {
  background: var(--dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.why-copy { flex: 1 1 auto; }

.why-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.why-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,0.88);
  max-width: 680px;
}

.why-logo-circle {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.why-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 640px) {
  .why-card { flex-direction: column; text-align: center; }
  .why-logo-circle { width: 72px; height: 72px; }
}

#metaVenta {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px 0;
}

.goal-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.goal-card--celebrate {
  background: linear-gradient(135deg, #fff7e0, #fff);
  border-color: #f0c94a;
}

.goal-heading {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 700;
  color: #a9740a;
}

.goal-bar-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.goal-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--whatsapp);
  transition: width 0.5s ease, background 0.4s ease;
  width: 0%;
}

.goal-bar-fill--celebrate {
  background: linear-gradient(90deg, #f0c94a, #f5a623);
}

.goal-bar-fill--team {
  background: var(--dark);
}

#metaEquipo {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px 0;
}

.goal-text {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}


/* ---------- Catalog ---------- */
#catalogo {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.section-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 20px;
}

.catalog-search {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.catalog-search:focus {
  outline: none;
  border-color: var(--text-muted);
}

.search-empty {
  color: var(--text-muted);
  padding: 24px 0;
  text-align: center;
}

/* ---------- Pantalla de inicio de sesión ---------- */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 8px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.login-subtitle {
  color: var(--text-muted);
  margin: 0 0 8px;
  font-size: 14px;
}

.login-input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.login-input:focus {
  outline: none;
  border-color: var(--text-muted);
}

.login-error {
  color: #c0392b;
  font-size: 13px;
  margin: 0;
}

#logoutLink { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
#changeAvatarLink { cursor: pointer; }

.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  border: 1px solid var(--border);
}

.category-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 28px;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }

.cat-chip {
  flex: 0 0 auto;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.cat-chip.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.variant-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.variant-chip {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.variant-chip.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}
@media (min-width: 960px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}

.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.product-thumb {
  aspect-ratio: 1 / 1;
  background: var(--surface);
  overflow: hidden;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

.product-cat {
  font-size: 12px;
  color: var(--text-muted);
  margin: 12px 12px 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.product-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0 12px 14px;
}

/* ---------- Product detail ---------- */
#productView {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-weight: 600;
  color: var(--text-muted);
}
.back-link:hover { color: var(--text); }

.product-title {
  font-size: 30px;
  font-weight: 700;
  margin: 4px 0 24px;
}

.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 12px;
}
.gallery-main img,
.gallery-main video {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: var(--surface);
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-bottom: 28px;
}
.gallery-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  flex: 0 0 auto;
}
.gallery-thumb.active { border-color: var(--dark); }

.gallery-thumb-wrap {
  position: relative;
  flex: 0 0 auto;
}
.thumb-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.thumb-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.thumb-check.checked {
  background: var(--dark);
  border-color: var(--dark);
}

.thumb-delete {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #e11d48;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.gallery-thumb--video {
  position: relative;
  overflow: hidden;
  background: #000;
}
.gallery-thumb--video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.gallery-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.gallery-empty {
  padding: 80px 20px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius);
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 15px;
}

.not-found { padding: 60px 20px; text-align: center; }

/* ---------- Footer ---------- */
#siteFooter {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 20px;
  text-align: center;
}
.footer-logo { height: 44px; margin: 0 auto 14px; }
.footer-tagline { color: var(--text-muted); font-size: 14px; margin: 0 0 18px; }
.footer-whatsapp {
  display: inline-block;
  font-weight: 700;
  color: var(--whatsapp-dark);
  margin-bottom: 18px;
}
.footer-copy { font-size: 12px; color: var(--text-muted); margin: 0; }

/* ---------- Mobile nav ---------- */
@media (max-width: 760px) {
  #navToggle { display: flex; }
  #mainNav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px 0;
  }
  #mainNav.open { display: flex; }
  #mainNav a { padding: 14px 20px; border-bottom: 1px solid var(--border); }
  .header-inner .btn-pill { display: none; }
  #avisoTitle { font-size: 26px; }
}



/* ---------- Barra de pestañas de abajo ---------- */
body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 5px;
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bottom-nav button.active { color: var(--dark); }
.bottom-nav button.active span { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }

@media (min-width: 761px) {
  .bottom-nav {
    left: 50%;
    right: auto;
    width: 520px;
    transform: translateX(-50%);
    bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  }
}

/* Cara de Geppetto (2026-10-12): solo en la entrada del equipo */
.login-gp { height: 130px; width: auto; margin: 0 auto 4px; filter: drop-shadow(0 10px 14px rgba(0,0,0,.25)); }

/* ---------- Entrada a Alex (solo Ronal y Emanuel) ---------- */
.alex-card { display: flex; align-items: center; gap: 14px; margin: 16px auto 0; max-width: 560px; padding: 14px 18px; border-radius: 16px; background: var(--dark); color: #fff; }
.alex-card .alex-ico { font-size: 26px; }
.alex-card span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.alex-card small { opacity: .75; font-size: 13px; margin-top: 2px; }
.alex-card .alex-go { font-size: 22px; }
