.crs-slider-wrapper {
  width: 100%;
  position: relative;
  overflow: hidden;
  /* Height will be set dynamically via inline styles and JavaScript */
}

.crs-slider {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
  /* All slides are laid out horizontally, transform moves them */
}

.crs-slide {
  flex: 0 0 100%; /* Each slide takes full width of the wrapper */
  width: 100%;
  height: 100%;
  position: relative;
  box-sizing: border-box;
}

.crs-slide-link {
  display: block;
  width: 100%;
  height: 100%;
}

.crs-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Special handling for different object-fit values - enhanced specificity */
.crs-slider-wrapper .crs-slide img.crs-image-fit-contain {
  height: auto !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.crs-slider-wrapper .crs-slide img.crs-image-fit-cover {
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
}

.crs-slider-wrapper .crs-slide img.crs-image-fit-fill {
  height: 100% !important;
  max-height: none !important;
  object-fit: fill !important;
}

.crs-slider-wrapper .crs-slide img.crs-image-fit-none {
  height: 100% !important;
  max-height: none !important;
  object-fit: none !important;
  max-width: 100%;
}

/* Mobile image handling - hide mobile images by default */
.crs-slide img.crs-mobile-image {
  display: none;
}

/* Show mobile images and hide desktop images on mobile devices */
@media screen and (max-width: 768px) {
  .crs-slide img.crs-desktop-image {
    display: none;
  }
  
  .crs-slide img.crs-mobile-image {
    display: block;
  }
}

/* Tablet portrait - use mobile images */
@media screen and (min-width: 769px) and (max-width: 1366px) and (orientation: portrait) {
  .crs-slide img.crs-desktop-image {
    display: none;
  }
  
  .crs-slide img.crs-mobile-image {
    display: block;
  }
}

/* Tablet landscape - use desktop images */
@media screen and (min-width: 769px) and (max-width: 1366px) and (orientation: landscape) {
  .crs-slide img.crs-desktop-image {
    display: block;
  }
  
  .crs-slide img.crs-mobile-image {
    display: none;
  }
}

/* WCAG Accessibility Improvements */
.crs-slider-nav button {
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.crs-slider-nav button:focus {
  outline: 2px solid #e1e1e1;
  outline-offset: 2px;
  background: rgba(0, 95, 204, 0.8);
}

.crs-slider-nav button:hover {
  background: rgba(0, 0, 0, 0.7);
}

.crs-dot {
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none;
  box-sizing: border-box !important;
}

.crs-slider-wrapper .crs-slider-dots .crs-dot:focus,
.crs-dot:focus {
  outline: 2px solid #e1e1e1 !important;
  outline-offset: 2px !important;
}

.crs-slider-wrapper .crs-slider-dots .crs-dot:hover,
.crs-dot:hover {
  opacity: 0.8;
}

/* Hide elements properly for screen readers */
.crs-slide[aria-hidden="true"] {
  visibility: hidden;
}

.crs-slide[aria-hidden="false"] {
  visibility: visible;
}

/* Ensure slider wrapper is focusable for keyboard navigation */
.crs-slider-wrapper {
  position: relative;
}

.crs-slider-wrapper:focus {
  outline: 2px solid #e1e1e1;
  outline-offset: 2px;
}

.crs-button-wrapper {
  position: absolute;
  z-index: 10;
  /* Default positioning when no custom classes are applied */
  bottom: 20px;
  left: 20px;
}

/* Horizontal positioning - override defaults */
.crs-button-wrapper.crs-button-h-left {
  left: 20px !important;
  right: auto !important;
  transform: none !important;
}

.crs-button-wrapper.crs-button-h-center {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}

.crs-button-wrapper.crs-button-h-right {
  right: 20px !important;
  left: auto !important;
  transform: none !important;
}

/* Vertical positioning - override defaults */
.crs-button-wrapper.crs-button-v-top {
  top: 20px !important;
  bottom: auto !important;
}

.crs-button-wrapper.crs-button-v-center {
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
}

.crs-button-wrapper.crs-button-v-bottom {
  bottom: 20px !important;
  top: auto !important;
}

/* Handle both center alignments - override all transforms */
.crs-button-wrapper.crs-button-h-center.crs-button-v-center {
  transform: translate(-50%, -50%) !important;
}

.crs-button {
  background: #000;
  color: #fff;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.crs-button:hover {
  background: #333;
  color: #fff;
}

/* Navigation arrows */
.crs-slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
}

.crs-prev, .crs-next {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 15px 20px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 18px;
  pointer-events: auto;
  transition: background-color 0.3s ease;
}

.crs-prev:hover, .crs-next:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Dot indicators */
.crs-slider-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.crs-dot {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.5) !important;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none;
  box-sizing: border-box !important;
}

.crs-slider-wrapper .crs-slider-dots .crs-dot.active,
.crs-slider-wrapper .crs-slider-dots .crs-dot:hover,
.crs-dot.active,
.crs-dot:hover {
  background: rgba(255, 255, 255, 1) !important;
}

/* Additional reset for button elements used as dots */
.crs-slider-wrapper .crs-slider-dots .crs-dot,
.crs-dot {
  font-size: 0 !important;
  line-height: 0 !important;
  vertical-align: top !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  display: inline-block !important;
  text-indent: -9999px !important;
  overflow: hidden !important;
}

/* Responsive scaling for mobile devices */
@media screen and (max-width: 768px) {
  /* Adjust button wrapper positioning for mobile */
  .crs-button-wrapper.crs-button-h-left {
    left: 10px;
  }
  
  .crs-button-wrapper.crs-button-h-right {
    right: 10px;
  }
  
  .crs-button-wrapper.crs-button-v-top {
    top: 10px;
  }
  
  .crs-button-wrapper.crs-button-v-bottom {
    bottom: 10px;
  }
  
  .crs-button {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .crs-prev, .crs-next {
    padding: 10px 15px;
    font-size: 16px;
  }
  
  .crs-slider-nav {
    padding: 0 10px;
  }
  
  .crs-slider-dots {
    bottom: 10px;
  }
  
  .crs-dot {
    width: 10px;
    height: 10px;
  }
}

@media screen and (max-width: 480px) {
  .crs-button {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .crs-prev, .crs-next {
    padding: 8px 12px;
    font-size: 14px;
  }
}

/* Mobile image handling - hide mobile images by default, show via JavaScript when needed */
.crs-mobile-image {
  display: none;
}

/* Responsive image fit overrides - applied via JavaScript based on device type */
/* These classes are dynamically applied, but we ensure proper specificity */
@media screen and (max-width: 768px) {
  /* Mobile devices */
  .crs-slide img.crs-image-fit-contain {
    height: auto !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }
  
  .crs-slide img.crs-image-fit-cover {
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
  }
  
  .crs-slide img.crs-image-fit-fill {
    height: 100% !important;
    max-height: none !important;
    object-fit: fill !important;
  }
  
  .crs-slide img.crs-image-fit-none {
    height: 100% !important;
    max-height: none !important;
    object-fit: none !important;
  }
}

@media screen and (min-width: 769px) and (max-width: 1366px) {
  /* Tablet devices */
  .crs-slide img.crs-image-fit-contain {
    height: auto !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }
  
  .crs-slide img.crs-image-fit-cover {
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
  }
  
  .crs-slide img.crs-image-fit-fill {
    height: 100% !important;
    max-height: none !important;
    object-fit: fill !important;
  }
  
  .crs-slide img.crs-image-fit-none {
    height: 100% !important;
    max-height: none !important;
    object-fit: none !important;
  }
}

@media screen and (min-width: 1367px) {
  /* Desktop devices */
  .crs-slide img.crs-image-fit-contain {
    height: auto !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }
  
  .crs-slide img.crs-image-fit-cover {
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
  }
  
  .crs-slide img.crs-image-fit-fill {
    height: 100% !important;
    max-height: none !important;
    object-fit: fill !important;
  }
  
  .crs-slide img.crs-image-fit-none {
    height: 100% !important;
    max-height: none !important;
    object-fit: none !important;
  }
}
