/**
 * Avangard Projects Slider Styles (v1.3.1)
 * ==========================================
 * - Круглые стрелки навигации (44px), идеально отцентрированные по вертикали карточек
 * - Видимые SVG-шевроны с фолбэком (не lucide, чистые inline SVG)
 * - 4 стиля отображения: avangard / avangard_detailed / modern_photo / clean_minimal
 */

:root {
  --cps-accent: #f59e0b;
  --cps-card-bg: #ffffff;
  --cps-title-color: #242424;
  --cps-card-title-color: #242424;
  --cps-font-family: 'Montserrat', sans-serif;
  --cps-title-fs: 24px;
  --cps-card-fs: 17px;
  --cps-radius: 8px;
}

.cps-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 25px 12px;
  box-sizing: border-box;
  font-family: var(--cps-font-family);
}

/* ---------- Header (копия WoodMart title с avangard-kuban.ru) ---------- */
.cps-header {
  text-align: center;
  margin-bottom: 28px;
}

.cps-header .cps-title-liner {
  display: inline-block;
  position: relative;
  padding-bottom: 10px;
}

.cps-header .cps-main-title {
  margin: 0;
  font-size: var(--cps-title-fs);
  font-weight: 700;
  color: var(--cps-title-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cps-header .cps-title-liner::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background-color: var(--cps-accent);
  border-radius: 2px;
}

.cps-header .cps-subtitle p {
  margin: 6px 0 0 0;
  font-size: 15px;
  color: #777777;
  font-style: italic;
}

/* ---------- Контейнер дорожки с защитными полями для стрелок ---------- */
.cps-track-container {
  position: relative;
  width: 100%;
  padding: 0 48px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .cps-track-container {
    padding: 0 38px;
  }
}

.cps-viewport {
  overflow: hidden;
  width: 100%;
  padding: 4px 0;
}

.cps-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.cps-slide {
  flex: 0 0 calc(100% / 3);
  padding: 0 5px;
  box-sizing: border-box;
  display: flex;
}

/* ---------- Карточка: Авангард (100% ДЕМО) ---------- */
.cps-box {
  background-color: var(--cps-card-bg);
  border: 1px solid #f1f5f9;
  border-radius: var(--cps-radius);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.12);
  padding: 24px 20px;
  width: 100%;
  min-height: 118px;
  box-sizing: border-box;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.cps-box:hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  transform: translateY(-3px);
}

.cps-box-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.cps-icon-col {
  flex-shrink: 0;
}

.cps-icon-wrapper {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fafafa;
  overflow: hidden;
  border: 1px solid #f1f5f9;
  transition: transform 0.3s ease;
}

.cps-box:hover .cps-icon-wrapper {
  transform: scale(1.05);
}

.cps-icon-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.cps-content-col {
  flex-grow: 1;
  text-align: left;
  min-width: 0;
}

.cps-box-title {
  margin: 0 0 4px 0;
  font-size: var(--cps-card-fs);
  font-weight: 700;
  color: var(--cps-card-title-color);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cps-box-city p {
  margin: 0;
  font-size: 13px;
  color: #777777;
}

.cps-box-materials {
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
  background: #f8fafc;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

/* ------------------------------------------------------------
   ВАРИАНТ В: Кейсы с фото объектов (cps-style-modern_photo)
   ------------------------------------------------------------ */
.cps-style-modern_photo .cps-slide {
  align-items: stretch;
}

.cps-style-modern_photo .cps-box {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--cps-radius);
  justify-content: flex-start;
}

.cps-photo-media {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: #0f172a;
}

.cps-photo-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.cps-style-modern_photo .cps-box:hover .cps-photo-media > img {
  transform: scale(1.06);
}

.cps-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #334155, #0f172a);
}

.cps-photo-badge {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cps-photo-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0));
  color: #ffffff;
}

.cps-photo-overlay .cps-box-title {
  color: #ffffff;
  margin-bottom: 2px;
  line-height: 1.3;
}

.cps-photo-overlay .cps-box-city p {
  color: #cbd5e1;
  font-size: 12px;
  margin: 0;
}

.cps-photo-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.cps-photo-materials {
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cps-photo-materials strong {
  color: #242424;
}

.cps-photo-more {
  color: var(--cps-accent);
  font-weight: 700;
  font-size: 12px;
  margin-top: auto;
}

/* ------------------------------------------------------------
   ВАРИАНТ Г: Минималистичный (cps-style-clean_minimal)
   ------------------------------------------------------------ */
.cps-style-clean_minimal .cps-slide {
  align-items: stretch;
}

.cps-style-clean_minimal .cps-box {
  box-shadow: none;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 0;
  gap: 12px;
  cursor: pointer;
}

.cps-style-clean_minimal .cps-box:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.cps-minimal-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
}

.cps-minimal-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ---------- СТРЕЛКИ НАВИГАЦИИ (исправлено) ----------
   Круглые кнопки 44px, строго по центру карточек (top: 50%),
   видимые SVG-шевроны, disabled-состояние как wd-disabled в ДЕМО */
.cps-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  z-index: 30;
  transition: all 0.2s ease;
}

.cps-nav-btn svg {
  display: block;
  width: 20px;
  height: 20px;
}

.cps-nav-btn:hover {
  background: var(--cps-accent);
  color: #ffffff;
  border-color: var(--cps-accent);
  transform: translateY(-50%) scale(1.06);
}

.cps-nav-btn:active {
  transform: translateY(-50%) scale(0.93);
}

.cps-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: translateY(-50%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.cps-nav-btn:disabled:hover {
  background: #ffffff;
  color: #334155;
  border-color: #e2e8f0;
  transform: translateY(-50%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.cps-nav-prev {
  left: 0;
}

.cps-nav-next {
  right: 0;
}

@media (max-width: 640px) {
  .cps-nav-btn {
    width: 36px;
    height: 36px;
  }
  .cps-nav-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* ---------- Точки пагинации ---------- */
.cps-pagination-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.cps-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
}

.cps-dot.is-active {
  background: var(--cps-accent);
  width: 24px;
  border-radius: 8px;
}

/* ---------- Модальное окно ---------- */
.cps-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
}

.cps-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cps-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}

.cps-modal-dialog {
  position: relative;
  z-index: 2;
  background: #ffffff;
  border-radius: 12px;
  max-width: 640px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  padding: 24px;
}

.cps-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f1f5f9;
  border: none;
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cps-slide {
    flex: 0 0 50%;
  }
}

@media (max-width: 600px) {
  .cps-slide {
    flex: 0 0 100%;
  }
  .cps-header .cps-main-title {
    font-size: 20px;
  }
  .cps-box {
    padding: 20px 16px;
  }
  .cps-modal-dialog {
    padding: 16px;
  }
}
