/* ── Layout principal ── */
html, body { height: 100%; overflow: hidden; }

#app {
  display: flex;
  height: 100dvh;
  width: 100%;
  align-items: stretch;
}

/* ── Nav esquerda (widescreen) ── */
#nav-left {
  width: 240px; flex-shrink: 0;
  display: flex; flex-direction: column;
  padding: 28px 20px;
  border-right: 1px solid rgba(255,255,255,0.06);
  background: rgba(8,8,8,0.96);
  z-index: 10;
}
#nav-left .logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px; letter-spacing: 2px;
  color: var(--text); margin-bottom: 36px; line-height: 1;
}
#nav-left .logo span { color: var(--red); }
#nav-left nav { display: flex; flex-direction: column; gap: 4px; }
#nav-left nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 12px;
  color: var(--muted); text-decoration: none;
  font-size: 15px; font-weight: 500;
  transition: all .2s; cursor: pointer;
}
#nav-left nav a:hover,
#nav-left nav a.active { background: rgba(255,255,255,0.08); color: var(--text); }
#nav-left nav a.active { color: var(--red); }
#nav-left nav a i { width: 22px; text-align: center; font-size: 17px; }
#nav-left .divider { height: 1px; background: rgba(255,255,255,0.07); margin: 16px 0; }
#nav-left .trending-title {
  font-size: 11px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted);
  padding: 0 14px; margin-bottom: 10px;
}
#nav-left .tag-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; }
#nav-left .tag {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.08); color: var(--muted);
  cursor: pointer; transition: all .2s;
}
#nav-left .tag:hover { background: rgba(255,45,85,0.2); color: var(--red); }

/* ── Feed central ── */
#feed-wrap {
  flex: 1; display: flex;
  justify-content: center; align-items: stretch;
  position: relative; overflow: hidden;
}
#feed {
  width: var(--feed-w); height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* ── Painel direito (widescreen) ── */
#panel-right {
  width: 320px; flex-shrink: 0;
  display: flex; flex-direction: column;
  padding: 28px 24px;
  border-left: 1px solid rgba(255,255,255,0.06);
  background: rgba(8,8,8,0.96);
  overflow-y: auto;
}
#panel-right .panel-title {
  font-size: 11px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
}
.suggested-vendor {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
}
.suggested-vendor:last-child { border-bottom: none; }
.sv-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.1);
}
.sv-info { flex: 1; min-width: 0; }
.sv-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-cat  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sv-follow-btn {
  font-size: 12px; font-weight: 600; padding: 6px 14px;
  border-radius: 20px; border: 1.5px solid var(--red);
  color: var(--red); background: transparent; cursor: pointer;
  transition: all .2s; white-space: nowrap;
}
.sv-follow-btn:hover,
.sv-follow-btn.following { background: var(--red); color: #fff; }
.sv-follow-btn.following { background: rgba(255,45,85,0.15); color: var(--red); }

/* ── Card ── */
.card {
  width: var(--feed-w); height: 100dvh;
  scroll-snap-align: start;
  position: relative; overflow: hidden;
  background: var(--surface);
  display: flex; flex-direction: column;
}
.card-media-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  z-index: 0;
  transform: scale(1.05);
  transition: transform 6s ease;
}
.card.active .card-media-bg { transform: scale(1); }
.card-overlay {
  position: absolute; inset: 0;
  background: var(--overlay); z-index: 1;
}

/* ── Top bar do card ── */
.card-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: 16px 16px 0;
}
.tab-btn {
  font-size: 15px; font-weight: 600; color: var(--muted);
  background: none; border: none; cursor: pointer;
  padding: 6px 4px; border-bottom: 2px solid transparent;
  transition: all .2s; font-family: 'DM Sans', sans-serif;
}
.tab-btn.active { color: var(--text); border-color: var(--text); }
.tab-sep { color: rgba(255,255,255,0.2); font-size: 14px; }
.search-btn {
  margin-left: auto; background: none; border: none;
  color: var(--text); font-size: 18px; cursor: pointer; padding: 6px;
}
.notif-btn {
  background: none; border: none;
  color: var(--text); font-size: 18px; cursor: pointer; padding: 6px;
  position: relative;
}
.notif-dot {
  width: 8px; height: 8px; background: var(--red);
  border-radius: 50%; position: absolute; top: 5px; right: 5px;
}

/* ── Informação do card (rodapé esquerdo) ── */
.card-info {
  position: absolute; bottom: 0; left: 0; right: 72px;
  z-index: 10; padding: 0 16px 24px;
}
.vendor-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.vendor-name-tag { font-size: 15px; font-weight: 700; color: var(--text); }
.vendor-badge {
  width: 16px; height: 16px; background: var(--blue);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #fff; flex-shrink: 0;
}
.vendor-location {
  font-size: 12px; color: var(--muted); margin-left: auto;
  display: flex; align-items: center; gap: 4px;
}
.vendor-location i { font-size: 11px; }
.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 rgba(0,0,0,0.6);
}
.product-desc {
  font-size: 13px; color: rgba(255,255,255,0.85); line-height: 1.5;
  max-height: 52px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  margin-bottom: 12px;
}
.product-desc.expanded { max-height: none; -webkit-line-clamp: unset; }
.read-more {
  font-size: 12px; color: var(--muted); cursor: pointer;
  display: inline-block; margin-top: -8px; margin-bottom: 12px;
}
.tag-row { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
.pill {
  font-size: 11px; padding: 3px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.12); color: var(--muted);
  white-space: nowrap; font-weight: 500;
}
.price-badge {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: var(--red); border-radius: 8px;
  padding: 4px 12px; margin-bottom: 10px;
}
.price-badge .currency { font-size: 13px; font-weight: 700; color: #fff; }
.price-badge .value    { font-size: 22px; font-weight: 700; color: #fff; font-family: 'Bebas Neue', sans-serif; }
.price-badge .cents    { font-size: 13px; color: rgba(255,255,255,0.7); }
.price-badge .discount {
  font-size: 11px; background: rgba(0,0,0,0.3); color: var(--yellow);
  padding: 1px 6px; border-radius: 4px; margin-left: 4px;
}
.music-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.music-icon { color: var(--muted); font-size: 13px; animation: spin 4s linear infinite; }
.music-name {
  font-size: 12px; color: var(--muted);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 200px;
}

/* ── Barra de progresso ── */
.progress-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: rgba(255,255,255,0.15); z-index: 20;
}
.progress-fill { height: 100%; background: var(--red); width: 0%; transition: width .1s linear; }

/* ── Loading do card ── */
.card-loading {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}

/* ── Skeleton de carregamento ── */
.card-skeleton {
  background: var(--surface);
  overflow: hidden;
  pointer-events: none;
}
.card-skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Heart burst ── */
.heart-burst {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0);
  font-size: 80px; color: var(--red);
  pointer-events: none; z-index: 50; opacity: 0;
}
.heart-burst.animate { animation: heartBurst .6s cubic-bezier(0.36,0.07,0.19,0.97); }

/* ── Nav mobile ── */
#mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(8,8,8,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  flex-direction: row; justify-content: space-around; align-items: center;
}
.mob-nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 22px; padding: 4px 12px;
  transition: color .2s;
}
.mob-nav-btn.active { color: var(--text); }
.mob-nav-btn.active.center { color: var(--red); }
.mob-nav-label { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }
.mob-nav-btn.center .action-icon {
  width: 42px; height: 28px; border-radius: 8px;
  background: var(--red); display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}

/* ── Widescreen ── */
@media (min-width: 768px) {
  #mobile-nav { display: none !important; }
  #nav-left   { display: flex; }
  #panel-right { display: flex; }
}

/* ── Mobile ── */
@media (max-width: 767px) {
  :root { --feed-w: 100vw; }
  #app { flex-direction: column; }
  #nav-left, #panel-right { display: none; }
  #mobile-nav { display: flex; }
  #feed { height: calc(100dvh - 60px - env(safe-area-inset-bottom)); width: 100vw; }
  .card { width: 100vw; height: calc(100dvh - 60px - env(safe-area-inset-bottom)); }
  .card-topbar { display: none; }
}
