/*
 * LYU Related Products Carousel — editorial dark design.
 * Matches the site's new chrome: dark page bg, white product cards,
 * red brand accent, GothamPro typography (inherits from theme).
 */

.lyu-rel {
  --lyu-rel-bg: transparent;
  --lyu-rel-card: #ffffff;
  --lyu-rel-card-radius: 14px;
  --lyu-rel-fg: #0a0c14;
  --lyu-rel-fg-muted: rgba(10, 12, 20, 0.6);
  --lyu-rel-header-fg: #0a0c14;
  --lyu-rel-line: rgba(10, 12, 20, 0.12);
  --lyu-rel-brand: #f2053c;
  --lyu-rel-brand-deep: #cb003d;
  --lyu-rel-grad: linear-gradient(135deg, #f2053c, #cb003d);
  --lyu-rel-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.18);

  margin: 48px 0 24px;
  padding: 0 4px;
}

/* ─── Section header ───────────────────────────────────────── */

.lyu-rel__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 0 4px;
}

.lyu-rel__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.lyu-rel__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lyu-rel-brand);
}

.lyu-rel__eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--lyu-rel-grad);
  border-radius: 2px;
}

.lyu-rel__title {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--lyu-rel-header-fg);
}

.lyu-rel__title em {
  font-style: normal;
  background: var(--lyu-rel-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lyu-rel__nav {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}

.lyu-rel__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--lyu-rel-line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--lyu-rel-header-fg);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.2);
}

.lyu-rel__btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.lyu-rel__btn:hover:not(:disabled) {
  background: var(--lyu-rel-grad);
  border-color: transparent;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -4px rgba(242, 5, 60, 0.5);
}

.lyu-rel__btn:focus-visible {
  outline: 2px solid var(--lyu-rel-brand);
  outline-offset: 2px;
}

.lyu-rel__btn:disabled,
.lyu-rel__btn.swiper-button-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Swiper container ─────────────────────────────────────── */

.lyu-rel__carousel {
  position: relative;
  overflow: hidden;
  max-width: 100%;
}

.lyu-rel .swiper {
  /* hidden — інакше при pinch-zoom out на мобільних видно слайди поза вʼюпортом */
  overflow: hidden;
  margin: 0;
  padding: 6px 0;
  max-width: 100%;
}

.lyu-rel .swiper-wrapper {
  align-items: stretch;
}

.lyu-rel .swiper-slide {
  height: auto;
  display: flex;
}

/* ─── Product card ─────────────────────────────────────────── */

.lyu-rel__card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--lyu-rel-card);
  border-radius: var(--lyu-rel-card-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--lyu-rel-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  contain: layout style;
}

.lyu-rel__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -14px rgba(242, 5, 60, 0.35), 0 8px 16px -6px rgba(0, 0, 0, 0.25);
}

.lyu-rel__card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.lyu-rel__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f7f7f8;
  overflow: hidden;
}

.lyu-rel__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8%;
  transition: opacity 0.3s ease, transform 0.4s ease;
}

.lyu-rel__img--secondary {
  opacity: 0;
  z-index: 2;
}

.lyu-rel__card--has-secondary:hover .lyu-rel__img--primary {
  opacity: 0;
  transform: scale(1.04);
}

.lyu-rel__card--has-secondary:hover .lyu-rel__img--secondary {
  opacity: 1;
  transform: scale(1.04);
}

.lyu-rel__card:not(.lyu-rel__card--has-secondary):hover .lyu-rel__img--primary {
  transform: scale(1.04);
}

/* ─── Badge (on sale) ──────────────────────────────────────── */

.lyu-rel__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lyu-rel-grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  z-index: 3;
  pointer-events: none;
}

/* ─── Content ──────────────────────────────────────────────── */

.lyu-rel__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 16px;
  flex: 1 1 auto;
}

.lyu-rel__title-link {
  text-decoration: none;
  color: var(--lyu-rel-fg);
}

.lyu-rel__name {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--lyu-rel-fg);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.lyu-rel__title-link:hover .lyu-rel__name,
.lyu-rel__title-link:focus-visible .lyu-rel__name {
  color: var(--lyu-rel-brand);
}

.lyu-rel__price {
  font-size: 17px;
  font-weight: 700;
  color: var(--lyu-rel-fg);
  margin-top: 2px;
}

.lyu-rel__price del {
  font-size: 13px;
  font-weight: 500;
  color: var(--lyu-rel-fg-muted);
  margin-right: 6px;
  text-decoration: line-through;
}

.lyu-rel__price ins {
  text-decoration: none;
  color: var(--lyu-rel-brand);
}

/* ─── Add-to-cart button ───────────────────────────────────── */

.lyu-rel__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border-radius: 999px;
  background: var(--lyu-rel-grad);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lyu-rel__cta:hover {
  filter: brightness(1.08) saturate(1.05);
  transform: translateY(-1px);
}

.lyu-rel__cta:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.lyu-rel__cta.loading,
.lyu-rel__cta.added {
  pointer-events: none;
}

.lyu-rel__cta.loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: lyu-rel-spin 0.6s linear infinite;
}

.lyu-rel__cta.added {
  background: #16a34a;
}

@keyframes lyu-rel-spin {
  to { transform: rotate(360deg); }
}

/* ─── Reduced motion ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .lyu-rel__card,
  .lyu-rel__img,
  .lyu-rel__btn,
  .lyu-rel__cta {
    transition: none !important;
  }
  .lyu-rel__cta.loading::after {
    animation: none;
  }
}

/* ─── Breakpoints ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .lyu-rel { margin: 36px 0 16px; }
  .lyu-rel__head { margin-bottom: 14px; align-items: center; }
  .lyu-rel__body { padding: 12px 12px 14px; }
  .lyu-rel__name { font-size: 13px; min-height: 2.6em; }
  .lyu-rel__price { font-size: 15px; }
  .lyu-rel__cta { font-size: 12px; padding: 10px 12px; }
}

@media (max-width: 480px) {
  .lyu-rel__nav { display: none; }
}
