/* Tienda de demostración. Las reglas del módulo usan el prefijo histofeed-. */

html {
  color-scheme: only light;
}

.hf-store-body,
.hf-store-body *,
.histofeed-module,
.histofeed-module *,
.histofeed-player,
.histofeed-player * {
  box-sizing: border-box;
}

.hf-store-body {
  margin: 0;
  background:
    radial-gradient(820px 380px at 100% -8%, rgba(15, 110, 86, 0.1), transparent 62%),
    radial-gradient(640px 320px at -10% 20%, rgba(15, 110, 86, 0.06), transparent 60%),
    #f5f3ef;
  color: #171614;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

.hf-store {
  min-height: 100vh;
}

.hf-store-wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.hf-store-skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 30;
  background: #fff;
  color: #1c1b19;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
}

.hf-store-skip:focus {
  top: 8px;
}

.hf-store-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 243, 239, 0.86);
  border-bottom: 1px solid rgba(23, 22, 20, 0.08);
  backdrop-filter: blur(16px);
}

.hf-store-header__inner {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  min-height: 72px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.hf-store-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #171614;
  font-weight: 650;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.hf-store-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
  border-radius: 10px;
  background: #0f6e56;
  color: #fff;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 12px rgba(16, 36, 31, 0.12);
}

.hf-store-mark.has-logo { background: #fff; }

.hf-store-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hf-store-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-left: auto;
}

.hf-store-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #3a3834;
  font-weight: 600;
  text-decoration: none;
}

.hf-store-lang {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e4ddd2;
}

.hf-store-lang button {
  min-width: 44px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4e4943;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.hf-store-lang button[aria-pressed="true"] {
  background: #10241f;
  color: #fff;
}

.hf-store-banner {
  padding: 28px 0 8px;
}

.hf-store-banner__grid {
  display: grid;
  gap: 20px;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.94)),
    #fff;
  border: 1px solid rgba(23, 22, 20, 0.08);
  border-radius: 32px;
  box-shadow: 0 18px 50px rgba(23, 22, 20, 0.06);
  padding: 24px;
}

.hf-store-kicker {
  margin: 0 0 8px;
  color: #0f6e56;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hf-store h1,
.hf-store h2,
.histofeed-module h2 {
  margin: 0;
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.hf-store-banner h1 {
  font-size: clamp(32px, 5vw, 56px);
  max-width: 16ch;
}

.hf-store-detail h1 {
  max-width: 22ch;
  font-size: clamp(32px, 4vw, 48px);
}

.hf-store-banner p,
.hf-store-lead {
  color: #4e4943;
  font-size: 17px;
}

.hf-store-banner__visual {
  min-height: 220px;
  border-radius: 20px;
  overflow: hidden;
  background: #1e3a34;
}

.hf-store-banner__visual img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: block;
}

.hf-store-section {
  padding: 28px 0 12px;
}

.hf-store-lead {
  margin: 8px 0 16px;
}

.hf-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.hf-store-product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid rgba(23, 22, 20, 0.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(23, 22, 20, 0.05);
}

.hf-store-product-card__media {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #e7efe9;
}

.hf-store-product-card__media img,
.hf-store-detail__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hf-store-product-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px;
}

.hf-store-product-card__title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hf-store-product-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.hf-store-price {
  margin: 0;
  color: #0f6e56;
  font-weight: 700;
}

.hf-store-product-card a,
.hf-store-text-link {
  color: #0f6e56;
  font-weight: 700;
  text-decoration: none;
}

.hf-store-product-card a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.hf-store-muted {
  color: #5e584f;
  font-size: 14px;
}

.hf-store-badge,
.histofeed-card__badge,
.histofeed-player__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: #fff;
  color: #1c1b19;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
}

.hf-store-footer {
  padding: 28px 0 40px;
  color: #5e584f;
  font-size: 14px;
}

.hf-store-panel-link {
  margin: 10px 0 0;
}

.hf-store-panel-link a {
  color: #5e584f;
  font-size: 13px;
}

.hf-store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 18px;
  border-radius: 999px;
  background: #10241f;
  color: #fff;
  font-weight: 650;
  text-decoration: none;
}

.hf-store-detail {
  display: grid;
  gap: 22px;
  padding-bottom: 36px;
}

.hf-store-detail__figure,
.hf-store-detail__placeholder,
.hf-store-ph {
  background: #e7efe9;
  border-radius: 24px;
  overflow: hidden;
}

.hf-store-detail__figure {
  aspect-ratio: 3 / 4;
}

.hf-store-detail__placeholder,
.hf-store-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #0f6e56;
  font-size: 48px;
  font-weight: 700;
}

.hf-store-detail__price {
  margin: 12px 0 0;
  color: #0f6e56;
  font-size: 28px;
  font-weight: 700;
}

.hf-store-detail__status {
  margin: 8px 0 0;
  font-weight: 700;
}

.hf-store-missing {
  padding: 32px 0 64px;
}

.hf-store a:focus-visible,
.hf-store button:focus-visible,
.histofeed-card:focus-visible {
  outline: 3px solid #0f6e56;
  outline-offset: 3px;
}

@media (min-width: 800px) {
  .hf-store-banner__grid {
    grid-template-columns: 1.2fr 0.8fr;
    padding: 36px;
  }

  .hf-store-detail {
    grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 640px) {
  .hf-store-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .hf-store-lang {
    margin-left: auto;
  }
}

/* Módulo de historias */

.histofeed-module {
  min-width: 0;
  padding: 28px 0 8px;
}

.histofeed-kicker {
  margin: 0 0 6px;
  color: #0f6e56;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.histofeed-module h2 {
  font-size: clamp(28px, 4vw, 44px);
  max-width: 16ch;
}

.histofeed-row {
  display: flex;
  gap: 12px;
  max-width: 100%;
  margin-top: 18px;
  padding: 8px 2px 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 110, 86, 0.45) transparent;
}

.histofeed-row::-webkit-scrollbar {
  height: 8px;
}

.histofeed-row::-webkit-scrollbar-thumb {
  background: #c9c1b4;
  border-radius: 999px;
}

.histofeed-card {
  position: relative;
  flex: 0 0 auto;
  width: 120px;
  height: 160px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #10241f;
  color: #fff;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow: 0 10px 24px rgba(16, 36, 31, 0.12);
}

.histofeed-card__media,
.histofeed-card__media img,
.histofeed-card__preview,
.histofeed-card__placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.histofeed-card__media img,
.histofeed-card__preview {
  object-fit: cover;
  display: block;
}

.histofeed-card__preview {
  z-index: 1;
  background: #10241f;
  pointer-events: none;
}

.histofeed-card__placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1d4a3d, #0f6e56);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}

.histofeed-card__play {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(16, 36, 31, 0.42);
  backdrop-filter: blur(8px);
}

.histofeed-card__play::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 9px;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #fff;
}

.histofeed-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  max-width: calc(100% - 36px);
}

.histofeed-card__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 8px 8px;
  background: linear-gradient(transparent, rgba(8, 16, 14, 0.82));
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: left;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.histofeed-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), inset 0 0 0 3px #0f6e56;
  pointer-events: none;
}

.histofeed-card.is-unavailable img {
  filter: grayscale(0.45);
}

.histofeed-card.is-unavailable::after {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), inset 0 0 0 3px #8d8680;
}

.histofeed-empty {
  margin: 12px 0 0;
  color: #5e584f;
}

.histofeed-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1023px) {
  .histofeed-card {
    width: 108px;
    height: 144px;
  }
}

@media (max-width: 767px) {
  .histofeed-row {
    gap: 10px;
  }

  .histofeed-card {
    width: 96px;
    height: 128px;
    border-radius: 18px;
  }

  .histofeed-card__title {
    font-size: 11px;
    padding: 18px 6px 6px;
  }
}

/* Reproductor */

.histofeed-player {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 9, 0.64);
  backdrop-filter: blur(6px);
  overscroll-behavior: none;
}

.histofeed-player[hidden],
.histofeed-player [hidden],
.histofeed-module [hidden],
.hf-store [hidden] {
  display: none !important;
}

.histofeed-player__stage {
  --histofeed-stage-width: min(420px, calc(100vw - 48px), calc(85vh * 9 / 16));
  position: relative;
  width: var(--histofeed-stage-width);
  height: calc(var(--histofeed-stage-width) * 16 / 9);
  max-height: 85vh;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #070707;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

@supports (height: 100dvh) {
  .histofeed-player__stage {
    --histofeed-stage-width: min(420px, calc(100vw - 48px), calc(85dvh * 9 / 16));
    max-height: 85dvh;
  }
}

.histofeed-player__video,
.histofeed-player__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.histofeed-player__video {
  object-fit: contain;
  background: #070707;
}

.histofeed-player__video.is-cover {
  object-fit: cover;
}

.histofeed-player__video.is-hidden {
  opacity: 0;
}

.histofeed-player__fallback {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 72px;
  background: #161616 center / cover no-repeat;
  color: #fff;
  text-align: center;
}

.histofeed-player__fallback span {
  max-width: 240px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.62);
}

.histofeed-player__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 32%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.38), transparent 18%);
}

.histofeed-player__progress {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  z-index: 4;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.histofeed-player__progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.histofeed-player__status,
.histofeed-player__toast {
  position: absolute;
  z-index: 4;
  max-width: min(260px, calc(100% - 88px));
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.histofeed-player__status {
  top: max(18px, calc(env(safe-area-inset-top) + 14px));
  left: 16px;
}

.histofeed-player__toast {
  top: max(62px, calc(env(safe-area-inset-top) + 56px));
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}

.histofeed-player__toast.is-visible {
  opacity: 1;
}

.histofeed-player__close,
.histofeed-player__controls {
  position: absolute;
  z-index: 5;
  top: max(16px, env(safe-area-inset-top));
}

.histofeed-player__close {
  right: max(14px, env(safe-area-inset-right));
}

.histofeed-player__controls {
  left: max(14px, env(safe-area-inset-left));
}

.histofeed-player__btn,
.histofeed-player__play {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.05)),
    rgba(14, 16, 15, 0.5);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(14px);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -7px 10px rgba(0, 0, 0, 0.28);
}

.histofeed-player__btn svg,
.histofeed-player__play svg {
  width: 14px;
  height: 14px;
}

.histofeed-player__zones {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 40% 20% 40%;
  touch-action: manipulation;
}

.histofeed-player__zone {
  border: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.histofeed-player__play {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 46%;
  right: auto;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.histofeed-player__play svg {
  width: 18px;
  height: 18px;
}

.histofeed-player__btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.histofeed-player__close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
}

.histofeed-player .is-off {
  display: none !important;
}

.histofeed-player__btn:focus-visible,
.histofeed-player__play:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.histofeed-player__card:focus-visible {
  outline: 3px solid #0f6e56;
  outline-offset: 3px;
}

.histofeed-player__card {
  position: absolute;
  z-index: 5;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 8px 8px 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 253, 250, 0.92), rgba(255, 252, 248, 0.78));
  color: #171614;
  text-decoration: none;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px) saturate(1.35);
}

.histofeed-player__card[aria-disabled="true"] {
  cursor: default;
}

.histofeed-player__thumb {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 68px;
  border-radius: 18px;
  overflow: hidden;
  background: #e7efe9;
  box-shadow: 0 8px 18px rgba(16, 36, 31, 0.16);
}

.histofeed-player__thumb img,
.histofeed-player__thumb-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.histofeed-player__thumb-fallback {
  display: grid;
  place-items: center;
  color: #0f6e56;
  font-weight: 700;
}

.histofeed-player__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.histofeed-player__card-title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.histofeed-player__card-price {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 110, 86, 0.12);
  color: #0c5c48;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.histofeed-player__card-action {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin-right: 2px;
  border-radius: 50%;
  background: #10241f;
  color: #fff;
}

.histofeed-player__card-action span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.histofeed-player__card-action svg {
  width: 16px;
  height: 16px;
}

.histofeed-player__card-action:has(svg.is-off) {
  display: none;
}

.histofeed-player__badge {
  position: absolute;
  top: 10px;
  left: 16px;
  padding: 5px 8px;
  background: rgba(255, 244, 216, 0.94);
  border: 1px solid rgba(234, 215, 162, 0.9);
  backdrop-filter: blur(10px);
}

@media (max-width: 767px) {
  .histofeed-player {
    background: #070707;
    backdrop-filter: none;
  }

  .histofeed-player__stage {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-height: 500px) {
  .histofeed-player {
    background: #070707;
  }

  .histofeed-player__stage {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .histofeed-player__card {
    min-height: 64px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hf-store-header,
  .histofeed-card,
  .histofeed-player,
  .histofeed-player__stage,
  .histofeed-player__toast,
  .histofeed-player__progress span {
    transition: none;
    animation: none;
    scroll-behavior: auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .histofeed-card,
  .hf-store-product-card,
  .histofeed-player__btn,
  .histofeed-player__card {
    transition: transform 180ms ease, box-shadow 180ms ease;
  }

  .histofeed-card:hover,
  .hf-store-product-card:hover {
    transform: translateY(-3px);
  }

  .histofeed-player__btn:active {
    transform: scale(0.96);
  }

  .histofeed-player {
    animation: histofeed-fade 180ms ease;
  }

  .histofeed-player__stage {
    animation: histofeed-rise 220ms ease;
  }

  .histofeed-player__progress span {
    transition: width 160ms linear;
  }
}

@keyframes histofeed-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes histofeed-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 767px) {
  .histofeed-player__stage {
    animation: none;
  }
}
