/* ============================================
   Lemon Content Carousel - Updated with Peek Support
   ============================================ */

.lemon-content-carousel {
  position: relative;
  width: 100%;
  overflow: hidden; /* Main container clips overflow */
}

/* ============================================
   SWIPER CONTAINER - CRITICAL FOR PEEK
   ============================================ */

.lemon-carousel-swiper {
  width: 100%;
  overflow: visible !important; /* CRITICAL: Allow peek slides to show */
  position: relative;
}

.lemon-carousel-swiper .swiper-wrapper {
  /* Wrapper handles alignment */
  transition-timing-function: ease-out;
}

/* ============================================
   SLIDES
   ============================================ */

.lemon-content-carousel .swiper-slide {
  height: auto;
  display: flex;
  transition: opacity 0.3s ease;
}

/* Slide inner */
.lemon-slide-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: box-shadow 0.3s ease, opacity 0.3s ease;
  will-change: opacity;
}

/* Hover effects are controlled from Elementor. */
.lemon-slide-inner:hover {
  box-shadow: inherit;
}

/* Active slide (fully visible) */
.lemon-content-carousel .swiper-slide-active .lemon-slide-inner {
  opacity: 1;
}

/* Previous and next slides (peek states) - controlled by Elementor */
.lemon-content-carousel .swiper-slide-prev .lemon-slide-inner,
.lemon-content-carousel .swiper-slide-next .lemon-slide-inner {
  /* Opacity controlled via PHP selector */
  /* Default if not set by user */
  opacity: 0.6;
}

/* ============================================
   SLIDE CONTENT
   ============================================ */

.lemon-slide-image {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.lemon-slide-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.lemon-slide-content {
  padding: 1rem;
  flex: 1;
}

.lemon-slide-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.lemon-slide-subtitle {
  font-size: 0.875rem;
  opacity: 0.8;
  margin: 0;
  line-height: 1.4;
}

/* ============================================
   NAVIGATION ARROWS
   ============================================ */

.lemon-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  user-select: none;
  flex-shrink: 0;
}

.lemon-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lemon-arrow:not(:disabled):hover {
  transform: scale(1.1);
}

.lemon-arrow svg,
.lemon-arrow i {
  pointer-events: none;
}

/* ============================================
   ARROWS POSITIONING - GROUPED
   ============================================ */

.lemon-arrows-group {
  display: flex;
  align-items: center;
  position: absolute;
  z-index: 10;
}

.lemon-arrows-top-left {
  top: 0;
  left: 0;
}

.lemon-arrows-top-right {
  top: 0;
  right: 0;
}

.lemon-arrows-bottom-left {
  bottom: 0;
  left: 0;
}

.lemon-arrows-bottom-right {
  bottom: 0;
  right: 0;
}

/* Margin adjustments for grouped arrows */
.lemon-content-carousel[data-arrows-position="top-left"] .lemon-carousel-swiper,
.lemon-content-carousel[data-arrows-position="top-right"] .lemon-carousel-swiper {
  margin-top: 60px;
}

.lemon-content-carousel[data-arrows-position="bottom-left"] .lemon-carousel-swiper,
.lemon-content-carousel[data-arrows-position="bottom-right"] .lemon-carousel-swiper {
  margin-bottom: 60px;
}

/* ============================================
   ARROWS POSITIONING - SIDES
   ============================================ */

.lemon-arrows-sides {
  position: relative;
  pointer-events: none; /* Allow clicks through */
}

.lemon-arrows-sides .lemon-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto; /* Re-enable clicks on arrows */
}

/* Default positions (overridden by Elementor controls) */
.lemon-arrows-sides .lemon-arrow-prev {
  left: 20px;
}

.lemon-arrows-sides .lemon-arrow-next {
  right: 20px;
}

/* Hover maintains vertical centering */
.lemon-arrows-sides .lemon-arrow:not(:disabled):hover {
  transform: translateY(-50%) scale(1.1);
}

/* ============================================
   CAROUSEL STATE CLASSES
   ============================================ */

/* When carousel is at the start */
.lemon-content-carousel.at-start {
  /* Optional: Add specific styling when at start */
}

/* When carousel is at the end */
.lemon-content-carousel.at-end {
  /* Optional: Add specific styling when at end */
}

/* ============================================
   RESPONSIVE BEHAVIOR
   ============================================ */

@media (max-width: 768px) {
  /* Force arrows inside on mobile for sides layout */
  .lemon-arrows-sides .lemon-arrow-prev {
    left: 10px !important;
  }
  
  .lemon-arrows-sides .lemon-arrow-next {
    right: 10px !important;
  }
  
  /* Reduce margins on mobile */
  .lemon-content-carousel[data-arrows-position="top-left"] .lemon-carousel-swiper,
  .lemon-content-carousel[data-arrows-position="top-right"] .lemon-carousel-swiper {
    margin-top: 50px;
  }
  
  .lemon-content-carousel[data-arrows-position="bottom-left"] .lemon-carousel-swiper,
  .lemon-content-carousel[data-arrows-position="bottom-right"] .lemon-carousel-swiper {
    margin-bottom: 50px;
  }
}

@media (max-width: 480px) {
  /* Further adjustments for very small screens */
  .lemon-slide-title {
    font-size: 1rem;
  }
  
  .lemon-slide-subtitle {
    font-size: 0.75rem;
  }
  
  .lemon-slide-content {
    padding: 0.75rem;
  }
}

/* ============================================
   SWIPER INTEGRATION
   ============================================ */

.lemon-arrow.swiper-button-disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ============================================
   INITIALIZATION STATES
   ============================================ */

.lemon-carousel-swiper:not(.swiper-initialized) {
  opacity: 0.7;
}

.lemon-carousel-swiper.swiper-initialized {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* ============================================
   DRAG STATE
   ============================================ */

.lemon-carousel-swiper.swiper-container-dragging .lemon-slide-inner {
  user-select: none;
  cursor: grabbing;
}

.lemon-carousel-swiper .lemon-slide-inner {
  cursor: grab;
}

.lemon-carousel-swiper .lemon-slide-inner:active {
  cursor: grabbing;
}

/* Remove cursor styles if slides have links */
.lemon-carousel-swiper .lemon-slide-inner[href] {
  cursor: pointer;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.lemon-arrow:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.lemon-arrow:focus:not(:focus-visible) {
  outline: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .lemon-carousel-swiper .swiper-wrapper,
  .lemon-slide-inner,
  .lemon-arrow {
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   UTILITIES
   ============================================ */

/* Prevent layout shift during load */
.lemon-carousel-swiper {
  min-height: 200px; /* Adjust based on content */
}

/* Clear floats if needed */
.lemon-content-carousel::after {
  content: "";
  display: table;
  clear: both;
}

/* ============================================
   RTL SUPPORT
   ============================================ */

.rtl .lemon-arrows-sides .lemon-arrow-prev {
  left: auto;
  right: 20px;
}

.rtl .lemon-arrows-sides .lemon-arrow-next {
  right: auto;
  left: 20px;
}

@media (max-width: 768px) {
  .rtl .lemon-arrows-sides .lemon-arrow-prev {
    left: auto !important;
    right: 10px !important;
  }
  
  .rtl .lemon-arrows-sides .lemon-arrow-next {
    right: auto !important;
    left: 10px !important;
  }
}
/* v1.15.50: corrected full slides + peek behaviour */
.lemon-carousel-swiper .swiper-slide {
  width: var(--lemon-slide-width, auto) !important;
  flex: 0 0 var(--lemon-slide-width, auto);
}

.lemon-content-carousel .swiper-slide .lemon-slide-inner {
  opacity: 1;
}

.lemon-content-carousel .swiper-slide-prev .lemon-slide-inner,
.lemon-content-carousel .swiper-slide-next .lemon-slide-inner {
  opacity: 1;
}

.lemon-content-carousel .swiper-slide.lemon-is-peek .lemon-slide-inner {
  opacity: var(--lemon-peek-opacity, 0.6);
}

/* v1.15.50: image styling/aspect ratio */
.lemon-carousel-image-aspect-enabled .lemon-slide-image {
  aspect-ratio: var(--lemon-slide-image-aspect-ratio, auto);
}

.lemon-carousel-image-aspect-enabled .lemon-slide-image img {
  width: 100%;
  height: 100%;
  object-fit: var(--lemon-slide-image-object-fit, cover);
}

.lemon-content-carousel:not(.lemon-carousel-image-aspect-enabled) .lemon-slide-image img {
  height: auto;
}

/* v1.15.50: arrows without forced circle/background by default */
.lemon-arrow {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

.lemon-arrow-no-bg {
  background: transparent !important;
  box-shadow: none;
}

.lemon-arrow svg,
.lemon-arrow i {
  color: currentColor;
}

.lemon-arrow svg,
.lemon-arrow svg * {
  fill: currentColor;
  stroke: currentColor;
}

/* v1.15.50: arrows aligned to first slide */
.lemon-arrows-top-first {
  top: 0;
  left: var(--lemon-first-slide-offset, 0px);
}

.lemon-arrows-bottom-first {
  bottom: 0;
  left: var(--lemon-first-slide-offset, 0px);
}

.lemon-content-carousel[data-arrows-position="top-first"] .lemon-carousel-swiper {
  margin-top: 60px;
}

.lemon-content-carousel[data-arrows-position="bottom-first"] .lemon-carousel-swiper {
  margin-bottom: 60px;
}

@media (max-width: 768px) {
  .lemon-content-carousel[data-arrows-position="top-first"] .lemon-carousel-swiper {
    margin-top: 50px;
  }

  .lemon-content-carousel[data-arrows-position="bottom-first"] .lemon-carousel-swiper {
    margin-bottom: 50px;
  }
}

/* v1.15.51: stable opacity states.
 * - The active slide is the current Swiper active slide.
 * - Fully visible non-active slides use inactive opacity.
 * - Peek opacity applies only to the slide partially visible on the right edge.
 */
.lemon-content-carousel .swiper-slide .lemon-slide-inner {
  opacity: var(--lemon-inactive-opacity, 1);
}

.lemon-content-carousel .swiper-slide.lemon-is-active-logical .lemon-slide-inner,
.lemon-content-carousel .swiper-slide.swiper-slide-active .lemon-slide-inner {
  opacity: 1;
}

.lemon-content-carousel .swiper-slide.lemon-is-right-peek .lemon-slide-inner {
  opacity: var(--lemon-peek-opacity, 0.6);
}

/* v1.15.51: aspect ratio must also react in Elementor editor. */
.lemon-content-carousel .lemon-slide-image {
  aspect-ratio: var(--lemon-slide-image-aspect-ratio, auto);
}

.lemon-content-carousel .lemon-slide-image img {
  width: 100%;
  height: 100%;
  object-fit: var(--lemon-slide-image-object-fit, cover);
}

/* v1.15.53: left margin is handled by Swiper's slidesOffsetBefore.
 * Do not add padding to the transformed wrapper; wrapper padding changes the
 * snap calculation and causes visible jumps when navigating.
 */
.lemon-content-carousel .lemon-carousel-swiper .swiper-wrapper {
  padding-left: 0 !important;
  box-sizing: border-box;
}

.lemon-content-carousel .lemon-carousel-swiper .swiper-slide {
  width: var(--lemon-slide-width, auto) !important;
  flex: 0 0 var(--lemon-slide-width, auto) !important;
}

.lemon-carousel-motion-fluid .lemon-carousel-swiper .swiper-wrapper {
  transition-timing-function: linear !important;
}


/* v1.15.53: robust arrow styling states */
.lemon-arrow {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  line-height: 1;
}

.lemon-arrow.lemon-arrow-no-bg,
.lemon-arrow.lemon-arrow-no-bg:hover,
.lemon-arrow.lemon-arrow-no-bg:focus {
  background: transparent !important;
}

.lemon-arrow.lemon-arrow-no-bg:not(:hover) {
  box-shadow: none;
}

.lemon-arrow svg,
.lemon-arrow svg *,
.lemon-arrow i {
  color: currentColor;
  fill: currentColor;
  stroke: currentColor;
}

/* v1.15.55: navigation icon clipping fix.
 * Some SVG icon packs render strokes outside their viewport, and the previous
 * global stroke rule could make fill-only icons appear cropped. Keep the icon
 * box visible and only force stroke colour on icons that actually define a
 * stroke. Sides navigation is also a real overlay instead of a zero-height
 * relative wrapper, preventing the arrows from being clipped by the carousel.
 */
.lemon-content-carousel .lemon-arrows-group,
.lemon-content-carousel .lemon-arrows-sides,
.lemon-content-carousel .lemon-arrow {
  overflow: visible !important;
}

.lemon-content-carousel .lemon-arrow {
  line-height: 1;
}

.lemon-content-carousel .lemon-arrow svg,
.lemon-content-carousel .lemon-arrow .e-font-icon-svg {
  display: block;
  width: 1em;
  height: 1em;
  min-width: 1em;
  min-height: 1em;
  overflow: visible !important;
  flex: 0 0 auto;
}

.lemon-content-carousel .lemon-arrow i {
  display: block;
  width: 1em;
  height: 1em;
  line-height: 1;
  overflow: visible !important;
}

.lemon-content-carousel .lemon-arrow svg *:not([stroke]) {
  stroke: none !important;
}

.lemon-content-carousel .lemon-arrow svg *[stroke]:not([stroke="none"]) {
  stroke: currentColor;
}

.lemon-content-carousel .lemon-arrow svg *[stroke="none"] {
  stroke: none !important;
}

.lemon-content-carousel .lemon-arrow svg * {
  fill: currentColor;
}

.lemon-content-carousel .lemon-arrows-sides {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* v1.15.56: custom dots/pagination */
.lemon-content-carousel .lemon-carousel-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  pointer-events: auto;
}

.lemon-content-carousel .lemon-carousel-dots-top {
  margin-bottom: var(--lemon-dots-distance, 18px);
}

.lemon-content-carousel .lemon-carousel-dots-bottom {
  margin-top: var(--lemon-dots-distance, 18px);
}

.lemon-content-carousel .lemon-carousel-dots-top-left,
.lemon-content-carousel .lemon-carousel-dots-bottom-left {
  justify-content: flex-start;
}

.lemon-content-carousel .lemon-carousel-dots-top-center,
.lemon-content-carousel .lemon-carousel-dots-bottom-center {
  justify-content: center;
}

.lemon-content-carousel .lemon-carousel-dots-top-right,
.lemon-content-carousel .lemon-carousel-dots-bottom-right {
  justify-content: flex-end;
}

.lemon-content-carousel .lemon-carousel-dots-top-first,
.lemon-content-carousel .lemon-carousel-dots-bottom-first {
  justify-content: flex-start;
  padding-left: var(--lemon-first-slide-offset, 0px);
  box-sizing: border-box;
}

.lemon-content-carousel .lemon-carousel-dot {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 10px;
  height: 10px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background-color: #d9d9d9;
  cursor: pointer;
  line-height: 1;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease, width 0.25s ease, height 0.25s ease, transform 0.25s ease;
}

.lemon-content-carousel .lemon-carousel-dot.is-active {
  background-color: #111111;
}

.lemon-content-carousel .lemon-carousel-dot:hover,
.lemon-content-carousel .lemon-carousel-dot:focus-visible {
  opacity: 1;
}

.lemon-content-carousel .lemon-carousel-dot:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}


/* v1.15.58: dots horizontal offset from their selected reference.
 * Dots Distance controls vertical spacing from the slides. Dots Offset from
 * Position controls the horizontal reference: left edge, right edge, centre,
 * or first slide depending on the selected dots position.
 */
.lemon-content-carousel {
  --lemon-dots-offset: 0px;
}

.lemon-content-carousel .lemon-carousel-dots-top-left,
.lemon-content-carousel .lemon-carousel-dots-bottom-left {
  padding-left: var(--lemon-dots-offset, 0px);
  box-sizing: border-box;
}

.lemon-content-carousel .lemon-carousel-dots-top-right,
.lemon-content-carousel .lemon-carousel-dots-bottom-right {
  padding-right: var(--lemon-dots-offset, 0px);
  box-sizing: border-box;
}

.lemon-content-carousel .lemon-carousel-dots-top-center,
.lemon-content-carousel .lemon-carousel-dots-bottom-center {
  transform: translateX(var(--lemon-dots-offset, 0px));
}

.lemon-content-carousel .lemon-carousel-dots-top-first,
.lemon-content-carousel .lemon-carousel-dots-bottom-first {
  padding-left: calc(var(--lemon-first-slide-offset, 0px) + var(--lemon-dots-offset, 0px));
  box-sizing: border-box;
}
