/* =============================================================
   Cool Slider — Frontend Styles
   ============================================================= */

/* ---- Wrapper ---- */
.cool-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: #111;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Track ---- */
.cs-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

/* ---- Slide base ---- */
.cs-slide {
  flex: 0 0 100%;
  width: 100%;
  min-height: var(--cs-ht, 580px);
  position: relative;
  display: flex;
  align-items: center;
  /* overridden per-slide by .cs-valign-* */
  overflow: hidden;
  box-sizing: border-box;
}

/* Content vertical position */
.cs-valign-top {
  align-items: flex-start;
}

.cs-valign-center {
  align-items: center;
}

.cs-valign-bottom {
  align-items: flex-end;
}

/* ---- Image slide ---- */
.cs-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.04);
  transition: transform 8000ms ease;
  will-change: transform;
}

.cs-slide--image.cs-active .cs-bg {
  transform: scale(1);
}

.cs-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---- Content ---- */
.cs-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: var(--cs-pad-v, 60px) var(--cs-pad-h, 100px);
  box-sizing: border-box;
}

.cs-align-left .cs-inner {
  text-align: left;
  max-width: 660px;
}

.cs-align-center .cs-inner {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.cs-align-right .cs-inner {
  text-align: right;
  max-width: 660px;
  margin-left: auto;
}

/* ---- Content animation ---- */
.cs-inner {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease 0.15s, transform 0.65s ease 0.15s;
}

.cs-active .cs-inner {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Typography ---- */
.cs-subtitle {
  display: inline-block;
  font-size: var(--cs-title-size, 14px);
  font-weight: 700;
  color: #ffb400;
  margin: 0 0 14px;
  line-height: 1;
}

.cs-title {
  font-size: clamp(20px, 5vw, var(--cs-title-size, 64px));
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
  margin: 0 0 18px;
  color: inherit;
  letter-spacing: -0.5px;
}

.cs-desc {
  font-size: var(--cs-desc-size, 18px);
  line-height: 1.75;
  margin: 0 0 25px;
  color: inherit;
  opacity: 0.88;
  max-width: 580px;
}

.cs-align-center .cs-desc,
.cs-align-right .cs-desc {
  max-width: 100%;
}

/* ---- CTA Button ---- */
.cs-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.cs-align-center .cs-actions {
  justify-content: center;
}

.cs-align-right .cs-actions {
  justify-content: flex-end;
}

.cs-btn {
  display: inline-block;
  padding: 15px 34px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.22s, transform 0.22s, background 0.22s;
  border: 2px solid transparent;
}

.cs-btn:hover {
  transform: translateY(-2px);
}

.cs-btn--primary {
  background: #ffb400;
  color: #111;
  border-color: #ffb400;
}

.cs-btn--primary:hover {
  background: #ffca45;
  border-color: #ffca45;
}

.cs-btn--outline {
  background: transparent;
  color: inherit;
  border-color: rgba(255, 255, 255, 0.55);
}

.cs-btn--outline:hover {
  border-color: rgba(255, 255, 255, 0.9);
}

/* ---- Full-slide link (when button label is empty but URL is set) ---- */
.cs-slide-link {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
}

.cs-slide--linked {
  cursor: pointer;
}

/* ---- Arrow buttons ---- */
.cs-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cs-arrow-bg, rgba(255, 255, 255, 0.1));
  border: 1.5px solid var(--cs-arrow-border, var(--cs-arrow-color, rgba(255, 255, 255, 0.2)));
  color: var(--cs-arrow-color, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cs-arrow:hover {
  background: var(--cs-arrow-bg, rgba(255, 255, 255, 0.22));
  border-color: var(--cs-arrow-border, var(--cs-arrow-color, rgba(255, 255, 255, 0.55)));
  transform: translateY(-50%) scale(1.1);
}

.cs-prev {
  left: 32px;
}

.cs-next {
  right: 32px;
}

.cs-arrow svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  display: block;
  flex-shrink: 0;
}

/* ---- Inline nav row: ‹ dots › at the bottom ---- */
/*
 * JS moves .cs-prev, .cs-dots, .cs-next into this div when
 * dotArrowAlign === 'inline'.  CSS only needs to lay them out.
 */
.cs-nav-row {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  /* don't let overflow:hidden clip us */
  pointer-events: none;
}

.cs-nav-row > * {
  pointer-events: auto;
}

/* Arrows inside the row lose their absolute positioning */
.cs-nav-row .cs-arrow {
  position: static !important;
  top: auto !important;
  transform: none !important;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.cs-nav-row .cs-arrow:hover {
  transform: scale(1.08) !important;
}

/* Dots inside the row lose their absolute positioning */
.cs-nav-row .cs-dots {
  position: static !important;
  transform: none !important;
  left: auto !important;
  bottom: auto !important;
}

/* Carousel: nav-row flows below the track (dots are already static there) */
.cs-mode-carousel .cs-nav-row {
  position: static;
  transform: none;
  left: auto;
  bottom: auto;
  justify-content: center;
  padding: 8px 0 4px;
}

/* In carousel the background is light — darken arrows automatically */
.cs-mode-carousel .cs-nav-row .cs-arrow {
  background: var(--cs-arrow-bg, rgba(0, 0, 0, 0.08));
  border-color: var(--cs-arrow-border, var(--cs-arrow-color, rgba(0, 0, 0, 0.18)));
  color: var(--cs-arrow-color, #1e293b);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cs-mode-carousel .cs-nav-row .cs-arrow:hover {
  background: var(--cs-arrow-bg, rgba(0, 0, 0, 0.14));
  border-color: var(--cs-arrow-border, var(--cs-arrow-color, rgba(0, 0, 0, 0.35)));
}

/* ---- Dot indicators ---- */
.cs-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.cs-dot {
  width: 8px;
  height: 8px;
  border-radius: 100px;
  background: var(--cs-dot-bg, rgba(255, 255, 255, 0.35));
  border: 1.5px solid var(--cs-dot-border, transparent);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: width 0.35s ease, background 0.35s ease, border-color 0.35s ease;
  outline: none;
  box-sizing: border-box;
}

.cs-dot:focus-visible {
  outline: 2px solid #ffb400;
  outline-offset: 2px;
}

.cs-dot.is-active {
  width: 28px;
  background: var(--cs-dot-active, #fff);
  border-color: var(--cs-dot-border, transparent);
}

/* Carousel mode: dots sit on a light background so need dark defaults */
.cs-mode-carousel .cs-dot {
  background: var(--cs-dot-bg, rgba(0, 0, 0, 0.18));
}

.cs-mode-carousel .cs-dot.is-active {
  background: var(--cs-dot-active, #1e293b);
}

/* ---- Slide counter ---- */
.cs-counter {
  position: absolute;
  bottom: 26px;
  right: 100px;
  z-index: 20;
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
}

.cs-cur {
  font-size: 20px;
  color: #fff;
  font-weight: 900;
}

.cs-sep {
  opacity: 0.4;
}

/* ---- Progress bar ---- */
.cs-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #ffb400;
  width: 0;
  z-index: 20;
}

/* ---- Empty placeholder ---- */
.cs-empty {
  padding: 48px;
  text-align: center;
  color: #888;
  font-size: 15px;
}

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

@media (max-width: 1024px) {
  .cs-counter {
    right: 60px;
  }
}

@media (max-width: 768px) {
  /* Tablet height — falls back to desktop height if --cs-ht-md not set */
  .cs-slide {
    min-height: var(--cs-ht-md, var(--cs-ht, 580px));
  }

  .cs-arrow {
    width: 42px;
    height: 42px;
  }

  .cs-prev {
    left: 14px;
  }

  .cs-next {
    right: 14px;
  }

  .cs-arrow svg {
    width: 16px;
    height: 16px;
  }

  .cs-counter {
    right: 28px;
    bottom: 22px;
  }

  .cs-dots {
    bottom: 22px;
  }

  .cs-content {
    padding: min(var(--cs-pad-v, 60px), 40px) min(var(--cs-pad-h, 100px), 32px);
  }
}

@media (max-width: 480px) {
  /* Mobile height — falls back to tablet, then desktop */
  .cs-slide {
    min-height: var(--cs-ht-sm, var(--cs-ht-md, var(--cs-ht, 580px)));
  }

  /* On very small screens hide side arrows; swipe to navigate */
  .cs-arrow {
    display: none;
  }

  /* Keep inline-nav arrows visible on mobile */
  .cs-nav-row .cs-arrow {
    display: flex !important;
    width: 32px;
    height: 32px;
  }

  /* Counter moves left since arrows are gone */
  .cs-counter {
    right: 20px;
  }

  .cs-content {
    padding: min(var(--cs-pad-v, 60px), 28px) min(var(--cs-pad-h, 100px), 18px);
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {

  .cs-track,
  .cs-inner,
  .cs-bg {
    transition: none !important;
    animation: none !important;
  }

  .cs-inner {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =============================================================
   CAROUSEL MODE
   ============================================================= */

.cs-mode-carousel {
  overflow: hidden;
  background: transparent;
  padding: 0;
}

.cs-mode-carousel .cs-track {
  display: flex;
  align-items: stretch;
  gap: var(--cs-gap, 14px);
}

/* All carousel slides look identical — no scale, opacity, or shadow differences */
.cs-mode-carousel .cs-slide {
  flex-shrink: 0;
  /* width & flex-basis set by JS */
  min-height: var(--cs-carousel-ht, 420px);
  border-radius: var(--cs-radius, 10px);
  overflow: hidden;
  opacity: 1;
  transform: none;
  box-shadow: none;
  transition: none;
}

/* Override the standard fade-in animation — show content immediately */
.cs-mode-carousel .cs-inner {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Keep bg-zoom off in carousel (it runs only on .cs-active in standard mode) */
.cs-mode-carousel .cs-bg {
  transform: none !important;
  transition: none !important;
}

/* Arrows sit inside the clipped area */
.cs-mode-carousel .cs-prev {
  left: 8px;
}

.cs-mode-carousel .cs-next {
  right: 8px;
}

/* No progress bar in carousel */
.cs-mode-carousel .cs-progress {
  display: none !important;
}

/* Slide count below the track */
.cs-mode-carousel .cs-counter {
  position: static;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  padding: 10px 0 4px;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
}

.cs-mode-carousel .cs-counter .cs-cur {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
}

.cs-mode-carousel .cs-counter .cs-tot {
  color: #94a3b8;
}

.cs-mode-carousel .cs-counter .cs-sep {
  opacity: .4;
}

/* Dots sit below the carousel, not overlaid */
.cs-mode-carousel .cs-dots {
  position: static;
  transform: none;
  left: auto;
  bottom: auto;
  padding: 8px 0 4px;
  justify-content: center;
}


/* =============================================================
   THUMBNAIL NAVIGATION
   ============================================================= */

.cs-thumbs {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px 8px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-wrap: wrap;
}

/* In carousel mode thumbs go below the slider, not over it */
.cs-mode-carousel .cs-thumbs {
  position: static;
  background: #f1f5f9;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid #e2e8f0;
  padding: 10px 12px;
  border-radius: 0 0 10px 10px;
  margin-top: 0;
}

.cs-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: none;
  opacity: 0.55;
  transition: opacity 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  outline: none;
  position: relative;
}

.cs-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.cs-thumb-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  border-radius: 4px;
}

.cs-thumb:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.cs-thumb.is-active {
  opacity: 1;
  border-color: #ffb400;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.cs-thumb:focus-visible {
  outline: 2px solid #ffb400;
  outline-offset: 2px;
}

/* Standard slider: thumbs overlay at bottom */
.cool-slider:not(.cs-mode-carousel) .cs-thumbs {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

/* Responsive: smaller thumbnails */
@media (max-width: 600px) {
  .cs-thumb {
    width: 48px;
    height: 34px;
  }
}