/**
 * EDS Advanced Carousel
 * eDesign Space · https://edesignspace.com/
 */

/* ── Base ─────────────────────────────────────────────────────────────────── */
.eds-carousel {
  position: relative;
  width: 100%;
  user-select: none;
  /* overflow: visible so arrows can extend outside */
}

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

.eds-carousel__track {
  display: flex;
  align-items: stretch;
  will-change: transform;
}

/* ── Slide ────────────────────────────────────────────────────────────────── */
.eds-carousel__slide {
  flex-shrink: 0;
  box-sizing: border-box;
}

.eds-carousel__slide-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.3s;
}

/* ── Image ────────────────────────────────────────────────────────────────── */
.eds-carousel__image {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  height: 240px;
}

.eds-carousel__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.eds-carousel__slide-inner:hover .eds-carousel__image img {
  transform: scale(1.04);
}

/* ── Content ──────────────────────────────────────────────────────────────── */
.eds-carousel__content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* default left — overridden by Elementor content_align selector */
}

.eds-carousel__title {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  width: 100%;  /* always fill content width so text-align works for multi-line text */
  align-self: stretch;
}

.eds-carousel__desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
  width: 100%;  /* always fill content width so text-align works for multi-line text */
  align-self: stretch;
}

.eds-carousel__btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 22px;
  background: #6366f1;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
  cursor: pointer;
  align-self: flex-start; /* default left — overridden by btn_align selector */
}

.eds-carousel__btn:hover {
  opacity: 0.85;
  text-decoration: none;
}

/* Button alignment helpers — set by PHP render attribute */
.eds-carousel__btn--align-center { align-self: center; }
.eds-carousel__btn--align-right  { align-self: flex-end; }
.eds-carousel__btn--align-full   { align-self: stretch; text-align: center; }

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT: GRID (default)
════════════════════════════════════════════════════════════════════════════ */
.eds-layout--grid .eds-carousel__slide-inner {
  flex-direction: column;
}

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT: LIST
════════════════════════════════════════════════════════════════════════════ */
.eds-layout--list .eds-carousel__slide-inner {
  flex-direction: row;
  align-items: stretch;
}

.eds-layout--list .eds-carousel__image {
  width: 45%;
  flex-shrink: 0;
  height: auto;
  min-height: 200px;
}

.eds-layout--list .eds-carousel__content {
  flex: 1;
}

/* ── Navigation Arrows ───────────────────────────────────────────────────── */
.eds-carousel__prev,
.eds-carousel__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  padding: 0;
  line-height: 1;
}

.eds-carousel__prev:hover,
.eds-carousel__next:hover {
  background: rgba(0, 0, 0, 0.7);
}

.eds-carousel__prev { left: -20px; }
.eds-carousel__next { right: -20px; }

.eds-arrows--top .eds-carousel__prev,
.eds-arrows--top .eds-carousel__next {
  top: 16px;
  transform: none;
}

.eds-arrows--bottom .eds-carousel__prev,
.eds-arrows--bottom .eds-carousel__next {
  top: auto;
  bottom: 16px;
  transform: none;
}

/* Outside */
.eds-carousel__nav-outside {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.eds-arrows--outside .eds-carousel__prev,
.eds-arrows--outside .eds-carousel__next {
  position: static;
  transform: none;
}

/* ── Dots ─────────────────────────────────────────────────────────────────── */
.eds-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.eds-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.eds-carousel__dot.is-active {
  background: #6366f1;
  transform: scale(1.3);
}

.eds-carousel__prev[disabled],
.eds-carousel__next[disabled] {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .eds-layout--list .eds-carousel__image { width: 40%; }
}

@media (max-width: 767px) {
  .eds-layout--list .eds-carousel__slide-inner { flex-direction: column; }
  .eds-layout--list .eds-carousel__image { width: 100%; height: 200px; }
}
