/*
 * post-feed-view.css
 *
 * Overlay full-screen que reproduz o feed vertical do marketplace (public/index.html)
 * sobre os posts de UMA loja. Usado em dois pontos de entrada:
 *   - Loja  (/loja/{slug}) -> aba Posts -> clicar num post
 *   - Explorar (/explorar/) -> clicar num thumb do card de empresa
 *
 * O overlay ISOLA o tema escuro do feed, mesmo em paginas de tema claro (tokens-blue
 * da loja). Para isso, redeclara dentro de .post-feed-view o conjunto de tokens de
 * tokens.css (tema escuro) que o .card/.card-actions (feed.css + action-sidebar.css)
 * consomem. Assim o feed da loja fica visualmente identico ao feed principal sem
 * precisar carregar tokens.css na pagina inteira.
 */

.post-feed-view {
  /* ── Tema escuro isolado (espelho dos tokens relevantes de tokens.css) ── */
  --bg:      #080808;
  --surface: #111111;
  --s2:      #181818;
  --border:  rgba(255,255,255,0.07);
  --red:     #FF2D55;
  --yellow:  #FFD60A;
  --blue:    #0A84FF;
  --green:   #30D158;
  --green-20: rgba(48,209,88,0.20);
  --text:    #ffffff;
  --muted:   rgba(255,255,255,0.55);
  --overlay: linear-gradient(0deg, rgba(0,0,0,0.50) 0%, rgba(0,0,0,0.3) 10%, rgba(0,0,0,0.0) 50%);
  --glass-bg:           rgba(0,0,0,0.35);
  --glass-border:       rgba(255,255,255,0.12);
  --separator:          rgba(255,255,255,0.07);
  --skeleton-shine:     rgba(255,255,255,0.06);
  --chip-bg:            rgba(255,255,255,0.06);
  --text-on-image:      rgba(255,255,255,0.85);
  --text-shadow-dark:   rgba(0,0,0,0.6);
  --nav-solid-bg:       rgba(8,8,8,0.96);
  --mobile-nav-bg:      rgba(8,8,8,0.95);
  --accent-15:  rgba(255,45,85,0.15);
  --accent-20:  rgba(255,45,85,0.20);
  --shadow-primary-xl: rgba(255,45,85,0.50);
  --action-bg:        rgba(0,0,0,0.45);
  --action-fg:        #ffffff;
  --action-bg-hover:  rgba(255,255,255,0.12);
  --action-border:    rgba(255,255,255,0.12);
  --action-liked:     #FF2D55;
  --action-saved:     #FFD60A;
  --action-icon-size: 44px;
  --feed-w:  390px;
  --r:       16px;
  --r-sm:    8px;
  --r-lg:    20px;

  /* layout do overlay */
  --pfv-header-h: 50px;

  position: fixed;
  inset: 0;
  z-index: 200;                 /* acima de nav/content; abaixo dos drawers (250+) */
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  animation: pfv-fade-in .18s ease-out;
}

@keyframes pfv-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Header ── */
.post-feed-view .pfv-header {
  flex: 0 0 auto;
  height: var(--pfv-header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--nav-solid-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.post-feed-view .pfv-back {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.post-feed-view .pfv-back:hover { background: rgba(255,255,255,0.15); }
.post-feed-view .pfv-back i { font-size: 16px; }

.post-feed-view .pfv-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Feed vertical (scroll-snap) ── */
.post-feed-view .pfv-feed-wrap {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
}

.post-feed-view .feed {
  height: 100%;
  width: 100%;
  max-width: var(--feed-w);
  margin: 0 auto;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.post-feed-view .feed::-webkit-scrollbar { display: none; }

/* ── Card do feed (scoped — espelho das regras de feed.css + action-sidebar.css) ──
 * Nao carregamos feed.css/action-sidebar.css na loja/explorar pois suas regras
 * globais (html,body{overflow:hidden}, #app, .card) quebram o layout dessas
 * paginas. Aqui elas vivem so dentro de .post-feed-view. */
.post-feed-view .card {
  width: 100%;
  height: 100%;                  /* altura visivel (header reservado no flex) */
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.post-feed-view .card-media-bg {
  position: absolute; inset: 0;
  background-image: var(--card-bg-url);
  background-size: cover;
  background-position: top;
  background-repeat: no-repeat;
  z-index: 0;
  transform: scale(1.05);
  transition: transform 6s ease;
}
.post-feed-view .card.active .card-media-bg { transform: scale(1); }
.post-feed-view .card-video { width: 100%; height: 100%; object-fit: cover; }
.post-feed-view .card.card-video-active .progress-fill { animation: none; }
.post-feed-view .card-overlay { position: absolute; inset: 0; background: var(--overlay); z-index: 1; }

.post-feed-view .mute-btn {
  position: absolute; top: 60px; right: 16px; z-index: 15;
  background: var(--action-bg); border: none; border-radius: 50%;
  width: 36px; height: 36px;
  color: var(--action-fg); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background .2s;
}
.post-feed-view .mute-btn:hover { background: rgba(0,0,0,0.65); }

/* card-info + tipografia */
.post-feed-view .card-info {
  position: absolute; bottom: 0; left: 0; right: 72px;
  z-index: 10; padding: 0 16px 24px;
}
.post-feed-view .vendor-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-feed-view .vendor-name-tag { font-size: 15px; font-weight: 700; color: var(--text); }
.post-feed-view .vendor-location {
  font-size: 12px; color: var(--muted); margin-left: auto;
  display: flex; align-items: center; gap: 4px;
}
.post-feed-view .vendor-location i { font-size: 11px; }
.post-feed-view .product-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px; letter-spacing: 0.5px; line-height: 1.1; margin-bottom: 8px;
  text-shadow: 0 2px 8px var(--text-shadow-dark);
}
.post-feed-view .product-desc {
  font-size: 13px; color: var(--text-on-image); line-height: 1.5;
  max-height: 52px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  margin-bottom: 12px;
}
.post-feed-view .product-desc.expanded { max-height: none; -webkit-line-clamp: unset; }
.post-feed-view .read-more {
  font-size: 12px; color: var(--muted); cursor: pointer;
  display: inline-block; margin-top: -8px; margin-bottom: 12px;
}
.post-feed-view .price-badge {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: var(--red); border-radius: 8px; padding: 4px 12px; margin-bottom: 10px;
}
.post-feed-view .price-badge .currency { font-size: 13px; font-weight: 700; color: #fff; }
.post-feed-view .price-badge .value    { font-size: 22px; font-weight: 700; color: #fff; font-family: 'Bebas Neue', sans-serif; }
.post-feed-view .price-badge .cents    { font-size: 13px; color: var(--text-on-image); }

/* barra de progresso (video) */
.post-feed-view .progress-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--border); z-index: 20;
}
.post-feed-view .progress-fill { height: 100%; background: var(--red); width: 0%; }
.post-feed-view .card.active .progress-fill { animation: pfv-progress 12s linear forwards; }
@keyframes pfv-progress { from { width: 0%; } to { width: 100%; } }

/* heart burst (duplo clique / like) */
.post-feed-view .heart-burst {
  position: absolute; z-index: 30; font-size: 80px; pointer-events: none;
  transform: translate(-50%,-50%) scale(0); opacity: 0;
}
.post-feed-view .heart-burst.animate { animation: pfv-heart .8s ease-out; }
@keyframes pfv-heart {
  0%   { transform: translate(-50%,-50%) scale(0); opacity: 0; }
  15%  { transform: translate(-50%,-50%) scale(1.3); opacity: 1; }
  40%  { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1.4); opacity: 0; }
}

/* ── action sidebar (espelho de action-sidebar.css) ── */
.post-feed-view .card-actions {
  position: absolute; right: 10px; bottom: 80px; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.post-feed-view .action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; position: relative;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; appearance: none; -webkit-appearance: none;
}
.post-feed-view .action-icon {
  width: var(--action-icon-size); height: var(--action-icon-size); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--action-fg);
  background: var(--action-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--action-border);
  transition: transform .15s, background .2s;
  position: relative; overflow: hidden;
}
.post-feed-view .action-btn:hover .action-icon { background: var(--action-bg-hover); transform: scale(1.08); }
.post-feed-view .action-btn:active .action-icon { transform: scale(0.92); }
.post-feed-view .action-label {
  font-size: 11px; font-weight: 600; color: var(--action-fg);
  text-shadow: 0 1px 4px var(--text-shadow-dark); letter-spacing: 0.2px;
}
.post-feed-view .vendor-avatar-wrap { position: relative; margin-bottom: 4px; }
.post-feed-view .vendor-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--action-fg); display: block;
}
.post-feed-view .follow-plus {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  border: 2px solid var(--bg); transition: background-color .2s; cursor: pointer;
  padding: 0; margin: 0; font-family: inherit; line-height: 1;
  appearance: none; -webkit-appearance: none;
}
.post-feed-view .follow-plus.following { background: var(--green); }
.post-feed-view .follow-plus.following::before { content: "✓"; font-size: 10px; }
.post-feed-view .follow-plus:not(.following)::before { content: "+"; }
.post-feed-view .action-btn.liked .action-icon { background: rgba(255,45,85,0.20); border-color: rgba(255,45,85,0.50); }
.post-feed-view .action-btn.liked .action-icon i { color: var(--action-liked); }
.post-feed-view .action-btn.saved .action-icon i { color: var(--action-saved); }