/*
 * Design system: páginas de descoberta.
 * Home, shorts, listagens de vídeos (latest/trending/top/category), busca,
 * hashtag, filmes e canais populares.
 *
 * Os templates dessas páginas recebem a classe .ds-discovery no contêiner
 * raiz; tudo aqui fica escopado nela (ou em :has() da página) para não
 * vazar para outras áreas, já que pages/*.css carregam em todas as páginas.
 */

/* =========================================================
 * Base compartilhada
 * ========================================================= */

.ds-discovery svg[stroke="currentColor"] {
  fill: none;
}

/* Grade responsiva de cards (substitui floats do Bootstrap) */
.ds-discovery .ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
  gap: var(--space-8) var(--space-4);
  margin: 0 0 var(--space-8);
}

.ds-discovery .ds-grid-shorts {
  --card-min: 180px;
}

.ds-discovery .ds-grid::before,
.ds-discovery .ds-grid::after {
  display: none;
}

.ds-discovery .ds-grid > [class*="col-"] {
  float: none;
  width: auto;
  min-width: 0;
  padding: 0;
  margin: 0;
}

.ds-discovery .ds-grid .video-latest-list.video-wrapper,
.ds-discovery .ds-grid .video-wrapper {
  height: auto;
  margin: 0 !important;
}

/* Thumb 16:9 sem depender de height fixo legado */
.ds-discovery .home-page-categories .videos .video-list .video-list-image a,
.ds-discovery .video-latest-list .video-thumb a {
  height: auto !important;
  padding: 0 !important;
  aspect-ratio: 16 / 9;
}

.ds-discovery .home-page-categories .videos .video-list .video-list-image a > img,
.ds-discovery .video-latest-list .video-thumb a > img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: cover;
}

.ds-discovery .video-latest-list.short .video-thumb a,
.ds-discovery .home-page-categories .videos .video-list.short .video-list-image a {
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-xl) !important;
}

/* Avatar da linha do card: o seletor legado ".video-list img" o estica */
.ds-discovery .pt-vcard-avatar img,
.ds-discovery .home-page-categories .videos .video-list .pt-vcard-avatar img {
  position: static !important;
  width: 36px !important;
  height: 36px !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: var(--radius-full) !important;
}

.ds-discovery .video-latest-list .video-title h4 {
  margin-top: 0;
}

.ds-discovery .video-latest-list .descc {
  display: none;
}

/* Paginação */
.ds-discovery .ds-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.ds-discovery .ds-pager .showing_pages {
  float: none !important;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.ds-discovery .ds-pager .pull-right {
  float: none !important;
}

.ds-discovery .ds-pager .pagination {
  display: flex;
  gap: var(--space-1);
  margin: 0;
}

.ds-discovery .ds-pager .pagination > li > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) !important;
  background: var(--background);
  color: var(--foreground);
  font-size: var(--text-sm);
}

.ds-discovery .ds-pager .pagination > li > a:hover {
  background: var(--accent);
}

.ds-discovery .ds-pager .pagination > li.active > a {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

.ds-discovery .ds-pager .pagination svg {
  width: 16px;
  height: 16px;
}

/* Chips (abas de filtro, filtros de busca) */
.ds-discovery .ds-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-discovery .ds-chip,
.ds-discovery .ds-chips > li > a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--background);
  color: var(--foreground);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.ds-discovery .ds-chip:hover,
.ds-discovery .ds-chips > li > a:hover {
  background: var(--accent);
  text-decoration: none;
}

.ds-discovery .ds-chips > li.selected > a,
.ds-discovery .ds-chips > li.active > a,
.ds-discovery input:checked + .ds-chip {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

.ds-discovery input:focus-visible + .ds-chip {
  box-shadow: var(--focus-ring);
}

.ds-discovery .ds-chips svg {
  width: 14px;
  height: 14px;
}

/* Toolbar (cabeçalho com ações à direita) */
.ds-discovery .pt_page_headr.ds-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.ds-discovery .ds-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* =========================================================
 * Home
 * ========================================================= */

/* Barra de categorias */
.ds-home .pt_sec_nav_cats {
  position: sticky;
  top: var(--header-h);
  z-index: var(--z-sticky);
  margin: -20px -15px 0;
  padding: var(--space-3) var(--space-4);
  background: var(--background) !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.ds-home .pt_sec_nav_cats .container-fluid {
  padding: 0;
}

/* Destaque */
.ds-home .ds-feat {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
  margin: var(--space-6) 0 var(--space-10);
}

.ds-home .ds-feat-media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--muted);
  isolation: isolate;
}

.ds-home .ds-feat-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter var(--duration) var(--ease);
}

.ds-home .ds-feat-media:hover img {
  filter: brightness(.92);
}

.ds-home .ds-feat-play {
  position: absolute;
  inset-block-end: var(--space-4);
  inset-inline-start: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--media-overlay);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.ds-home .ds-feat-play svg {
  width: 20px;
  height: 20px;
  margin-inline-start: 2px;
  fill: #fff !important;
}

.ds-home .ds-feat-duration {
  position: absolute;
  inset-block-end: var(--space-3);
  inset-inline-end: var(--space-3);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--media-overlay);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ds-home .ds-feat-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.ds-home .ds-feat-eyebrow {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
}

.ds-home .ds-feat-title {
  margin: 0;
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.ds-home .ds-feat-title a {
  color: var(--foreground);
  text-decoration: none;
}

.ds-home .ds-feat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.ds-home .ds-feat-channel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.ds-home .ds-feat-avatar img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--muted);
}

.ds-home .ds-feat-name {
  color: var(--foreground);
  font-size: var(--text-md);
  font-weight: 600;
  text-decoration: none;
}

.ds-home .ds-feat-sub {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ds-home .ds-feat-sub svg {
  display: none;
}

.ds-home .ds-feat-sub .btn-subscribe,
.ds-home .ds-feat-sub .btn-subscribed {
  display: inline-flex !important;
  align-items: center;
  height: 36px;
  line-height: 1 !important;
  margin: 0 !important;
}

.ds-home .ds-feat-desc {
  display: -webkit-box;
  max-width: 60ch;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.ds-home .ds-feat-desc a {
  color: var(--brand-text);
}

.ds-home .ds-feat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* Modal de compartilhar */
.ds-home .ds-copy-link {
  display: flex;
  gap: var(--space-2);
}

.ds-home .ds-copy-link input {
  flex: 1;
  min-width: 0;
}

.ds-home .ds-share-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.ds-home .ds-share-list .btn {
  justify-content: flex-start;
}

.ds-home .ds-share-list img {
  height: 20px;
}

/* Seções */
.ds-home .pt_home_top_m {
  margin: 0;
}

.ds-home .ds-sec {
  margin-bottom: var(--space-10);
}

.ds-home .ds-sec > .content,
.ds-home .ds-sec .content.pt_shadow {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ds-home .home-page-categories .title {
  margin-bottom: var(--space-4);
}

.ds-home .home-page-categories .title h4.ds-sec-title,
.ds-home .home-page-categories .title.white h4.ds-sec-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  color: var(--foreground) !important;
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ds-home .home-page-categories .title h4 > div {
  display: none;
}

.ds-home .view_more_link {
  float: none;
  margin-inline-start: auto;
  font-size: inherit;
}

.ds-home .view_more_link a.ds-sec-more,
.ds-home .home-page-categories .title.white .view_more_link a.ds-sec-more {
  display: inline-flex;
  min-height: 32px;
  padding: 0 var(--space-2) 0 var(--space-3);
  color: var(--muted-foreground) !important;
  font-size: var(--text-sm);
  font-weight: 500;
}

.ds-home .view_more_link a.ds-sec-more:hover {
  color: var(--foreground) !important;
}

.ds-home .view_more_link a.ds-sec-more svg {
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 0;
  background: none !important;
  color: currentColor;
  transform: none !important;
}

.ds-home .dark_hr {
  display: none;
}

/* Slick: gutter de 16px entre cards e setas discretas */
.ds-home .cus_slider,
.ds-home .cus_story_slider {
  margin: 0 -8px;
}

.ds-home .cus_slider .slick-slide,
.ds-home .cus_story_slider .slick-slide {
  padding: 0 8px;
}

.ds-home .home-page-categories .videos .video-list {
  margin-bottom: 0 !important;
}

.ds-home .slick-prev,
.ds-home .slick-next {
  top: calc((100% - 72px) / 2) !important;
  z-index: var(--z-raised);
  width: 36px !important;
  height: 36px !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-full) !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
  box-shadow: var(--shadow-sm) !important;
}

.ds-home .cus_story_slider .slick-prev,
.ds-home .cus_story_slider .slick-next {
  top: 50% !important;
}

.ds-home .slick-prev { left: -10px !important; }
.ds-home .slick-next { right: -10px !important; }

.ds-home .slick-prev svg,
.ds-home .slick-next svg {
  width: 18px !important;
  height: 18px !important;
  color: currentColor !important;
}

/* Shorts da home: título sobre o thumb */
.ds-home .home-page-categories .videos .video-list.short {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.ds-home .home-page-categories .videos .video-list.short .pt_vid_fixed_height {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: var(--space-10) var(--space-3) var(--space-3);
  background: linear-gradient(to top, var(--media-overlay), transparent);
  pointer-events: none;
}

.ds-home .home-page-categories .videos .video-list.short .pt_vid_fixed_height a {
  pointer-events: auto;
}

.ds-home .home-page-categories .videos .video-list.short .video-list-title h4 {
  margin: 0 0 2px;
  color: #fff !important;
  font-size: var(--text-base);
}

.ds-home .home-page-categories .videos .video-list.short .video-list-by,
.ds-home .home-page-categories .videos .video-list.short .video-list-by a,
.ds-home .home-page-categories .videos .video-list.short .video-list-by span {
  color: #fff !important;
  opacity: .85;
  font-size: var(--text-xs) !important;
}

.ds-home .home-page-categories .videos .video-list.short .video-list-by > span,
.ds-home .home-page-categories .videos .video-list.short .video-list-by > br {
  display: none;
}

.ds-home .home-page-categories .videos .video-list.short .duration {
  display: none;
}

.ds-home .home-page-categories .videos .video-list.short .shorts_badge {
  display: none;
}

/* Artigos na home */
.ds-home .pt_homep_articls .row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4);
  margin: 0;
}

.ds-home .pt_homep_articls .row::before,
.ds-home .pt_homep_articls .row::after {
  display: none;
}

.ds-home .pt_homep_articls .row > [class*="col-"] {
  width: auto;
  float: none;
  padding: 0;
}

@media (max-width: 1023px) {
  .ds-home .ds-feat {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
  }

  .ds-home .ds-feat-title {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 767px) {
  .ds-home .pt_sec_nav_cats {
    position: relative;
    top: 0;
    margin: -20px -16px 0;
    padding: var(--space-2) var(--space-4);
  }

  .ds-home .ds-feat {
    margin: var(--space-4) 0 var(--space-8);
  }

  .ds-home .ds-feat-title {
    font-size: var(--text-2xl);
  }

  .ds-home .ds-feat-actions .btn {
    flex: 1;
  }

  .ds-home .ds-sec {
    margin-bottom: var(--space-8);
  }
}

/* =========================================================
 * Listagens (latest / trending / top / category / hashtag)
 * ========================================================= */

.ds-discovery .ds-grid > .empty_state,
.ds-discovery .ds-grid > .no-content-found {
  grid-column: 1 / -1;
}

.ds-videos .tp_vid_fltr_tabs.ds-filter-bar {
  margin: 0 0 var(--space-6);
  overflow-x: auto;
  text-align: start;
  scrollbar-width: none;
}

.ds-videos .tp_vid_fltr_tabs.ds-filter-bar ul.ds-chips {
  display: flex;
  flex-wrap: nowrap;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ds-videos .tp_vid_fltr_tabs.ds-filter-bar ul li a {
  margin: 0;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
}

.ds-videos .tp_vid_fltr_tabs.ds-filter-bar ul li.selected a {
  background: var(--primary);
  color: var(--primary-foreground);
}

.ds-videos #sub_categories_ {
  margin: 0;
}

/* Hashtag: seção de shorts depois dos vídeos */
.ds-hashtag .ds-grid-shorts {
  margin-top: var(--space-4);
}

/* =========================================================
 * Busca
 * ========================================================= */

.ds-search .vid_srch_filtr {
  overflow: visible;
}

.ds-search .vid_srch_filtr .pt_forms.ds-filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--space-6);
  margin: 0 0 var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: none;
}

.ds-search .ds-filter-panel::before,
.ds-search .ds-filter-panel::after {
  display: none;
}

.ds-search .ds-filter-panel > .clear {
  display: none;
}

.ds-search .ds-filter-panel .ds-filter-group {
  width: auto;
  float: none;
  margin: 0;
  padding: 0 !important;
}

.ds-search .ds-filter-panel .ds-filter-group > label.col-md-12 {
  float: none;
  display: block;
  margin: 0 0 var(--space-3);
  padding: 0;
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
}

.ds-search .ds-filter-panel .ds-filter-group > .col-md-12 {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  float: none;
  padding: 0;
}

.ds-search .ds-filter-panel .ds-filter-group > .col-md-12 > div {
  width: auto;
  float: none;
  padding: 0;
}

.ds-search .ds-filter-panel label {
  position: relative;
  margin: 0;
}

.ds-search .vid_srch_filtr label span.ds-chip {
  color: var(--foreground);
  font-size: var(--text-sm);
}

.ds-search .vid_srch_filtr label input:checked + span.ds-chip {
  color: var(--primary-foreground);
  font-weight: 500;
}

.ds-search .ds-filter-panel .last-sett-btn {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: var(--space-4) 0 0 !important;
  border-top: 1px solid var(--border);
}

/* Resultado horizontal */
.ds-search .ds-search-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0 0 var(--space-8);
}

.ds-search .ds-search-results::before,
.ds-search .ds-search-results::after {
  display: none;
}

.ds-search .ds-search-results > .pt_srch_vids {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
}

.ds-search .pt_srch_vids .video-latest-list.ds-hcard {
  display: flex;
  gap: var(--space-4);
  margin: 0 !important;
}

.ds-search .pt_srch_vids .ds-hcard .video-thumb {
  flex: 0 0 auto;
  width: min(360px, 40%);
  max-width: none;
  margin: 0 !important;
}

.ds-search .ds-hcard-body {
  flex: 1 1 auto;
  min-width: 0;
}

.ds-search .pt_srch_vids .ds-hcard .video-title h4 {
  max-height: none;
  margin: 0 0 var(--space-1);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
}

.ds-search .pt_srch_vids .ds-hcard .video-info {
  margin: 0;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.ds-search .ds-hcard-meta,
.ds-search .ds-hcard-meta span {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.ds-search .pt_srch_vids .ds-hcard .video-info a.ds-hcard-channel {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-weight: 500;
}

.ds-search .pt_srch_vids .ds-hcard .video-info a.ds-hcard-channel:hover {
  color: var(--foreground);
}

.ds-search .pt_srch_vids .ds-hcard .video-info a.ds-hcard-channel img {
  width: 24px;
  height: 24px;
  margin: 0;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.ds-search .pt_srch_vids .ds-hcard .video-info p.ds-hcard-desc {
  display: -webkit-box;
  max-height: none;
  margin: var(--space-3) 0 0;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ds-search .ds-sec-head {
  margin-top: var(--space-4);
}

/* =========================================================
 * Cards de canal (canais populares, busca)
 * ========================================================= */

.ds-discovery .ds-channel-grid {
  --card-min: 300px;
  gap: var(--space-4);
}

.ds-discovery .ds-channel-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 100%;
  margin: 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: none;
}

.ds-discovery .ds-channel-avatar {
  flex-shrink: 0;
}

.ds-discovery .ds-channel-avatar img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--muted);
}

.ds-discovery .ds-channel-info {
  flex: 1 1 auto;
  min-width: 0;
}

.ds-discovery .ds-channel-info a {
  text-decoration: none;
}

.ds-discovery .ds-channel-info h4 {
  margin: 0;
  overflow: hidden;
  color: var(--foreground);
  font-size: var(--text-md);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-discovery .ds-channel-stats {
  display: flex;
  flex-direction: column;
  margin: 2px 0 0;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.ds-discovery .ds-channel-action {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-2);
}

.ds-discovery .ds-channel-action svg {
  display: none;
}

.ds-discovery .ds-channel-action .subs-amount {
  display: none !important;
}

.ds-discovery .ds-channel-action .btn-subscribe,
.ds-discovery .ds-channel-action .btn-subscribed {
  display: inline-flex !important;
  align-items: center;
  margin: 0 !important;
  line-height: 1 !important;
}

/* Canais populares */
.ds-channels .vid_pop_chnl_filtr {
  justify-content: flex-end;
  margin: 0;
  color: var(--foreground);
}

.ds-channels .vid_pop_chnl_filtr select {
  width: auto;
  min-width: 150px;
  height: 36px;
  margin: 0;
  border: 1px solid var(--input) !important;
  background-color: var(--background) !important;
  color: var(--foreground) !important;
  font-weight: 500;
}

.ds-channels .vid_pop_chnl_filtr select option {
  color: var(--foreground);
}

.ds-channels .vid_pop_chnl_filtr .btn {
  min-width: 0;
  height: 36px;
  margin: 0;
  padding: 0 var(--space-4);
  border: 0;
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
}

.ds-channels .ds-channel-grid {
  counter-reset: ds-rank;
}

.ds-channels .ds-channel-card::before {
  counter-increment: ds-rank;
  content: counter(ds-rank);
  flex-shrink: 0;
  width: 20px;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.ds-channels .ds-discovery-more {
  max-width: 240px;
  margin: var(--space-6) auto 0;
}

/* =========================================================
 * Filmes
 * ========================================================= */

.ds-movies .ds-movies-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.ds-movies .vid_move_filtr.ds-movies-filter {
  margin: 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  overflow: visible;
}

.ds-movies .ds-movies-filter .row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)) auto;
  gap: var(--space-3);
  align-items: end;
  margin: 0;
}

.ds-movies .ds-movies-filter .row::before,
.ds-movies .ds-movies-filter .row::after {
  display: none;
}

.ds-movies .ds-movies-filter .row > [class*="col-"] {
  width: auto;
  float: none;
  padding: 0;
}

.ds-movies .vid_move_filtr .pt_forms .form-group {
  margin: 0;
  padding: 0;
}

.ds-movies .vid_move_filtr .pt_forms .form-group label {
  display: block;
  margin: 0 0 var(--space-1);
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
}

.ds-movies .vid_move_filtr .pt_forms .form-group .input-group {
  position: relative;
  display: block;
}

.ds-movies .vid_move_filtr .pt_forms .form-group .input-group svg {
  display: none !important;
}

.ds-movies .vid_move_filtr .pt_forms .form-group input[type=text],
.ds-movies .vid_move_filtr .pt_forms .form-group input[type=number],
.ds-movies .vid_move_filtr .pt_forms .form-group select {
  height: 36px;
  border: 1px solid var(--input) !important;
  border-radius: var(--radius-md) !important;
  background-color: var(--background) !important;
  color: var(--foreground) !important;
}

/* Ícone de lupa como fundo do campo: sempre centralizado, sem depender do container */
.ds-movies .vid_move_filtr .pt_forms .form-group input[name="keyword"] {
  padding-inline-start: 36px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 12px center !important;
  background-size: 16px 16px !important;
}

[dir="rtl"] .ds-movies .vid_move_filtr .pt_forms .form-group input[name="keyword"] {
  background-position: right 12px center !important;
}

.ds-movies .vid_move_filtr .pt_forms .form-group button.btn {
  min-width: 0;
  height: 36px;
  line-height: 1;
  font-size: var(--text-base);
  border-radius: var(--radius-md) !important;
}

.ds-movies .ds-poster-grid {
  --card-min: 160px;
  gap: var(--space-6) var(--space-4);
}

.ds-movies .ds-poster {
  margin: 0;
}

.ds-movies .pt_mv_list_thumb {
  padding-bottom: 0;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) !important;
}

.ds-movies .pt_mv_list_thumb img {
  border-radius: 0;
  transition: filter var(--duration) var(--ease);
}

.ds-movies .pt_mv_list_thumb:hover img {
  filter: brightness(.92);
  transform: none;
}

.ds-movies .ds-poster-badges {
  position: absolute;
  inset: auto var(--space-2) var(--space-2) var(--space-2);
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.ds-movies .ds-poster-badges > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--media-overlay) !important;
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
}

.ds-movies .ds-poster-rating svg {
  width: 12px;
  height: 12px;
}

.ds-movies .ds-poster-badges .mv_qualt:empty,
.ds-movies .ds-poster-rating:empty {
  display: none;
}

.ds-movies .pt_mv_info_innr {
  padding-top: var(--space-3);
}

.ds-movies .pt_mv_info_innr h3 {
  margin: 0;
  overflow: hidden;
  font-size: var(--text-md);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-movies .pt_mv_info_innr > div {
  gap: var(--space-1);
  margin-top: 2px;
  font-size: var(--text-sm);
}

.ds-movies .pt_mv_info_innr > div .bold {
  margin: 0;
}

/* =========================================================
 * Shorts (player vertical)
 * ========================================================= */

body:has(.ds-shorts) {
  overflow: hidden;
}

body:has(.ds-shorts) .pt_footer,
body:has(.ds-shorts) .pt-site-footer,
body:has(.ds-shorts) .fixed-action-btn {
  display: none !important;
}

body:has(.ds-shorts) #main-container.container {
  width: 100%;
  padding: 0;
}

.ds-shorts {
  background: var(--background);
}

.ds-shorts .pt_shorts_page_title {
  align-items: center;
  padding: var(--space-4) var(--space-6);
  color: var(--foreground);
}

.ds-shorts .pt_shorts_page_title span {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ds-shorts .pt_shorts_page_title .btn {
  border: 1px solid var(--border);
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  line-height: 1;
}

.ds-shorts .pt_shorts_swipe .swiper-slide > .vid_bg {
  display: none;
}

.ds-shorts .pt_shorts_swipe .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) 0;
}

.ds-shorts .pt_shorts_swipe .swiper-wrapper .videocontainer {
  width: auto;
  max-width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--muted);
}

.ds-shorts .pt_shorts_swipe .swiper-wrapper video {
  object-fit: cover;
}

.ds-shorts .shorts_events.ds-shorts-overlay {
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-16) var(--space-3) var(--space-4);
  background: linear-gradient(to top, var(--media-overlay), transparent);
}

.ds-shorts .shorts_events > p {
  margin: 0;
  padding: 0;
  color: #fff;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.ds-shorts .shorts_events > p a {
  color: #fff;
  font-weight: 600;
}

.ds-shorts .ds-shorts-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: 0;
}

.ds-shorts .ds-shorts-actions > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ds-shorts .ds-shorts-actions > div > a {
  display: flex;
}

.ds-shorts .shorts_events .ds-shorts-actions svg {
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: var(--radius-full);
  background: color-mix(in oklch, var(--media-overlay) 60%, transparent);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color var(--duration) var(--ease);
}

.ds-shorts .ds-shorts-actions > div:hover svg {
  background: var(--media-overlay);
}

.ds-shorts .ds-shorts-actions > div.active svg {
  background: #fff;
  color: var(--primary);
}

html.dark .ds-shorts .ds-shorts-actions > div.active svg {
  color: var(--primary-foreground);
}

.ds-shorts .ds-shorts-actions > div p {
  margin: 0;
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ds-shorts .pt_shorts_swipe .swiper-wrapper .user_avatar {
  padding: 0;
}

.ds-shorts .pt_shorts_swipe .swiper-wrapper .user_avatar img {
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
}

body .ds-shorts .pt_shorts_swipe .swiper-button-prev,
body .ds-shorts .pt_shorts_swipe .swiper-button-next {
  right: var(--space-8);
  inset-inline-end: var(--space-8);
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--foreground);
}

body .ds-shorts .pt_shorts_swipe .swiper-button-next:after,
body .ds-shorts .pt_shorts_swipe .swiper-button-prev:after {
  font-size: 16px;
}

body .ds-shorts .pt_shorts_swipe .swiper-button-disabled {
  opacity: .35;
}

.ds-w-full {
  width: 100%;
}

@media (max-width: 767px) {
  .ds-shorts .pt_shorts_page_title {
    padding: var(--space-3) var(--space-4);
    color: #fff;
  }

  .ds-shorts .pt_shorts_page_title .btn {
    border-color: transparent;
    background: color-mix(in oklch, var(--media-overlay) 60%, transparent) !important;
    color: #fff !important;
  }

  .ds-shorts .pt_shorts_swipe .swiper-slide {
    padding: 0;
  }

  .ds-shorts .pt_shorts_swipe .swiper-wrapper .videocontainer {
    width: 100%;
    aspect-ratio: auto;
    border-radius: 0;
  }

  body .ds-shorts .pt_shorts_swipe .swiper-button-prev,
  body .ds-shorts .pt_shorts_swipe .swiper-button-next {
    display: none;
  }
}

/* Gaveta de comentários dos shorts */
#shorts_comments_modal.ds-drawer {
  padding: 0 !important;
  overflow: hidden;
}

#shorts_comments_modal.ds-drawer .modal-dialog {
  position: fixed;
  inset: var(--header-h) 0 0 auto;
  width: 420px;
  max-width: 100%;
  margin: 0;
  transform: translateX(100%);
  transition: transform .25s var(--ease);
}

#shorts_comments_modal.ds-drawer.in .modal-dialog {
  transform: none;
}

#shorts_comments_modal.ds-drawer .modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 0;
  border-inline-start: 1px solid var(--border);
  border-radius: 0 !important;
  box-shadow: var(--shadow-lg);
}

#shorts_comments_modal.ds-drawer .modal-header,
#shorts_comments_modal.ds-drawer .modal-title {
  flex-shrink: 0;
  background: transparent !important;
  border-bottom: 1px solid var(--border);
}

#shorts_comments_modal.ds-drawer .modal-body {
  flex: 1;
  overflow-y: auto;
}

#shorts_comments_modal.ds-drawer .pt_blogcomm_combo {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

#shorts_comments_modal.ds-drawer .pt_blogcomm_combo .avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
}

#shorts_comments_modal.ds-drawer .pt_blogcomm_combo textarea {
  flex: 1;
  min-height: 40px;
  resize: vertical;
}

#shorts_comments_modal.ds-drawer .pt_blogcomm_combo .btn {
  float: none !important;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  #shorts_comments_modal.ds-drawer .modal-dialog {
    inset: auto 0 0 0;
    width: 100%;
    height: 75vh;
    transform: translateY(100%);
  }

  #shorts_comments_modal.ds-drawer .modal-content {
    border-inline-start: 0;
    border-top: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
  }
}

/* =========================================================
 * Responsivo geral
 * ========================================================= */

@media (max-width: 1279px) {
  .ds-movies .ds-movies-filter .row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ds-movies .ds-movies-filter .row > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .ds-discovery .ds-grid {
    gap: var(--space-6) var(--space-4);
  }

  .ds-discovery .ds-grid-shorts,
  .ds-movies .ds-poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ds-search .vid_srch_filtr .pt_forms.ds-filter-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-4);
  }

  .ds-search .pt_srch_vids .video-latest-list.ds-hcard {
    flex-direction: column;
    gap: var(--space-3);
  }

  .ds-search .pt_srch_vids .ds-hcard .video-thumb {
    width: 100%;
  }

  .ds-search .pt_srch_vids .ds-hcard .video-title h4 {
    font-size: var(--text-md);
  }

  .ds-search .ds-hcard-desc {
    display: none !important;
  }

  .ds-movies .ds-movies-filter .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ds-channels .vid_pop_chnl_filtr {
    width: 100%;
    justify-content: stretch;
  }

  .ds-channels .vid_pop_chnl_filtr select {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 767px) {
  body .ds-shorts .pt_shorts_swipe {
    height: calc(var(--vh, 1vh) * 100 - var(--header-h) - var(--bottom-nav-h) - env(safe-area-inset-bottom));
  }

  .ds-movies .ds-movies-filter .row > :last-child {
    grid-column: 1 / -1;
  }

  .ds-channels .vid_pop_chnl_filtr {
    flex-direction: row !important;
    flex-wrap: wrap;
  }

  .ds-channels .vid_pop_chnl_filtr select {
    flex: 1 1 140px;
    width: auto !important;
  }

  .ds-channels .vid_pop_chnl_filtr .btn {
    flex: 1 1 100%;
  }
}
