/* M16 — Wideo produktu: przycisk „Zobacz wideo” + popup (wygląd jak przyciski i popupy m16spec) */

.m16video-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 600;
  color: #43611b;
  background: transparent;
  border: 1px solid #7a9d3f;
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.m16video-btn:hover,
.m16video-btn:focus {
  background: #7a9d3f;
  color: #fff;
  text-decoration: none;
  outline: none;
}
.m16video-btn__icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
}
/* W panelu „Inne modele” zawsze pod „+ specyfikacja / + parametry”, niezależnie od kolejności wstawienia */
.m16bv-actions__btns .m16video-btn {
  order: 99;
}
@media (min-width: 992px) {
  .m16bv--has-actions .m16bv-actions__btns .m16video-btn {
    width: 100%;
  }
}
/* Bez bloku „Inne modele” — przycisk sam, po prawej (jak m16spec--standalone) */
.m16video--standalone {
  margin: 0 0 15px;
  text-align: right;
}

/* --- popup --- */
.m16video-modal[hidden] { display: none; }
.m16video-modal {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.m16video-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, .7);
}
.m16video-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}
.m16video-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #565655;
  color: #fff;
}
.m16video-heading {
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m16video-close {
  flex: 0 0 auto;
  padding: 0 4px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.m16video-close:hover { color: #92c23b; }
.m16video-body {
  padding: 16px;
  overflow-y: auto;
}
.m16video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background: #000;
}
.m16video-frame iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.m16video-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.m16video-thumb {
  width: 120px;
  max-width: calc(33.333% - 6px);
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  background: #000;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  opacity: .7;
}
.m16video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.m16video-thumb:hover,
.m16video-thumb:focus-visible { opacity: 1; }
.m16video-thumb.is-active {
  border-color: #7a9d3f;
  opacity: 1;
}

body.m16video-lock { overflow: hidden; }

@media (max-width: 575px) {
  .m16video-modal { padding: 10px; }
  .m16video-body { padding: 10px; }
  .m16video-heading { font-size: 14px; }
}
