/* =========================================================
   SERVICE DETAIL — PRODUCT VIDEOS SECTION
   service-detail-videos.css
   ========================================================= */

/* =========================================================
   LAYOUT
   ========================================================= */

.service-detail-videos {
  container-type: inline-size;
}

.service-detail-videos__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 0.25rem;
  padding: 0.5rem;
  max-width: min(100%, calc(62dvh * 16 / 9 + 320px));
  margin-inline: auto;
}

.service-detail-videos__layout--solo {
  grid-template-columns: minmax(0, 1fr);
  max-width: min(100%, calc(62dvh * 16 / 9));
}

/* =========================================================
   MAIN PLAYER
   ========================================================= */

.service-detail-videos__player {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.service-detail-videos__iframe-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: 62dvh;
  overflow: hidden;

  border-radius: 10px;
  background: #0a0c10;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.service-detail-videos__iframe,
.service-detail-videos__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.service-detail-videos__video {
  background: #000;
  object-fit: contain;
}

.service-detail-videos__player-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
}

.service-detail-videos__player-title {
  margin: 0;

  color: rgba(255, 255, 255, 0.86);

  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.service-detail-videos__player-desc {
  margin: 0;

  color: rgba(255, 255, 255, 0.42);

  font-size: 0.8rem;
  font-weight: 420;
  letter-spacing: -0.01em;
  line-height: 1.45;
}

.service-detail-videos__player-desc[hidden] {
  display: none;
}

/* =========================================================
   PLAYLIST SIDEBAR
   ========================================================= */

.service-detail-videos__sidebar {
  display: flex;
  flex-direction: column;
  gap: 0rem;
  min-width: 0;
}

.service-detail-videos__sidebar[hidden] {
  display: none;
}

.service-detail-videos__list-heading {
  margin: 0;
  padding: 0.75rem;

  color: rgba(255, 255, 255, 0.5);

  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: none;
}

.service-detail-videos__list {
  list-style: none;
  margin: 0 0.5rem 0 0.25rem;
  padding: 0;

  display: flex;
  flex-direction: column;
  gap: 0.25rem;

  max-height: min(62dvh, calc(100cqi * 9 / 16));
  overflow-y: auto;
  overscroll-behavior: contain;

  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.service-detail-videos__list::-webkit-scrollbar {
  width: 4px;
}

.service-detail-videos__list::-webkit-scrollbar-track {
  background: transparent;
}

.service-detail-videos__list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}

/* =========================================================
   LIST ITEM + BUTTON  — matches model-pill__label
   ========================================================= */

.service-detail-videos__list-item {
  min-width: 0;
  max-width: 100%;
}

.service-detail-videos__list-btn {
  position: relative;

  display: inline-flex;
  align-items: flex-start;
  gap: 0.62rem;

  width: 100%;
  max-width: 100%;
  min-height: 3rem;
  padding: 0.46rem 0.58rem 0.46rem 0.48rem;
  margin-top: 0;
  border: 1px solid transparent;
  border-radius: 5px;

  background: transparent;
  box-shadow: none;
  color: var(--service-filter-text-soft, rgba(255, 255, 255, 0.7));

  cursor: pointer;
  text-align: left;
  user-select: none;

  transform: translate3d(0, 0, 0);

  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.service-detail-videos__list-btn:hover {
  color: var(--service-filter-text, rgba(255, 255, 255, 0.96));
  border-color: rgba(255, 255, 255, 0.09);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.055) 0%,
    rgba(255, 255, 255, 0.026) 100%
  );
  transform: translate3d(0, -1px, 0);
}

.service-detail-videos__list-item.is-active .service-detail-videos__list-btn {
  border-color: rgba(255, 255, 255, 0.13);
  color: var(--theme-white, #fff);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.105) 0%,
    rgba(255, 255, 255, 0.048) 100%
  );
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.065);
}

.service-detail-videos__list-item.is-active .service-detail-videos__list-btn:hover {
  border-color: rgba(255, 255, 255, 0.17);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.13) 0%,
    rgba(255, 255, 255, 0.062) 100%
  );
}

/* =========================================================
   THUMBNAIL
   ========================================================= */

.service-detail-videos__thumb-wrap {
  position: relative;
  flex: 0 0 auto;

  width: 100px;
  aspect-ratio: 16 / 9;
  overflow: hidden;

  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
}

.service-detail-videos__thumb-wrap--no-thumb {
  background: rgba(255, 255, 255, 0.05);
}

.service-detail-videos__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;

  transition: opacity 200ms ease;
}

.service-detail-videos__thumb-play {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.26);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.6rem;

  transition: background 160ms ease, color 160ms ease;
}

.service-detail-videos__list-btn:hover .service-detail-videos__thumb-play,
.service-detail-videos__list-item.is-active .service-detail-videos__thumb-play {
  background: rgba(0, 0, 0, 0.38);
  color: rgba(255, 255, 255, 0.96);
}

/* =========================================================
   ITEM META
   ========================================================= */

.service-detail-videos__item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 auto;
  padding-top: 0.06rem;
}

.service-detail-videos__item-title {
  display: -webkit-box;
  overflow: hidden;

  color: inherit;

  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;

  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.service-detail-videos__item-desc {
  display: -webkit-box;
  overflow: hidden;

  color: rgba(255, 255, 255, 0.38);

  font-size: 0.72rem;
  font-weight: 420;
  line-height: 1.35;

  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@container (max-width: 640px) {
  .service-detail-videos__layout {
    grid-template-columns: 1fr;
  }

  .service-detail-videos__list {
    max-height: none;
    overflow-y: visible;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 0.25rem;

    scrollbar-width: none;
  }

  .service-detail-videos__list::-webkit-scrollbar {
    display: none;
  }

  .service-detail-videos__list-item {
    flex: 0 0 auto;
    width: 180px;
  }

  .service-detail-videos__list-btn {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.42rem;
    min-height: 0;
    padding: 0.42rem;
  }

  .service-detail-videos__thumb-wrap {
    width: 100%;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .service-detail-videos__list-btn,
  .service-detail-videos__thumb,
  .service-detail-videos__thumb-play {
    transition: none !important;
  }
}
