:root {
  --shorts-visible: 3.5;
  --shorts-gap: 12px;
  --shorts-radius: 12px;
}

.shorts-carousel-wrapper {
  position: relative;
  margin: 24px 0;
}

.shorts-carousel {
  display: flex;
  gap: var(--shorts-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px 16px;
  cursor: grab;
}

.shorts-carousel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

/* Scrollbar discreta (Chrome/Edge/Safari) */
.shorts-carousel::-webkit-scrollbar {
  height: 6px;
}
.shorts-carousel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
}
.shorts-carousel::-webkit-scrollbar-track {
  background: transparent;
}
/* Firefox */
.shorts-carousel {
  scrollbar-width: thin;
}

.shorts-item {
  flex: 0 0 calc((100% - (var(--shorts-visible) - 1) * var(--shorts-gap)) / var(--shorts-visible));
  scroll-snap-align: start;
}

.shorts-item-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--shorts-radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.shorts-item-inner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Frecce di navigazione */
.shorts-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.shorts-nav:hover {
  background: #fff;
}

.shorts-nav-prev { left: -4px; }
.shorts-nav-next { right: -4px; }

/* Responsive: meno elementi visibili su schermi piccoli */
@media (max-width: 992px) {
  :root { --shorts-visible: 2.4; }
}

@media (max-width: 600px) {
  :root { --shorts-visible: 1.5; }
  .shorts-nav { display: none; } /* su mobile lo swipe è naturale */
}
