/* ═══════════════════════════════════════════════
    SYNERGYM TV — Mobile-First Stylesheet
    Branding: Negro #0A0A0A + Naranja #FF6600
    Tipografía: Montserrat (display) + Open Sans (body)
   ═══════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  /* Synergym brand */
--brand: #00A896;
--brand-dark: #006660;
--brand-light: #00C9B8;
--brand-glow: rgba(0,168,150,.22);

  /* Escala de grises */
  --bg:            #0A0A0A;
  --surface-1:     #141414;
  --surface-2:     #1E1E1E;
  --surface-3:     #282828;
  --border:        rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.15);
  --text-primary:  #FFFFFF;
  --text-secondary:#B0B0B0;
  --text-muted:    #666666;

  /* Tipografía */
  --font-display:  'Montserrat', sans-serif;
  --font-body:     'Open Sans', sans-serif;

  /* Layout */
  --header-h:      56px;
  --bottom-nav-h:  60px;
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
  --page-px:       16px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     14px;
  --radius-xl:     20px;

  /* Motion */
  --ease:          cubic-bezier(.25,.46,.45,.94);
  --ease-spring:   cubic-bezier(.34,1.56,.64,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  /* Espacio para bottom nav en móvil */
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
select { font-family: inherit; }
input { font-family: inherit; }

/* ════════════════════════════════════════════
   HEADER
════════════════════════════════════════════ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-px);
}

/* Logo */
.header__logo { display: flex; align-items: center; }
.logo-img {
  /* Móvil: compacto para que quepa bien en el header de 56px */
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
  /* Sin fondo — la imagen ya tiene fondo transparente (removebg) */
  filter: brightness(1);
  transition: opacity .15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-drag: none;
}
.header__logo:active .logo-img { opacity: .7; }

/* Acciones header */
.header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: var(--surface-2); color: var(--text-primary); }
.icon-btn svg { width: 20px; height: 20px; }

/* Hamburger */
.btn-menu {
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background .15s;
}
.btn-menu span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .25s;
  pointer-events: none;
}
.btn-menu.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.btn-menu.open span:nth-child(2) { opacity: 0; }
.btn-menu.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Search panel */
.header__search {
  height: 0;
  overflow: hidden;
  transition: height .25s var(--ease);
  background: var(--surface-1);
  border-top: 1px solid transparent;
}
.header__search.open {
  height: 56px;
  border-top-color: var(--border);
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 var(--page-px);
}
.search-bar svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-clear {
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.search-clear.visible { opacity: 1; pointer-events: all; }

/* ════════════════════════════════════════════
   DRAWER (nav lateral móvil)
════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 299;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  z-index: 300;
  width: min(300px, 85vw);
  height: 100dvh;
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s var(--ease);
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--page-px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer__title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: white;
}

.drawer__cats { padding: 12px 0; flex: 1; }
.drawer-cat { margin-bottom: 2px; }
.drawer-cat__btn {
  display: flex;
  align-items: start;
  width: 100%;
  padding: 12px var(--page-px);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.drawer-cat__btn:active,
.drawer-cat__btn.active { color: var(--brand); background: rgba(0, 255, 213, 0.08); }
.drawer-cat__icon { font-size: 18px; width: 24px; text-align: center; }
.drawer-cat__arrow {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  transition: transform .2s;
}
.drawer-cat.open .drawer-cat__arrow { transform: rotate(90deg); }

.drawer-subcats {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s var(--ease);
  background: rgba(0,0,0,.2);
}
.drawer-cat.open .drawer-subcats { max-height: 400px; }
.drawer-subcat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px var(--page-px) 10px 52px;
  font-size: 14px;
  color: var(--text-muted);
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}
.drawer-subcat-btn::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--surface-3);
  flex-shrink: 0;
}
.drawer-subcat-btn.active { color: var(--brand); }
.drawer-subcat-btn.active::before { background: var(--brand); }

.drawer__footer {
  padding: 16px var(--page-px);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}
.drawer__footer a { font-size: 12px; color: var(--text-muted); transition: color .15s; }
.drawer__footer a:active { color: var(--brand); }

/* ════════════════════════════════════════════
  HERO
════════════════════════════════════════════ */
.hero {
  position: relative;
  margin-top: var(--header-h);
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--surface-1);
}
.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 100% at 100% 50%, rgba(0, 255, 255, 0.18) 0%, transparent 65%),
    repeating-linear-gradient(-50deg, transparent, transparent 30px, rgba(255,102,0,.025) 30px, rgba(255,102,0,.025) 31px);
}
/* Franja naranja izquierda — elemento de marca Synergym */
.hero::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--brand);
}
.hero__content {
  position: relative;
  z-index: 2;
  padding: 32px var(--page-px) 28px calc(var(--page-px) + 4px);
  animation: fadeUp .6s var(--ease) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 40px;
  margin-bottom: 10px;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 8vw, 48px);
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -.01em;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.hero__title em { font-style: normal; color: var(--brand); }
.hero__desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  max-width: 320px;
  line-height: 1.5;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  transition: background .15s, transform .15s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { background: var(--brand-dark); transform: scale(.97); }

/* ════════════════════════════════════════════
   CHIPS BAR (categorías y subcategorías)
════════════════════════════════════════════ */
.chips-bar {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips-bar::-webkit-scrollbar { display: none; }
.chips-bar--sub {
  background: var(--bg);
  border-bottom-color: var(--border);
}
.chips {
  display: flex;
  gap: 8px;
  padding: 10px var(--page-px);
  width: max-content;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 40px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  background: transparent;
  transition: color .15s, background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.chip:active { transform: scale(.96); }
.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.chip--sub.active {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand);
}
.chip__icon { font-size: 14px; }

/* ════════════════════════════════════════════
   TOOLBAR
════════════════════════════════════════════ */
.toolbar {
  padding: 12px var(--page-px) 8px;
}
.toolbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.toolbar__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.toolbar__count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.sort-select {
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

/* ════════════════════════════════════════════
   VIDEO GRID
════════════════════════════════════════════ */
.main {
  padding: 4px var(--page-px) 24px;
}
.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Video Card ── */
.video-card {
  background: var(--surface-1);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color .2s;
  animation: cardIn .35s var(--ease) both;
  -webkit-tap-highlight-color: transparent;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.video-card:active { opacity: .85; }

.video-card__thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface-3);
  overflow: hidden;
}
.video-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}
.thumb-placeholder svg { color: var(--surface-3); width: 32px; height: 32px; }

.video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .2s;
}
.video-card:active .video-card__play,
.video-card:focus .video-card__play { opacity: 1; }
.play-circle {
  width: 40px;
  height: 40px;
  background: var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255,102,0,.5);
}
.play-circle svg { width: 16px; height: 16px; color: #fff; margin-left: 2px; }

.video-card__duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,.8);
  color: #fff;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: .03em;
}

.video-card__info { padding: 10px 10px 12px; }

.video-card__badges {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.badge {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 40px;
}
.badge--cat  { background: rgba(0, 255, 255, 0.15); color: var(--brand-light); }
.badge--sub  { background: var(--surface-3); color: var(--text-muted); }

.video-card__title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card__meta {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
}
.video-card__meta span {
  display: flex;
  align-items: center;
  gap: 3px;
}
.video-card__meta svg { width: 10px; height: 10px; }

/* ── No results ── */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.no-results p {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 14px;
}

/* ════════════════════════════════════════════
   BOTTOM NAV
════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 150;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
}
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.bottom-nav__item svg { width: 20px; height: 20px; }
.bottom-nav__item.active { color: var(--brand); }
.bottom-nav__item:active { opacity: .7; }

/* ════════════════════════════════════════════
   MODAL
════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,.9);
  display: flex;
  align-items: flex-end; /* sheet desde abajo en móvil */
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--surface-1);
  width: 100%;
  max-height: 96dvh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(40px);
  transition: transform .3s var(--ease);
  scrollbar-width: none;
}
.modal::-webkit-scrollbar { display: none; }
.modal-overlay.open .modal { transform: translateY(0); }

/* Drag handle */
.modal::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: var(--surface-3);
  border-radius: 4px;
  margin: 12px auto 0;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 32px;
  height: 32px;
  background: var(--surface-3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.modal__close:active { background: var(--brand); color: #fff; }

.modal__player {
  background: #000;
  aspect-ratio: 16/9;
  width: 100%;
  margin-top: 8px;
}
.modal__player iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.modal__body {
  padding: 16px var(--page-px) 12px;
  border-bottom: 1px solid var(--border);
}
.modal__badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.modal__views {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}
.modal__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
}
.modal__desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.modal__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.modal__tags .tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 40px;
}

.modal__related { padding: 16px var(--page-px) 24px; }
.modal__related-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.related-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.related-scroll::-webkit-scrollbar { display: none; }
.related-card {
  flex-shrink: 0;
  width: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s;
}
.related-card:active { border-color: var(--brand); opacity: .8; }
.related-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.related-card__info { padding: 6px 8px 8px; }
.related-card__info h4 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-card__info p {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════ */
.footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  padding: 20px var(--page-px);
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}
.footer__copy { font-size: 11px; color: var(--text-muted); }
.footer__links { display: flex; gap: 16px; }
.footer__links a { font-size: 11px; color: var(--text-muted); }

/* ════════════════════════════════════════════
   SCROLLBAR (desktop)
════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 5px; }

/* ════════════════════════════════════════════
   STAGGER CARDS
════════════════════════════════════════════ */
.video-card:nth-child(1)  { animation-delay: .02s; }
.video-card:nth-child(2)  { animation-delay: .04s; }
.video-card:nth-child(3)  { animation-delay: .07s; }
.video-card:nth-child(4)  { animation-delay: .09s; }
.video-card:nth-child(5)  { animation-delay: .12s; }
.video-card:nth-child(6)  { animation-delay: .14s; }
.video-card:nth-child(7)  { animation-delay: .17s; }
.video-card:nth-child(8)  { animation-delay: .19s; }
.video-card:nth-child(9)  { animation-delay: .22s; }
.video-card:nth-child(10) { animation-delay: .24s; }

/* ════════════════════════════════════════════
   TABLET  ≥ 600px
════════════════════════════════════════════ */
@media (min-width: 600px) {
  :root { --page-px: 20px; }

  .logo-img { height: 36px; max-width: 180px; }

  .video-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }

  .hero { min-height: 240px; }
  .hero__content { padding: 48px var(--page-px) 36px; }

  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

/* ════════════════════════════════════════════
   DESKTOP  ≥ 960px
════════════════════════════════════════════ */
@media (min-width: 960px) {
  :root {
    --header-h:  64px;
    --page-px:   32px;
  }

  /* Header desktop: logo + nav inline */
  .header__inner { max-width: 1400px; margin: 0 auto; gap: 32px; }
  .logo-img { height: 40px; max-width: 200px; }
  .btn-menu { display: none; }
  .icon-btn[aria-label="Buscar"] { display: none; }

  /* Search siempre visible */
  .header__search {
    height: auto !important;
    overflow: visible;
    background: none;
    border: none;
    position: absolute;
    right: 200px;
    top: 50%;
    transform: translateY(-50%);
    width: 260px;
  }
  .header__search .search-bar {
    height: 38px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 0 14px;
    transition: border-color .2s;
  }
  .header__search .search-bar:focus-within { border-color: var(--brand); }

  /* Nav inline desktop */
  .header__inner::after {
    content: '';
    display: none; /* no necesitamos añadir nav; el drawer queda solo en móvil */
  }

  /* Main layout: sin bottom nav */
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }

  /* Grid más amplia */
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
  }
  .main { padding: 8px var(--page-px) 40px; max-width: 1400px; margin: 0 auto; }

  /* Chips */
  .chips-bar { background: var(--surface-1); }
  .chips { padding: 12px var(--page-px); }
  .chip { font-size: 12px; padding: 7px 16px; }

  /* Toolbar */
  .toolbar { padding: 16px var(--page-px) 10px; max-width: 1400px; margin: 0 auto; }
  .toolbar__title { font-size: 22px; }

  /* Hero */
  .hero { min-height: 320px; }
  .hero__content { padding: 64px var(--page-px) 56px; }

  /* Modal: centrado en desktop */
  .modal-overlay { align-items: center; justify-content: center; padding: 24px; }
  .modal {
    max-width: 860px;
    max-height: 90dvh;
    border-radius: var(--radius-xl);
  }
  .modal::before { display: none; }
  .modal__title { font-size: 22px; }

  /* Card hover effects en desktop */
  .video-card { transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
  .video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(255,102,0,.2);
    border-color: rgba(255,102,0,.35);
  }
  .video-card:active { opacity: 1; }
  .video-card:hover .video-card__play { opacity: 1; }

  /* Footer */
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* ════════════════════════════════════════════
   WIDE  ≥ 1200px
════════════════════════════════════════════ */
@media (min-width: 1200px) {
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* ════════════════════════════════════════════
   PANEL DE ADMINISTRACIÓN
════════════════════════════════════════════ */

/* Overlay */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  display: flex;
  align-items: flex-end;
}
.admin-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Panel */
.admin-panel {
  background: var(--surface-1);
  width: 100%;
  max-height: 95dvh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(40px);
  transition: transform .3s var(--ease);
  overflow: hidden;
}
.admin-overlay.open .admin-panel { transform: translateY(0); }

/* Header */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--page-px) 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
/* Drag handle */
.admin-panel::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: var(--surface-3);
  border-radius: 4px;
  margin: 12px auto 0;
  flex-shrink: 0;
}
.admin-header__left { display: flex; flex-direction: column; gap: 2px; }
.admin-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-primary);
}
.admin-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

/* Tabs */
.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.admin-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* Content */
.admin-content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 16px var(--page-px) 32px;
}
.admin-content::-webkit-scrollbar { display: none; }
.admin-content.hidden { display: none; }

/* Admin search & filter */
.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 40px;
  margin-bottom: 10px;
}
.admin-search svg { color: var(--text-muted); flex-shrink: 0; }
.admin-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
}
.admin-filter-row {
  margin-bottom: 14px;
}
.admin-filter-row select {
  width: 100%;
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}

/* Admin list */
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: border-color .15s;
}
.admin-item:hover { border-color: var(--border-strong); }
.admin-item__thumb {
  width: 72px;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-3);
  flex-shrink: 0;
}
.admin-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-item__info { flex: 1; min-width: 0; }
.admin-item__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.admin-item__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-item__meta .badge { font-size: 9px; }
.admin-item__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.btn-icon-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
  color: var(--text-muted);
}
.btn-icon-sm:active { opacity: .7; }
.btn-icon-sm--edit:hover,
.btn-icon-sm--edit:active { background: rgba(255,102,0,.15); color: var(--brand); }
.btn-icon-sm--del:hover,
.btn-icon-sm--del:active  { background: rgba(220,50,50,.15); color: #E05555; }
.btn-icon-sm svg { width: 14px; height: 14px; }

.admin-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.admin-empty p { font-size: 13px; margin-top: 8px; }

/* ── Formulario ── */
.form-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
}
.form-section__title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-section__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}
.form-section__desc strong { color: var(--text-secondary); }

.form-group { margin-bottom: 12px; }
.form-group:last-child { margin-bottom: 0; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.required { color: var(--brand); }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--brand); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }
.form-select option { background: var(--surface-2); }

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}

/* Iframe preview */
.iframe-preview {
  margin-top: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.iframe-preview__screen {
  aspect-ratio: 16/9;
  width: 100%;
}
.iframe-preview__screen iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.iframe-preview__clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  transition: color .15s;
}
.iframe-preview__clear:hover { color: #E05555; }

/* Form actions */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  transition: background .15s, color .15s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:active { background: var(--surface-2); }
.btn-ghost {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-ghost:active { background: var(--surface-2); }
.form-actions .btn-primary {
  flex: 2;
  justify-content: center;
  padding: 12px;
  font-size: 13px;
}

/* Toast notificación */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 600;
  background: var(--surface-3);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .25s, transform .25s var(--ease);
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast--success { border-color: #3D9E6A; color: #5CCC94; }
.toast--error   { border-color: #9E3D3D; color: #E05555; }

/* Confirm dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }
.confirm-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  transform: scale(.95);
  transition: transform .2s var(--ease);
}
.confirm-overlay.open .confirm-box { transform: scale(1); }
.confirm-box__icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}
.confirm-box h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.confirm-box p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}
.confirm-box__actions { display: flex; gap: 10px; }
.btn-danger {
  flex: 1;
  padding: 11px;
  background: #9E3D3D;
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-danger:active { background: #7A2E2E; }
.confirm-box__actions .btn-ghost { flex: 1; }

/* Desktop: panel centrado */
@media (min-width: 960px) {
  .admin-overlay { align-items: center; justify-content: center; padding: 24px; }
  .admin-panel {
    max-width: 640px;
    max-height: 88dvh;
    border-radius: var(--radius-xl);
    width: 100%;
  }
  .admin-panel::before { display: none; }
  .toast { bottom: 24px; }
}

/* ════════════════════════════════════════════
   MODAL CONTRASEÑA ADMIN
════════════════════════════════════════════ */
.pwd-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.pwd-overlay.open { opacity: 1; pointer-events: all; }

.pwd-box {
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 32px 24px 28px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  position: relative;
  transform: scale(.94) translateY(10px);
  transition: transform .25s var(--ease);
}
.pwd-overlay.open .pwd-box { transform: scale(1) translateY(0); }

.pwd-box__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.pwd-box__close:hover { background: var(--surface-2); color: var(--text-primary); }

.pwd-box__icon { font-size: 36px; margin-bottom: 14px; display: block; }

.pwd-box__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.pwd-box__desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.pwd-input-wrap {
  position: relative;
  margin-bottom: 8px;
}
.pwd-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  padding: 11px 44px 11px 14px;
  outline: none;
  transition: border-color .15s;
  font-family: var(--font-body);
  letter-spacing: .1em;
}
.pwd-input:focus { border-color: var(--brand); }
.pwd-input.shake {
  animation: shake .35s var(--ease);
  border-color: #E05555;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.pwd-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: color .15s;
  display: flex; align-items: center;
}
.pwd-toggle:hover { color: var(--text-primary); }

.pwd-error {
  font-size: 12px;
  color: #E05555;
  min-height: 16px;
  margin-bottom: 16px;
  transition: opacity .2s;
}

.pwd-submit {
  width: 100%;
  justify-content: center;
  padding: 13px;
  font-size: 14px;
  margin-bottom: 16px;
}

.pwd-hint {
  font-size: 11px;
  color: var(--text-muted);
  opacity: .5;
}

/* Indicador de taps en el logo */
.logo-tap-indicator {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 12px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 190;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  white-space: nowrap;
}
.logo-tap-indicator.show { opacity: 1; }

/* ════════════════════════════════════════════
   THUMBNAIL PICKER
════════════════════════════════════════════ */
.thumb-mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 10px;
}
.thumb-mode-btn {
  flex: 1;
  padding: 7px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: background .15s, color .15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.thumb-mode-btn.active {
  background: var(--brand);
  color: #fff;
}

.thumb-mode-panel { }
.thumb-mode-panel.hidden { display: none; }

.thumb-auto-info {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--surface-1);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
}

/* Upload area */
.thumb-upload-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.thumb-upload-area:hover,
.thumb-upload-area:active { border-color: var(--brand); }

.thumb-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 16px;
  color: var(--text-muted);
}
.thumb-upload-placeholder p {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.thumb-upload-placeholder span { font-size: 11px; }

.thumb-upload-preview { position: relative; }
.thumb-upload-preview.hidden { display: none; }
.thumb-upload-preview img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.thumb-upload-remove {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 40px;
  transition: background .15s;
}
.thumb-upload-remove:hover { background: rgba(220,50,50,.85); }

/* URL preview */
.thumb-url-preview {
  margin-top: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.thumb-url-preview img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
