/* Сетка проектов */
.yug-projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.yug-project-card {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: #fff;
  color: inherit;
  text-align: left;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
  width: 100%;
  font: inherit;
}

.yug-project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.yug-project-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4/3;
  background: #f1f5f9;
  overflow: hidden;
}

.yug-project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.yug-project-card:hover .yug-project-card__media img {
  transform: scale(1.04);
}

.yug-card-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: flex;
  gap: 8px;
  align-items: center;
}

.yug-area-badge {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
}

.yug-3d-badge {
  padding: 7px 11px;
  border-radius: 999px;
  background: #00a7af;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 167, 175, 0.3);
}

.yug-project-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px 18px;
}

.yug-project-card__title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: #1e293b;
}

.yug-project-card__area {
  font-size: 14px;
  color: #64748b;
}

/* Модальное окно */
.yug-modal-open {
  overflow: hidden;
}

.yug-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.yug-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(5px);
}

.yug-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 36px));
  height: min(680px, calc(100vh - 48px));
  max-height: 680px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  box-sizing: border-box;
}

.yug-modal__close {
  position: absolute;
  z-index: 25;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
}

.yug-modal__close:hover {
  transform: rotate(90deg);
  background: #ffffff;
}

.yug-modal__content {
  display: grid;
  grid-template-columns: 1.55fr 360px;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

/* Левая часть (медиа) */
.yug-modal__left {
  min-width: 0;
  height: 100%;
  max-height: 100%;
  background: #f8fafc;
  border-right: 1px solid #edf2f7;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.yug-media-box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.yug-media-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.yug-media-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.yug-media-tab:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.yug-media-tab.is-active {
  background: #00a7af;
  border-color: #00a7af;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 167, 175, 0.25);
}

.yug-slider,
.yug-3d-stage {
  display: none;
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  flex-direction: column;
}

.yug-slider.is-active,
.yug-3d-stage.is-active {
  display: flex;
}

.yug-slider__stage {
  position: relative !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.yug-slider__slide {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.yug-slider__slide.is-active {
  display: block;
}

.yug-area-badge--modal {
  position: absolute !important;
  top: 14px !important;
  left: 14px !important;
  z-index: 10 !important;
}

.yug-quick-3d-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 10;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 0;
  background: #00a7af;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 167, 175, 0.45);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.25s ease;
}

.yug-quick-3d-btn:hover {
  background: #736ea9;
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 24px rgba(115, 110, 169, 0.5);
}

.yug-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: #1e293b;
  font-size: 28px;
  line-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
}

.yug-slider__nav--prev { left: 14px; }
.yug-slider__nav--next { right: 14px; }

.yug-slider__nav--prev:hover {
  transform: translateY(-50%) translateX(-2px);
  background: #ffffff;
}

.yug-slider__nav--next:hover {
  transform: translateY(-50%) translateX(2px);
  background: #ffffff;
}

.yug-slider__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  flex-shrink: 0;
  height: 56px;
}

.yug-slider__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 52px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.yug-slider__thumb:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.yug-slider__thumb.is-active {
  border-color: #00a7af;
  opacity: 1;
}

.yug-slider__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 3D Сцена */
.yug-3d-stage {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.yug-3d-stage model-viewer {
  width: 100% !important;
  height: 100% !important;
  display: block;
  outline: none;
}

/* Правая часть */
.yug-modal__right {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  padding: 22px 22px 18px;
  background: #ffffff;
  box-sizing: border-box;
  overflow: hidden;
}

.yug-modal__header {
  flex-shrink: 0;
  padding-right: 36px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}

.yug-modal__header h2 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

.yug-modal__area {
  color: #64748b;
  font-size: 13px;
}

.yug-equipment-heading {
  flex-shrink: 0;
  margin: 16px 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

.yug-equipment-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.yug-equipment-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  text-decoration: none !important;
  color: #1e293b !important;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  box-sizing: border-box;
  width: 100%;
}

.yug-equipment-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateX(2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.yug-equipment-card__image {
  flex: 0 0 52px;
  width: 52px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
}

.yug-equipment-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yug-equipment-card__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.yug-equipment-card__info strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.yug-equipment-card__info small {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.yug-equipment-card__arrow {
  flex: 0 0 auto;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.yug-equipment-card:hover .yug-equipment-card__arrow {
  color: #00a7af;
  transform: translateX(3px);
}

.yug-equipment-empty {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.yug-order-block {
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.yug-order-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 13px 20px;
  background: #00a7af;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.yug-order-button:hover {
  background: #736ea9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(115, 110, 169, 0.38);
}

/* Всплывающее окно формы заказа */
.yug-order-submodal {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.yug-order-submodal[hidden] {
  display: none;
}

.yug-order-submodal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.yug-order-submodal__dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  padding: 26px 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.yug-order-submodal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.yug-order-submodal__header {
  margin-bottom: 14px;
}

.yug-order-submodal__title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}

.yug-order-submodal__subtitle {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.yug-order-form {
  overflow-y: auto;
  padding-right: 4px;
  max-height: calc(90vh - 120px);
}

.yug-order-form .wpcf7 form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.yug-order-form .wpcf7 form > p {
  margin: 0;
}

.yug-order-form .wpcf7-acceptance,
.yug-order-form .wpcf7-submit,
.yug-order-form .wpcf7-response-output {
  grid-column: 1 / -1;
}

.yug-order-form input[type="text"],
.yug-order-form input[type="tel"],
.yug-order-form input[type="email"],
.yug-order-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.yug-order-form input[type="submit"] {
  width: 100%;
  background: #00a7af;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  margin-bottom: 8px;
  display: block;
  transition: background 0.3s ease;
}

.yug-order-form input[type="submit"]:hover {
  background: #736ea9;
}

/* =========================================
   АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ И СМАРТФОНОВ
   ========================================= */

@media (max-width: 960px) {
  .yug-projects-grid { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
  }
  
  .yug-modal {
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
  }
  
  .yug-modal__dialog {
    height: auto !important;
    max-height: none !important;
    overflow: visible;
    margin: auto;
  }
  
  .yug-modal__content {
    display: flex;
    flex-direction: column;
    height: auto !important;
    max-height: none !important;
    overflow: visible;
  }

  .yug-modal__left {
    height: auto !important;
    max-height: none !important;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid #edf2f7;
    overflow: visible;
  }

  .yug-media-box {
    height: auto !important;
    overflow: visible;
  }

  .yug-slider,
  .yug-3d-stage {
    flex: none !important;
    height: 380px !important;
  }

  .yug-slider__stage {
    height: 300px !important;
    flex: none !important;
  }

  .yug-modal__right {
    height: auto !important;
    max-height: none !important;
    padding: 20px 16px 24px;
    overflow: visible;
  }

  .yug-equipment-list {
    max-height: none;
    overflow: visible;
  }

  .yug-order-form .wpcf7 form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .yug-projects-grid { 
    grid-template-columns: 1fr; 
    gap: 16px;
  }
  
  .yug-modal {
    padding: 0;
    display: block;
  }
  
  .yug-modal__dialog {
    width: 100%;
    border-radius: 0;
    min-height: 100vh;
    margin: 0;
  }

  .yug-modal__left {
    padding: 14px 12px 16px;
  }

  .yug-media-tabs {
    padding-right: 42px; /* чтобы не налезать на крестик */
    overflow-x: auto;
  }

  .yug-media-tab {
    padding: 7px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .yug-slider,
  .yug-3d-stage {
    height: 290px !important;
  }

  .yug-slider__stage {
    height: 220px !important;
  }

  .yug-slider__thumbs {
    height: 48px;
    margin-top: 8px;
  }

  .yug-slider__thumb {
    flex: 0 0 60px;
    width: 60px;
    height: 44px;
  }

  .yug-modal__close {
    top: 10px;
    right: 10px;
  }

  .yug-order-submodal {
    padding: 10px;
  }

  .yug-order-submodal__dialog {
    padding: 22px 16px;
    max-height: 95vh;
  }
}