.jms-videos-section {
  position: relative;
  isolation: isolate;
  padding-top: clamp(3.5rem, 6vw, 5.5rem);
  padding-bottom: clamp(3.5rem, 6vw, 5.5rem);
  background:
    radial-gradient(
      circle at 90% 5%,
      rgba(190, 21, 34, 0.08),
      transparent 32%
    ),
    linear-gradient(
      180deg,
      #f8f8f8 0%,
      #ffffff 100%
    );
}

.jms-videos-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(1200px, calc(100% - 2rem));
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 0, 0, 0.08),
    transparent
  );
}

.jms-videos-section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.jms-videos-section .jms-section__head {
  max-width: 720px;
  margin: 0;
}

.jms-videos-section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--color-red, #be1522);
}

.jms-videos-section__eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: var(--color-red, #be1522);
}

.jms-videos-section .jms-section__head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: #171717;
}

.jms-videos-section__description {
  max-width: 620px;
  margin: 0.85rem 0 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: #666;
}

.jms-videos-section__controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.2rem;
}

.jms-videos__nav {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 50%;
  background: #fff;
  color: #1d1d1d;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.jms-videos__nav:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--color-red, #be1522);
  border-color: var(--color-red, #be1522);
  color: #fff;
  box-shadow: 0 10px 25px rgba(190, 21, 34, 0.2);
}

.jms-videos__nav:active:not(:disabled) {
  transform: translateY(0);
}

.jms-videos__nav:focus-visible {
  outline: 3px solid rgba(190, 21, 34, 0.2);
  outline-offset: 3px;
}

.jms-videos__nav:disabled {
  opacity: 0.32;
  cursor: default;
  box-shadow: none;
}

.jms-videos-wrapper {
  position: relative;
}

.jms-videos {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(225px, 260px);
  gap: 1.25rem;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.4rem 0.2rem 1.4rem;
}

.jms-videos::-webkit-scrollbar {
  display: none;
}

.video-card {
  position: relative;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.video-quadro {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 20px;
  background: #111;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.08),
    0 20px 45px rgba(0, 0, 0, 0.1);
  transform: translateZ(0);
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.35s ease;
}

.video-quadro::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.02) 38%,
      rgba(0, 0, 0, 0.15) 68%,
      rgba(0, 0, 0, 0.52) 100%
    );
}

.video-quadro img,
.video-quadro iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.video-quadro img {
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.video-play {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.video-play::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transform: translate(-50%, -50%) scale(1);
  transition:
    transform 0.3s ease,
    background 0.3s ease,
    border-color 0.3s ease;
}

.video-play::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--color-red, #be1522);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.34),
    0 0 0 0 rgba(190, 21, 34, 0.28);
  transform: translate(-50%, -50%);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.video-play span {
  position: relative;
  z-index: 4;
}

.video-play svg {
  position: relative;
  z-index: 4;
}

.video-play:focus-visible {
  outline: 3px solid rgba(190, 21, 34, 0.35);
  outline-offset: -4px;
}

.video-card h3 {
  margin: 1rem 0.2rem 0;
  font-size: 1rem;
  line-height: 1.42;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #252525;
  transition: color 0.2s ease;
}

.video-card h3::after {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-top: 0.65rem;
  border-radius: 999px;
  background: var(--color-red, #be1522);
  opacity: 0.85;
  transition: width 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .video-card:hover .video-quadro {
    transform: translateY(-6px);
    box-shadow:
      0 14px 25px rgba(0, 0, 0, 0.1),
      0 28px 55px rgba(0, 0, 0, 0.16);
  }

  .video-card:hover .video-quadro img {
    transform: scale(1.045);
  }

  .video-card:hover .video-play::before {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.5);
  }

  .video-card:hover .video-play::after {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow:
      0 15px 35px rgba(0, 0, 0, 0.4),
      0 0 0 9px rgba(190, 21, 34, 0.12);
  }

  .video-card:hover h3 {
    color: var(--color-red, #be1522);
  }

  .video-card:hover h3::after {
    width: 48px;
  }
}

.jms-videos__mobile-hint {
  display: none;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.1rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #828282;
}

.jms-videos__mobile-hint-arrow {
  color: var(--color-red, #be1522);
  font-size: 1rem;
}

.jms-video-modal[hidden] {
  display: none;
}

.jms-video-modal {
  --video-modal-gutter: 1.25rem;
  position: fixed;
  inset: 0;
  z-index: 99999;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  padding:
    max(var(--video-modal-gutter), env(safe-area-inset-top))
    max(var(--video-modal-gutter), env(safe-area-inset-right))
    max(var(--video-modal-gutter), env(safe-area-inset-bottom))
    max(var(--video-modal-gutter), env(safe-area-inset-left));
  color: inherit;
  background: transparent;
  visibility: hidden;
  opacity: 0;
  transition:
    visibility 0.25s ease,
    opacity 0.25s ease;
}

.jms-video-modal::backdrop {
  background: transparent;
}

.jms-video-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.jms-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.jms-video-modal__content {
  position: relative;
  z-index: 2;
  width: min(92vw, 46vh, 430px);
  width: min(92vw, 46dvh, 430px);
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.25s ease;
}

.jms-video-modal.is-open .jms-video-modal__content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.jms-video-modal__player {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 22px;
  background: #000;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.jms-video-modal__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.jms-video-modal__close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 5;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: #fff;
  color: #111;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.jms-video-modal__close:hover {
  transform: scale(1.07);
  background: var(--color-red, #be1522);
  color: #fff;
}

.jms-video-modal__close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.4);
  outline-offset: 4px;
}

.jms-video-modal__footer {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 0.2rem 0;
  color: #fff;
}

.jms-video-modal__brand {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-red, #e31c2b);
}

.jms-video-modal__title {
  overflow: hidden;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.jms-video-modal-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .jms-videos-section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .jms-videos-section__header {
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.45rem;
  }

  .jms-videos-section .jms-section__head {
    flex: 1;
    min-width: 0;
  }

  .jms-videos-section__eyebrow {
    margin-bottom: 0.55rem;
    font-size: 0.68rem;
  }

  .jms-videos-section .jms-section__head h2 {
    font-size: clamp(1.65rem, 7vw, 2.1rem);
  }

  .jms-videos-section__description {
    margin-top: 0.65rem;
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .jms-videos-section__controls {
    align-self: flex-end;
    gap: 0.4rem;
  }

  .jms-videos__nav {
    width: 40px;
    height: 40px;
    font-size: 1.05rem;
  }

  .jms-videos {
    grid-auto-columns: min(78vw, 285px);
    gap: 0.95rem;
    margin-right: calc((100vw - 100%) / -2);
    padding-right: calc((100vw - 100%) / 2);
    padding-bottom: 1rem;
    scroll-padding-left: 0;
  }

  .video-quadro {
    border-radius: 18px;
    box-shadow:
      0 7px 16px rgba(0, 0, 0, 0.08),
      0 16px 34px rgba(0, 0, 0, 0.11);
  }

  .video-play::before {
    width: 74px;
    height: 74px;
  }

  .video-play::after {
    width: 54px;
    height: 54px;
  }

  .video-card h3 {
    margin-top: 0.8rem;
    font-size: 0.94rem;
  }

  .jms-videos__mobile-hint {
    display: flex;
  }

  .jms-video-modal {
    --video-modal-gutter: 0.8rem;
  }

  .jms-video-modal__content {
    width: min(92vw, 46vh);
    width: min(92vw, 46dvh);
  }

  .jms-video-modal__player {
    border-radius: 18px;
  }

  .jms-video-modal__close {
    top: -8px;
    right: -8px;
    width: 42px;
    height: 42px;
  }

  .jms-video-modal__footer {
    padding-top: 0.75rem;
  }
}

@media (max-width: 480px) {
  .jms-videos-section__header {
    display: block;
  }

  .jms-videos-section__controls {
    margin-top: 1rem;
  }

  .jms-videos {
    grid-auto-columns: min(76vw, 270px);
  }

  .jms-video-modal__content {
    width: min(91vw, 44vh);
    width: min(91vw, 44dvh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .jms-videos,
  .video-quadro,
  .video-quadro img,
  .video-play::before,
  .video-play::after,
  .jms-video-modal,
  .jms-video-modal__content,
  .jms-videos__nav {
    scroll-behavior: auto;
    transition: none;
  }
}
