.tf-home-main {
  width: 100%;
  max-width: 100vw;
  margin: 0 auto;
  overflow-x: clip;
  --home-section-w: var(--tf-container-w);
  --home-section-pad-x: var(--tf-container-pad);
  --home-section-y: clamp(34px, 4.4vw, 54px);
  --home-section-gap: clamp(16px, 2vw, 24px);
  --home-title-size: clamp(22px, 2.6vw, 32px);
  --home-sub-size: clamp(0.85rem, 0.9vw, 0.95rem);
  --home-card-gap: clamp(1rem, 1.5vw, 1.25rem);
  --home-card-body-pad: clamp(14px, 1.2vw, 18px);
}

@media (max-width: 1318px) {
  .tf-home-main {
    /* Padding is handled by global --tf-container-pad variable */
  }
}

@media (max-width: 945px) {
  .tf-home-main {
    --home-section-w: 100%;
    --home-section-pad-x: calc(max(12px, env(safe-area-inset-left)) + 12px);
  }
}

/* ========= Fondo de escena (Editorial Clean) ========= */
.hero-scene {
  background: transparent;
  position: relative;
  overflow: hidden;
}

.hero-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(23, 49, 36, 0.03) 0%,
    rgba(23, 49, 36, 0) 70%
  );
  pointer-events: none;
}

.hero-scene > * {
  position: relative;
  z-index: 1;
}

/* =============== Design Tokens (Inherit from base where possible) =============== */
:root {
  /* Adjusted scale for the editorial layout */
  --card-w: 136px;
  --card-h: 196px;
  --ring-radius: 232px;
}

.tf-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-inline: auto;
  width: min(var(--tf-max-w), 94vw);
  color: var(--tf-text);
  /* Reduced top padding to bring hero closer to refined navbar */
  padding: clamp(12px, 2.3vw, 26px) clamp(16px, 4vw, 40px) clamp(18px, 3.2vw, 38px);
}

/* Header */
.tf-hero__header {
  text-align: center;
  width: min(800px, 100%);
  margin: 0 auto 6px;
  min-width: 0;
  min-height: clamp(124px, 10.8vw, 146px);
}

.tf-hero__badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: var(--tf-r-xs);
  background: var(--tf-bg-mid);
  color: var(--tf-accent);
  font: 700 11px/1 "Manrope", sans-serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.tf-hero__title {
  color: var(--tf-text);
  font-family: "Newsreader", serif;
  font-weight: 500;
  /* Reduced size for better balance and to prevent squashing the cover images */
  font-size: clamp(26px, 3.8vw, 42px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  text-wrap: balance;
  /* Fixed min-height to prevent layout jumps between short/long titles */
  min-height: 1.9em;
  max-height: 1.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.tf-hero__subtitle {
  color: var(--tf-text-soft);
  font-family: "Manrope", system-ui;
  font-weight: 500;
  font-size: clamp(13px, 1.05vw, 15px);
  line-height: 1.35;
  margin: 0 0 7px;
  max-width: 620px;
  margin-inline: auto;
  text-wrap: balance;
  max-width: min(620px, 100%);
  min-height: 2.7em;
  max-height: 2.7em;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.tf-hero__kicker {
  color: var(--tf-text-dim);
  font-family: "Manrope", system-ui;
  font-weight: 500;
  font-size: clamp(12px, 1vw, 13px);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  max-width: 100%;
  min-height: 1.2em;
  max-height: 1.2em;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* Welcome slide styling when active */
.tf-hero.is-welcome .tf-hero__title {
  font-style: italic; /* Editorial flair for welcome */
}

/* Redefine button style for light theme */
.tf-hero-card--welcome .tf-hero-card__viewNow {
  background: var(--tf-accent);
  color: #ffffff;
}

.tf-hero-card--welcome .tf-hero-card__viewNow:hover {
  background: var(--tf-accent-dark);
}

.tf-hero.is-welcome .tf-hero__ctaBar .tf-btn {
  background: linear-gradient(135deg, #ffbb33 0%, #ff9911 100%);
  border: 1px solid rgba(120, 60, 0, 0.25);
}
.tf-hero.is-welcome .tf-hero__ctaBar .tf-btn:hover {
  background: linear-gradient(135deg, #ffb000 0%, #ff8800 100%);
  color: var(--tf-text);
}

/* Secondary welcome button style (in body actions) */
.tf-btn--welcome-secondary {
  background: linear-gradient(135deg, #ffbb33 0%, #ff9911 100%);
  border: 1px solid rgba(120, 60, 0, 0.25);
  color: var(--tf-text);
}
.tf-btn--welcome-secondary:hover {
  background: linear-gradient(135deg, #ffb000 0%, #ff8800 100%);
}

/* ================= Carrusel 3D (anillo) ================= */
.tf-hero__slider {
  position: relative;
  perspective: 1600px;
  /* Established height for consistent 3D ring display */
  height: clamp(158px, 15.8vw, 202px);
  margin-top: clamp(22px, 2.2vw, 30px);
  margin-bottom: 8px;
}
.tf-hero__slider::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 50%;
  height: 20%;
  transform: translateX(-50%);
  filter: blur(28px);
  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(23, 49, 36, 0.05) 0%,
    rgba(23, 49, 36, 0) 80%
  );
  pointer-events: none;
}
.tf-hero__ring {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  transition: transform 1200ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Nav arrows overlay */
.tf-hero__nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* bring arrows closer to center after height reduction */
  padding: 0 clamp(20px, 8vw, 90px);
  pointer-events: none; /* container ignores events; buttons re-enable */
}
.tf-hero__navBtn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 300;
  font-size: 24px;
  line-height: 1;
  color: var(--tf-text);
  background: var(--tf-bg-card);
  border: 1px solid var(--tf-border);
  box-shadow: var(--tf-shadow-sm);
  transition: all 300ms var(--tf-ease);
  opacity: 1;
}
.tf-hero__navBtn:hover {
  background: var(--tf-accent);
  color: #fff;
  border-color: var(--tf-accent);
  box-shadow: var(--tf-shadow-md);
}
.tf-hero__navBtn:focus-visible {
  outline: 2px solid #b7c4ff;
  outline-offset: 3px;
}

/* Optional: slightly hide arrows until hover on desktop */
@media (hover: hover) and (pointer: fine) {
  .tf-hero__navBtn { opacity: 0.0; }
  .tf-hero__slider:hover .tf-hero__navBtn { opacity: 0.92; }
}

/* Slide */
.tf-hero-card {
  position: absolute;
  width: var(--card-w);
  height: var(--card-h);
  transform-style: preserve-3d;
  will-change: transform, filter, opacity, box-shadow;
  transition:
    filter 0.6s,
    opacity 0.6s,
    transform 1200ms cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.6s;
  z-index: 1;
  background: transparent;
  border: 0;
  box-shadow: none;
  --hero-angle: 0deg;
  --hero-radius: var(--ring-radius);
  --hero-tilt: 0deg;
  --hero-depth: 0px;
  --hero-depth-offset: 0px;
  --hero-scale: 0.96;
  transform: rotateY(var(--hero-angle))
    translateZ(
      calc(var(--hero-radius) + var(--hero-depth) + var(--hero-depth-offset))
    )
    rotateY(var(--hero-tilt)) scale(var(--hero-scale));
}
.tf-hero-card__media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.tf-hero-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
  transition:
    transform 0.45s var(--tf-ease),
    filter 0.45s var(--tf-ease);
  filter: drop-shadow(0 12px 24px rgba(27, 28, 21, 0.12));
}

.tf-hero-card:not(.is-active) {
  filter: brightness(0.95) saturate(0.8);
  opacity: 0.6;
  --hero-scale: 0.9;
}
.tf-hero-card.is-active {
  filter: none;
  opacity: 1;
  --hero-depth: 24px;
  --hero-scale: 1.03;
}
.tf-hero-card.is-active:hover {
  --hero-depth: 34px;
  --hero-scale: 1.06;
}
.tf-hero-card.is-active:hover .tf-hero-card__media img {
  transform: translateY(-6px);
  filter: drop-shadow(0 18px 34px rgba(27, 28, 21, 0.16));
}

/* View Now overlay button (shown on active slide hover) */
/* View Now overlay button (glass + smooth reveal) */
.tf-hero-card__viewNow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -40%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  padding: 0.42rem 0.72rem;
  border-radius: 0px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  font-family: "Syne", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(10px, 0.8vw, 12px);
  letter-spacing: 0.05em;
  text-shadow: none;
  transition:
    opacity 420ms ease,
    transform 480ms cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 420ms ease,
    background-color 420ms ease,
    border-color 420ms ease,
    backdrop-filter 420ms ease;
}
/* Premium overlays for the hero overlay, reusing base button */
.tf-btn.tf-btn--primary.tf-hero-card__viewNow {
  color: #ffffff;
  background: var(--tf-accent);
  border: none;
  box-shadow: var(--tf-shadow-md);
}
/* Remove decorative quotes */
.tf-hero-card__viewNow::before,
.tf-hero-card__viewNow::after { content: none; }
.tf-btn.tf-btn--primary.tf-hero-card__viewNow:hover {
  background: var(--tf-accent-dark);
  transform: translate(-50%, -50%) scale(1.05) !important;
}
/* No extra shift on hover; keep centered label */
.tf-btn.tf-btn--primary.tf-hero-card__viewNow:active {
  transform: translate(-50%, -50%) scale(0.98) !important;
  box-shadow: none;
}
.tf-hero-card.is-active:hover .tf-hero-card__viewNow,
.tf-hero-card__viewNow:focus-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
/* Also show while hovering anywhere over the slider for reliability */
.tf-hero__slider:hover .tf-hero-card.is-active .tf-hero-card__viewNow {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.tf-hero-card__body {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Dots */
.tf-hero__controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: clamp(6px, 0.9vw, 9px);
  order: 4;
}
.tf-hero__dot { 
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tf-border-mid);
  border: 0;
  transition: all 300ms var(--tf-ease);
  opacity: 0.5;
}
.tf-hero__dot.is-active {
  background: var(--tf-accent);
  transform: scale(1.4);
  opacity: 1;
}
.tf-hero__dot:focus-visible {
  outline: 2px solid #a5b6ff;
  outline-offset: 3px;
}

/* CTA inferior centrado */
.tf-hero__ctaBar {
  max-width: 840px;
  margin: clamp(4px, 0.7vw, 8px) auto 0;
  padding: 0;
  text-align: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  order: 3;
}

/* Boton */
.tf-btn.tf-btn--primary {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: var(--tf-r-xs);
  text-decoration: none;
  color: #ffffff;
  background: var(--tf-accent);
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.85rem;
  border: none;
  box-shadow: var(--tf-shadow-sm);
  transition: all 220ms var(--tf-ease-spring);
}
.tf-btn.tf-btn--primary:hover {
  background: var(--tf-accent-dark);
  box-shadow: var(--tf-shadow-md);
  transform: translateY(-2px);
}
.tf-btn.tf-btn--primary:active {
  transform: translateY(0);
}
.tf-btn.tf-btn--primary:focus-visible {
  outline: 2px solid #e2ff00;
  outline-offset: 4px;
}

/* Responsive */
@media (max-width: 980px) {
  :root {
    --ring-radius: 224px; /* allow spacing with bigger images */
    --card-w: 132px;
    --card-h: 186px;
  }
  .tf-hero {
    padding: clamp(10px, 2.4vw, 18px) 14px 16px;
  }
  .tf-hero__slider {
    height: clamp(156px, 23vw, 198px);
    margin-top: clamp(18px, 2.4vw, 26px);
    /* add a bit more breathing room above the CTA on tablets */
    margin-bottom: clamp(8px, 1.3vw, 12px);
  }

}
.tf-hero__ctaBar .tf-btn.tf-btn--primary {
  /* reduce Amazon CTA size only in hero */
  padding: 0.42rem 0.72rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  box-shadow: 0 6px 14px rgba(23, 49, 36, 0.12);
}

@media (max-width: 720px) {
  :root {
    --ring-radius: 170px;
    --card-w: 112px;
    --card-h: 160px;
  }
  .tf-hero {
    width: 100%;
    max-width: 100vw;
    padding: 10px 12px 14px;
    overflow: hidden;
  }
  .tf-hero__title {
    --hero-title-lines: 3;
    width: 100%;
    max-width: min(320px, calc(100vw - 48px));
    display: -webkit-box;
    text-align: center;
    white-space: normal;
    min-height: 3.12em;
    max-height: 3.12em;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: clamp(21px, 6vw, 24px);
    line-height: 1.04;
  }
  .tf-hero__subtitle {
    --hero-subtitle-lines: 3;
    width: 100%;
    max-width: min(320px, calc(100vw - 48px));
    display: -webkit-box;
    text-align: center;
    white-space: normal;
    min-height: 4.05em;
    max-height: 4.05em;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
  }
  .tf-hero__kicker {
    --hero-kicker-lines: 2;
    width: 100%;
    max-width: min(320px, calc(100vw - 48px));
    display: -webkit-box;
    text-align: center;
    white-space: normal;
    min-height: 2.4em;
    max-height: 2.4em;
    overflow: hidden;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .tf-hero__slider {
    height: clamp(132px, 32vw, 172px);
    margin-top: clamp(16px, 3vw, 22px);
    /* increase spacing under the books on small phones */
    margin-bottom: clamp(10px, 3vw, 16px);
  }
  /* push CTA bar slightly further down on small screens */
  .tf-hero__ctaBar {
    margin-top: clamp(10px, 3vw, 16px);
  }
  .tf-btn.tf-btn--primary {
    padding: 0.6rem 0.9rem;
  }

}


