/* =============================================================================
 * SONOYA - nb-video-player.css
 * -----------------------------------------------------------------------------
 * Lecteur video produit (scope nb-vp-) : fiche produit et vue rapide.
 * Mobile-first : controles taille tactile 40px, barre de progression fine,
 * menus en bas-sheet sous 480px.
 * Utilise par product-video.js (lecture HLS via hls.js, repli natif Safari).
 * ============================================================================= */

.nb-vp {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: oklch(10% 0.01 260);
  overflow: hidden;
  border-radius: var(--nb-radius-md, 12px);
}
.nb-vp--fill { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }

.nb-vp__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: oklch(10% 0.01 260);
}

/* --- Voile de presentation (poster + bouton lecture) --- */
.nb-vp__cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: 0;
  padding: 0;
  z-index: 3;
}
.nb-vp__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, oklch(0% 0 0 / 0.35), transparent 45%);
}
.nb-vp__cover-play {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: oklch(0% 0 0 / 0.55);
  color: #fff;
  font-size: 30px;
  backdrop-filter: blur(4px);
  transition: transform .18s var(--ease-out-expo, ease), background .18s;
}
.nb-vp__cover:hover .nb-vp__cover-play,
.nb-vp__cover:focus-visible .nb-vp__cover-play {
  transform: scale(1.08);
  background: var(--nb-accent, #f97316);
}
.nb-vp__cover-duration {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 10px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: oklch(0% 0 0 / 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nb-vp.is-playing .nb-vp__cover { display: none; }

/* --- Chargement / erreur --- */
.nb-vp__status {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 2;
  background: oklch(0% 0 0 / 0.35);
  color: #fff;
  font-size: 13px;
  text-align: center;
  padding: 16px;
}
.nb-vp.is-loading .nb-vp__status--loading,
.nb-vp.is-error .nb-vp__status--error { display: grid; }
.nb-vp__spinner {
  width: 38px;
  height: 38px;
  border: 3px solid oklch(100% 0 0 / 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nb-vp-spin .8s linear infinite;
}
@keyframes nb-vp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .nb-vp__spinner { animation-duration: 2.4s; } }

/* --- Barre de controle --- */
.nb-vp__controls {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 28px 10px 8px;
  background: linear-gradient(to top, oklch(0% 0 0 / 0.72), transparent);
  opacity: 0;
  transition: opacity .2s;
}
.nb-vp.is-playing .nb-vp__controls,
.nb-vp.is-paused .nb-vp__controls,
.nb-vp:focus-within .nb-vp__controls,
.nb-vp__controls:focus-within { opacity: 1; }
@media (hover: none) { .nb-vp.is-started .nb-vp__controls { opacity: 1; } }

/* Progression */
.nb-vp__progress {
  position: relative;
  height: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.nb-vp__track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: oklch(100% 0 0 / 0.28);
  overflow: hidden;
}
.nb-vp__buffered, .nb-vp__played {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
}
.nb-vp__buffered { background: oklch(100% 0 0 / 0.35); }
.nb-vp__played { background: var(--nb-accent, #f97316); }
.nb-vp__seek-thumb {
  position: absolute;
  top: 50%;
  inset-inline-start: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--nb-accent, #f97316);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .15s;
}
.nb-vp__progress:hover .nb-vp__seek-thumb,
.nb-vp__progress.is-scrubbing .nb-vp__seek-thumb { opacity: 1; }
.nb-vp__progress:hover .nb-vp__track,
.nb-vp__progress.is-scrubbing .nb-vp__track { height: 6px; }

/* Ligne de boutons */
.nb-vp__row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
}
.nb-vp__btn {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 21px;
  cursor: pointer;
  border-radius: 8px;
}
.nb-vp__btn:hover { background: oklch(100% 0 0 / 0.14); }
.nb-vp__btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.nb-vp__time {
  margin-inline-start: 4px;
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nb-vp__spacer { flex: 1; }

/* Volume */
.nb-vp__volume {
  display: flex;
  align-items: center;
}
.nb-vp__volume-range {
  width: 0;
  opacity: 0;
  transition: width .18s, opacity .18s;
  accent-color: var(--nb-accent, #f97316);
  height: 4px;
}
.nb-vp__volume:hover .nb-vp__volume-range,
.nb-vp__volume:focus-within .nb-vp__volume-range { width: 74px; opacity: 1; margin-inline-end: 6px; }
@media (hover: none) { .nb-vp__volume-range { display: none; } }

/* Menus (qualite) */
.nb-vp__menu-wrap { position: relative; }
.nb-vp__menu {
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 148px;
  padding: 6px;
  background: oklch(14% 0.01 260 / 0.97);
  border-radius: 10px;
  box-shadow: 0 8px 24px oklch(0% 0 0 / 0.4);
  display: none;
}
.nb-vp__menu.is-open { display: block; }
.nb-vp__menu-title {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: oklch(100% 0 0 / 0.55);
}
.nb-vp__menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  text-align: start;
  border-radius: 6px;
  cursor: pointer;
}
.nb-vp__menu-item:hover { background: oklch(100% 0 0 / 0.1); }
.nb-vp__menu-item .ph-check { visibility: hidden; font-size: 15px; }
.nb-vp__menu-item.is-active .ph-check { visibility: visible; color: var(--nb-accent, #f97316); }
.nb-vp__menu-item small { color: oklch(100% 0 0 / 0.55); margin-inline-start: auto; }

/* Indicateur qualite auto courant */
.nb-vp__quality-label { font-size: 12px; font-weight: 600; }

/* Titre overlay */
.nb-vp__title {
  position: absolute;
  top: 0;
  inset-inline: 0;
  z-index: 4;
  padding: 10px 12px 26px;
  background: linear-gradient(to bottom, oklch(0% 0 0 / 0.55), transparent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.nb-vp.is-paused .nb-vp__title { opacity: 1; }

/* Compact dans la vue rapide : aspect video plein */
.nb-qv__slide .nb-vp { height: 100%; aspect-ratio: auto; border-radius: 0; }
