/* OffersCarousel — infinite strip (3 pannelli) + griglia card + navigazione */

.offers-carousel {
  position: relative;
  width: 100%;
  padding-inline: 44px;
}

@media (max-width: 1023px) {
  .offers-carousel {
    padding-inline: 36px;
  }
}

.offers-carousel__viewport {
  overflow: hidden;
  width: 100%;
}

.offers-carousel__strip {
  display: flex;
  width: 300%;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.offers-carousel__strip--no-transition {
  transition: none !important;
}

.offers-carousel__panel {
  flex: 0 0 33.333333%;
  flex-shrink: 0;
  width: 33.333333%;
  min-width: 0;
  box-sizing: border-box;
}

.offers-carousel__track {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  align-items: stretch;
  width: 100%;
}

@media (min-width: 1024px) {
  .offers-carousel__track {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Frecce navigazione */
.offers-carousel__nav-btn {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text);
  background-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition:
    background-color var(--transition-interactive),
    opacity var(--transition-interactive);
}

[data-theme='dark'] .offers-carousel__nav-btn {
  background-color: rgba(30, 30, 34, 0.75);
  color: var(--color-text);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.offers-carousel__nav-btn:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.92);
}

[data-theme='dark'] .offers-carousel__nav-btn:hover:not(:disabled) {
  background-color: rgba(48, 48, 54, 0.92);
}

.offers-carousel__nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.offers-carousel__nav-btn--prev {
  left: 0;
}

.offers-carousel__nav-btn--next {
  right: 0;
}

.offers-carousel__nav-icon {
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 700;
}

@media (max-width: 1023px) {
  .offers-carousel__nav-btn {
    width: 28px;
    height: 28px;
  }

  .offers-carousel__nav-icon {
    font-size: 0.95rem;
  }
}

/* ─── Card: altezza uniforme, CTA ancorato in basso ─── */

.offers-carousel__track .offer-card {
  display: flex;
  flex-direction: column;
  min-height: 440px;
  height: 100%;
}

.offers-carousel__track .offer-card__media {
  position: relative;
  height: 180px;
  flex-shrink: 0;
  background-color: var(--color-surface-offset);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.offers-carousel__track .offer-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.offers-carousel__track .offer-card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  justify-content: flex-start;
}

.offers-carousel__track .offer-card__name {
  margin: 0;
  min-height: 2.6em;
  max-height: 2.6em;
}

.offers-carousel__track .offer-card__name-link {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.offers-carousel__track .offer-card__brand {
  margin: 0;
  min-height: 1.15em;
  max-height: 1.15em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offers-carousel__track .offer-card__prices {
  min-height: 1.25em;
  flex-shrink: 0;
}

.offers-carousel__track .offer-card__store {
  margin: 0;
  flex-shrink: 0;
  font-size: clamp(11px, 0.78rem, 0.85rem);
  line-height: 1.35;
  color: var(--color-text-muted);
  white-space: normal;
  word-break: break-word;
  overflow: visible;
}

.offers-carousel__track .offer-card__cta {
  display: block;
  width: 100%;
  min-block-size: 44px;
  padding: 8px 12px;
  margin-block-start: auto;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-inverse);
  background-color: var(--color-primary);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--transition-interactive);
  white-space: nowrap;
}

.offer-card__cta:hover {
  background-color: var(--color-primary-hover);
}

.offer-card__cta:active {
  background-color: var(--color-primary-active);
}

.offer-card__cta:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.offer-card__name-link {
  color: inherit;
  text-decoration: none;
}

.offer-card__name-link:hover {
  color: var(--color-primary);
}

.offer-card__media-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
