/* ============================================================
   HOME (V3.14) — maquetación propia de front-page.php.
   Componentes base (tarjeta, botones, stats…) en ds.css.
   ============================================================ */

.hm { padding-bottom: 3rem; }
.hm .hm-section { margin-top: 2.25rem; }

/* ── HERO ─────────────────────────────────────────────────── */
.hm .hm-hero { padding: 1.5rem 0 1.25rem; }
.hm .hm-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}
.hm .hm-hero__text { text-align: center; }
.hm .hm-hero__title {
  margin: 0.8rem 0 0.5rem;
  font-size: clamp(2.2rem, 11vw, 3.6rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ds-text);
}
.hm .hm-hero__title span {
  background: linear-gradient(180deg, var(--ds-gold-2), var(--ds-gold) 60%, #d9a90c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hm .hm-hero__sub {
  margin: 0 auto;
  max-width: 40ch;
  color: var(--ds-muted);
  font-size: 1.05rem;
  line-height: 1.5;
}
.hm .hm-hero__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 1.25rem;
}
.hm .hm-hero__actions .ds-btn { min-height: 52px; font-size: 16px; }
.hm .hm-hero__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-top: 4px;
  color: var(--ds-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.hm .hm-hero__more svg { width: 16px; height: 16px; }
.hm .hm-hero__more:hover { color: var(--ds-text); }

.hm .hm-hero__visual {
  position: relative;
  padding: 14px 10px 18px;
}
.hm .hm-hero__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ds-line2);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(245,197,24,0.08), 0 0 80px rgba(245,197,24,0.10);
}
.hm .hm-hero__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.hm .hm-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--ds-line2);
  border-radius: 12px;
  background: rgba(17,17,24,0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.5);
  line-height: 1.15;
}
.hm .hm-float b { display: block; color: var(--ds-text); font-size: 13px; font-weight: 800; }
.hm .hm-float small { display: none; color: var(--ds-muted); font-size: 12px; }
.hm .hm-float__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(245,197,24,0.14);
  color: var(--ds-gold);
}
.hm .hm-float__icon svg { width: 17px; height: 17px; }
.hm .hm-float--tr { top: 0; right: 0; }
.hm .hm-float--bl { bottom: 0; left: 0; }
.hm .hm-float--tr .hm-float__icon { background: rgba(91,156,255,0.14); color: var(--ds-blue); }

/* ── STATS ────────────────────────────────────────────────── */
.hm .hm-stats { margin-top: 0.5rem; }

/* ── HERRAMIENTAS ─────────────────────────────────────────── */
.hm .hm-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.hm .hm-tool {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px 12px;
  color: var(--ds-text);
  text-decoration: none;
  transition: border-color 0.18s, transform 0.18s var(--ds-ease), background 0.18s;
}
.hm .hm-tool:hover,
.hm .hm-tool:focus-visible { border-color: color-mix(in srgb, var(--ds-accent) 45%, transparent); color: var(--ds-text); }
.hm .hm-tool:active { transform: scale(0.98); }
.hm .hm-tool:focus { outline: none; }
.hm .hm-tool:focus-visible { outline: 2px solid var(--ds-gold); outline-offset: 2px; }
.hm .hm-tool__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ds-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ds-accent) 30%, transparent);
  color: var(--ds-accent);
}
.hm .hm-tool__icon svg { width: 21px; height: 21px; }
.hm .hm-tool__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hm .hm-tool__tag {
  align-self: flex-start;
  margin-bottom: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ds-accent) 14%, transparent);
  color: var(--ds-accent);
  font-size: 12px;
  font-weight: 700;
}
.hm .hm-tool__title { font-size: 15px; font-weight: 800; line-height: 1.2; }
.hm .hm-tool__desc { color: var(--ds-muted); font-size: 13px; line-height: 1.4; }
.hm .hm-tool__go {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ds-card2);
  color: var(--ds-accent);
  transition: transform 0.18s var(--ds-ease), background 0.18s;
}
.hm .hm-tool__go svg { width: 18px; height: 18px; }
.hm .hm-tool:hover .hm-tool__go { transform: translateX(3px); background: color-mix(in srgb, var(--ds-accent) 16%, transparent); }

.hm .hm-tool--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "icon body go" "demo demo demo";
  align-items: center;
  column-gap: 12px;
  row-gap: 12px;
  padding: 16px 14px;
}
.hm .hm-tool--featured .hm-tool__icon { grid-area: icon; width: 48px; height: 48px; border-radius: 14px; }
.hm .hm-tool--featured .hm-tool__icon svg { width: 24px; height: 24px; }
.hm .hm-tool--featured .hm-tool__body { grid-area: body; }
.hm .hm-tool--featured .hm-tool__go { grid-area: go; }
.hm .hm-tool--featured .hm-tool__title { font-size: 17px; }
.hm .hm-tool--blue { --ds-accent: var(--ds-blue); }

/* Mini demo de la calculadora dentro de su tarjeta */
.hm .hm-tool__demo {
  grid-area: demo;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--ds-line);
  border-radius: 12px;
  background: var(--ds-bg);
}
.hm .hm-demo__side { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.hm .hm-demo__side small { color: var(--ds-muted); font-size: 12px; font-weight: 600; }
.hm .hm-demo__side b { color: var(--ds-gold); font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
.hm .hm-demo__side--them b { color: var(--ds-blue); }
.hm .hm-demo__vs { color: var(--ds-muted); font-size: 12px; font-weight: 800; }
.hm .hm-demo__verdict {
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

/* ── ANUNCIO ──────────────────────────────────────────────── */
.hm .hm-ad { max-width: 760px; }

/* ── TIENDA (preview) ─────────────────────────────────────── */
.hm .hm-shop {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.hm .hm-shop__col { padding: 14px 12px 12px; min-width: 0; }
.hm .hm-shop__col--normal { --ds-accent: var(--ds-blue); }
.hm .hm-shop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.hm .hm-shop__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ds-text);
  font-size: 15px;
  font-weight: 800;
}
.hm .hm-shop__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ds-accent); box-shadow: 0 0 10px var(--ds-accent); }
.hm .hm-shop__tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ds-card3);
  color: var(--ds-muted);
  font-size: 12px;
  font-weight: 700;
}
.hm .hm-shop__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hm .hm-shop__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 10px 4px 9px;
  border: 1px solid var(--ds-line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--ds-accent) 12%, transparent), transparent 62%),
    var(--ds-card2);
  text-align: center;
}
.hm .hm-shop__item img,
.hm .hm-shop__ph {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.hm .hm-shop__ph { display: grid; place-items: center; font-size: 28px; opacity: 0.5; }
.hm .hm-shop__name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ds-text);
  font-size: 13px;
  font-weight: 700;
}
.hm .hm-shop__price {
  color: var(--ds-gold);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.hm .hm-shop__empty { padding: 1.5rem 0.5rem; color: var(--ds-muted); font-size: 14px; text-align: center; }

.hm .hm-block-btn { display: flex; width: 100%; margin-top: 12px; }

/* ── VÍDEOS ───────────────────────────────────────────────── */
.hm .hm-videos {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  gap: 10px;
  margin: 0 -12px;
  padding: 2px 12px 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hm .hm-videos::-webkit-scrollbar { display: none; }
.hm .hm-video {
  min-width: 0;
  overflow: hidden;
  scroll-snap-align: start;
}
.hm .hm-video__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.hm .hm-video__thumb img,
.hm .hm-video__thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.hm .hm-video__thumb img { object-fit: cover; transition: transform 0.4s var(--ds-ease), opacity 0.2s; }
.hm .hm-video__thumb:hover img { transform: scale(1.04); }
.hm .hm-video__play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(10,10,15,0.72);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--ds-gold);
  transform: translate(-50%, -50%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform 0.18s var(--ds-ease), background 0.18s;
}
.hm .hm-video__play svg { width: 24px; height: 24px; margin-left: 3px; }
.hm .hm-video__thumb:hover .hm-video__play { transform: translate(-50%, -50%) scale(1.08); background: rgba(245,197,24,0.9); color: #17140a; }
.hm .hm-video__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 10px 12px 12px; /* margen (no padding): con padding asomaba media 3.ª línea */
  padding: 0;
  color: var(--ds-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

/* ── SORTEOS ──────────────────────────────────────────────── */
.hm .hm-giveaway {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px 16px;
  border-color: rgba(245,197,24,0.28);
  background:
    radial-gradient(ellipse 80% 80% at 50% 0%, rgba(245,197,24,0.14), transparent 70%),
    var(--ds-card);
  text-align: center;
}
.hm .hm-giveaway__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(245,197,24,0.14);
  border: 1px solid rgba(245,197,24,0.35);
  color: var(--ds-gold);
}
.hm .hm-giveaway__icon svg { width: 28px; height: 28px; }
.hm .hm-giveaway__text h2 {
  margin: 0 0 6px;
  color: var(--ds-text);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.2;
}
.hm .hm-giveaway__text p { margin: 0; color: var(--ds-muted); font-size: 15px; line-height: 1.6; }
.hm .hm-giveaway__cta { width: 100%; }

/* ── ≥ 600px ──────────────────────────────────────────────── */
@media (min-width: 600px) {
  .hm .hm-section { margin-top: 3rem; }
  .hm .hm-hero__actions { grid-template-columns: auto auto; justify-content: center; }
  .hm .hm-float small { display: block; }
  .hm .hm-tools { gap: 12px; }
  .hm .hm-tool { padding: 18px 16px; }
  .hm .hm-shop { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .hm .hm-videos { grid-auto-columns: 46%; margin: 0 -20px; padding: 2px 20px 8px; scroll-padding: 0 20px; }
  .hm .hm-giveaway { grid-template-columns: auto minmax(0, 1fr) auto; justify-items: start; align-items: center; text-align: left; padding: 24px; gap: 20px; }
  .hm .hm-giveaway__cta { width: auto; }
}

/* Botones "Ver todo" a ancho completo solo en móvil; en grande va el enlace de la cabecera */
@media (max-width: 599px) {
  .hm .hm-hide-sm { display: none; }
}
@media (min-width: 600px) {
  .hm .hm-block-btn { display: none; }
}

/* ── ≥ 900px: escritorio ─────────────────────────────────── */
@media (min-width: 900px) {
  .hm .hm-hero { padding: 3.5rem 0 2.5rem; }
  .hm .hm-hero__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 3rem; }
  .hm .hm-hero__text { text-align: left; }
  .hm .hm-hero__sub { margin: 0; }
  .hm .hm-hero__actions { justify-content: start; }
  .hm .hm-hero__title { font-size: clamp(3rem, 5.2vw, 4.4rem); }
  .hm .hm-hero__visual { padding: 22px 18px 26px; }
  .hm .hm-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .hm .hm-tool--featured { grid-column: span 2; padding: 22px 20px; }
  .hm .hm-tool:hover { transform: translateY(-2px); }
  .hm .hm-shop__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .hm .hm-shop__col { padding: 18px 16px 16px; }
  .hm .hm-videos { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; gap: 14px; }
}
