/**
 * Product Slider - High Performance, SEO Optimized
 */

/* Container */
.ktos-product-slider-wrapper {
  width: 100%;
  padding: 30px 0;
  background: #f5f7fb;
  contain: layout style;
  will-change: transform;
}

/* Desktop - Larger Arrows */
@media (min-width: 1025px) {
  .ktos-slider-arrow {
    width: 48px;
    height: 48px;
  }
  
  .ktos-slider-arrow svg {
    width: 28px;
    height: 28px;
  }
}

.ktos-slider-container {
  max-width: var(--ktos-max-width, 1400px);
  margin: 0 auto;
  padding: 0 var(--ktos-padding, 40px);
}

/* Header */
.ktos-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.ktos-slider-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #0b1020;
  margin: 0;
  line-height: 1.3;
}

.ktos-view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid #10b981;
  border-radius: 25px;
  color: #10b981;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ktos-view-all:hover,
.ktos-view-all:focus {
  background: #10b981;
  color: #fff;
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Slider Main Container */
.ktos-slider-main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Navigation Arrows */
.ktos-slider-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(16, 185, 129, 0.9);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ktos-slider-arrow:hover {
  background: #10b981;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.ktos-slider-arrow:active {
  transform: scale(0.95);
}

.ktos-slider-arrow:focus {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.ktos-slider-arrow:focus:not(:focus-visible) {
  outline: none;
}

.ktos-slider-arrow svg {
  width: 24px;
  height: 24px;
}

.ktos-slider-prev {
  order: -1;
}

.ktos-slider-next {
  order: 1;
}

/* Track Wrapper */
.ktos-slider-track-wrapper {
  position: relative;
  overflow: hidden;
  flex: 1;
}

/* Slider Track - Horizontal Scroll */
.ktos-slider-track {
  display: flex;
  gap: var(--ktos-gap, 20px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 0 20px;
  cursor: grab;
  will-change: scroll-position;
}

.ktos-slider-track::-webkit-scrollbar {
  display: none;
}

.ktos-slider-track:active,
.ktos-slider-track.grabbing {
  cursor: grabbing;
  scroll-behavior: auto;
}

/* Product Slide */
.ktos-product-slide {
  flex: 0 0 var(--ktos-desktop, 20%);
  min-width: var(--ktos-desktop, 20%);
  max-width: var(--ktos-desktop, 20%);
  scroll-snap-align: start;
  contain: layout style paint;
}

/* Product Card */
.ktos-product-card {
  display: block;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.ktos-product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.ktos-product-card:focus {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Product Image */
.ktos-product-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f0f2f5;
}

.ktos-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  will-change: transform;
}

.ktos-product-card:hover .ktos-product-image img {
  transform: scale(1.05);
}

.ktos-no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 13px;
}

/* Product Content */
.ktos-product-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ktos-product-content h3 {
  font-size: 14px;
  font-weight: 500;
  color: #0b1020;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.ktos-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #10b981;
}

.ktos-price {
  font-size: 15px;
  font-weight: 600;
  color: #0b1020;
  margin-top: 2px;
}

.ktos-price del {
  color: #888;
  font-size: 12px;
  margin-right: 6px;
  font-weight: 400;
}

.ktos-price ins {
  text-decoration: none;
  color: #10b981;
}

.ktos-book-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-top: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ktos-book-btn:hover {
  background: #059669;
}

/* Tablet - Show Arrows */
@media (max-width: 1024px) {
  .ktos-product-slide {
    flex: 0 0 var(--ktos-tablet, 25%);
    min-width: var(--ktos-tablet, 25%);
    max-width: var(--ktos-tablet, 25%);
  }
  
  .ktos-slider-header h2 {
    font-size: 22px;
  }
  
  .ktos-slider-arrow {
    width: 40px;
    height: 40px;
  }
  
  .ktos-slider-arrow svg {
    width: 20px;
    height: 20px;
  }
}

/* Mobile - Hide Arrows */
@media (max-width: 768px) {
  .ktos-slider-arrow {
    display: none !important;
  }
  
  .ktos-slider-main {
    gap: 0;
  }
  
  .ktos-slider-container {
    padding: 0 16px;
  }
  
  .ktos-slider-header {
    margin-bottom: 16px;
  }
  
  .ktos-slider-header h2 {
    font-size: 20px;
  }
  
  .ktos-view-all {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .ktos-product-slide {
    flex: 0 0 var(--ktos-mobile, 50%);
    min-width: var(--ktos-mobile, 50%);
    max-width: var(--ktos-mobile, 50%);
  }
  
  .ktos-product-content {
    padding: 12px;
  }
  
  .ktos-product-content h3 {
    font-size: 13px;
    min-height: 36px;
  }
  
  .ktos-price {
    font-size: 14px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .ktos-slider-header h2 {
    font-size: 18px;
  }
  
  .ktos-book-btn {
    padding: 8px;
    font-size: 12px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .ktos-slider-track {
    scroll-behavior: auto;
  }
  
  .ktos-product-card,
  .ktos-product-image img,
  .ktos-view-all {
    transition: none;
  }
}

/* Focus Visible */
.ktos-view-all:focus-visible,
.ktos-product-card:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .ktos-product-slider-wrapper {
    page-break-inside: avoid;
  }
  
  .ktos-slider-track {
    overflow: visible;
    flex-wrap: wrap;
  }
  
  .ktos-product-slide {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .ktos-view-all {
    border-width: 2px;
  }
  
  .ktos-product-card {
    border: 1px solid #fff;
  }
}
