/* Черновик карточки товара «как WooCommerce»: только страница product/_layout-stair-preview.html */

.product-stair-wc {
  padding-bottom: 3rem;
}

.product-stair-wc-wrap {
  max-width: 1180px;
}

/* Крошки — первой строкой витрины, над сеткой фото+карточка */
.product-stair-wc-wrap > .product-stair-wc-crumbs {
  display: block;
  margin: 0 0 0.65rem;
}

.product-stair-wc-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 450px);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

@media (min-width: 881px) {
  .product-stair-wc-top {
    /* Нижняя колонка часто выше: блок с фото по вертикали по центру строки */
    align-items: center;
  }
}

@media (max-width: 880px) {
  .product-stair-wc-top {
    grid-template-columns: 1fr;
  }
}

/* —— Галерея —— */
.product-stair-wc-gallery {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

/* Заголовок «Наши работы» в секции masonry: после блока с гарантией, перед сеткой (не в колонке с фото — иначе на моб. он оказывается над крошками) */
.product-stair-wc-works .product-stair-wc-works-heading {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0.35rem;
  width: 100%;
}

@media (min-width: 881px) {
  .product-stair-wc-works .product-stair-wc-works-heading {
    padding-top: 0.5rem;
  }
}

.product-stair-wc-main-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  /* Без фиксированного квадрата: обводка только вокруг самого фото, без полей letterbox */
  align-self: start;
  width: 100%;
}

.product-stair-wc-main-img {
  display: block;
  width: 100%;
  height: auto;
}

.product-stair-wc-main-open {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
  padding: 0;
  margin: 0;
  border: none;
  cursor: zoom-in;
  background: transparent;
  border-radius: inherit;
  text-align: left;
}

.product-stair-wc-main-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.product-stair-wc-main-open-badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  font-size: 1.15rem;
  line-height: 1;
  pointer-events: none;
}

.product-stair-wc-main-open:hover .product-stair-wc-main-open-badge {
  background: #fff;
}

/* Десктоп: главное фото не выше блока справа; рамка облегает картинку (без полос по бокам) */
@media (min-width: 881px) {
  .product-stair-wc-main-frame {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    max-height: clamp(300px, 58vh, 560px);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .product-stair-wc-main-open {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    text-align: center;
  }

  .product-stair-wc-main-img {
    width: auto;
    max-width: 100%;
    max-height: clamp(300px, 58vh, 560px);
    height: auto;
    object-fit: contain;
  }
}

.product-stair-wc-thumbs-outer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.product-stair-wc-thumbs-scroll {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.15rem 0;
  scrollbar-width: thin;
}

.product-stair-wc-thumbs-scroll::-webkit-scrollbar {
  height: 6px;
}

.product-stair-wc-thumbs-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.product-stair-wc-thumb {
  flex: 0 0 auto;
  width: 4.75rem;
  height: 4.75rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.product-stair-wc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-stair-wc-thumb:hover,
.product-stair-wc-thumb:focus-visible {
  border-color: rgba(45, 106, 79, 0.45);
}

.product-stair-wc-thumb.is-active {
  border-color: var(--accent);
}

.product-stair-wc-thumbs-next {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}

.product-stair-wc-thumbs-next:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Блок «Наши работы» на карточке: та же masonry + lightbox, что на pages/gallery.html (assets/gallery.js) */
.product-stair-wc-works.home-works {
  padding-top: 0.65rem;
  padding-bottom: 0;
}

.product-stair-gallery-mount {
  margin-top: 0.15rem;
}

/* SEO-текст под галереей */
.product-stair-seo {
  margin-top: 2rem;
  padding-top: 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text);
}

/* SEO h3 — та же схема, что у «Наши работы»: .home-works-heading + .home-h2-split + .home-head-split__* */
.product-stair-seo > h3.home-works-heading.home-h2-split:first-of-type {
  margin-top: 0;
}

.product-stair-seo > h3.home-works-heading.home-h2-split:not(:first-of-type) {
  margin-top: 1.75rem;
}

/* FAQ-аккордеон: классы home-faq-* из style.css; на карточке — на всю ширину блока */
.product-stair-seo .product-stair-seo-faq.home-faq-list {
  max-width: none;
  margin: 0;
}

.product-stair-seo p {
  margin: 0 0 0.85rem;
}

.product-stair-seo p:last-child {
  margin-bottom: 0;
}

.product-stair-seo-list {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.product-stair-seo-list li {
  margin-bottom: 0.5rem;
}

.product-stair-seo-list li:last-child {
  margin-bottom: 0;
}

.product-stair-seo-list--num {
  list-style: decimal;
}

/* —— Легенда справа —— */
.product-stair-wc-summary {
  font-size: 0.95rem;
}

.product-stair-wc-crumbs {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.product-stair-wc-crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.product-stair-wc-crumbs a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.product-stair-wc-crumbs-sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

.product-stair-wc-title {
  margin: 0 0 1rem;
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

/* 2×2: слева — «Цена от»+старая (верх) и новая цена (низ), справа — объединённая колонка с кнопкой */
.product-stair-wc-price-cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0;
  margin-bottom: 1.1rem;
  line-height: 1.35;
}

.product-stair-wc-price-cta-grid__from {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  gap: 0.25rem 0.4rem;
  min-width: 0;
  padding: 0.42rem 0.5rem 0.15rem 0.6rem;
}

.product-stair-wc-price-cta-grid__current {
  grid-column: 1;
  grid-row: 2;
  padding: 0.1rem 0.45rem 0.4rem 0.6rem;
  min-width: 0;
  text-align: right;
}

.product-stair-wc-price-cta-grid__action {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-content: center;
  place-items: center;
  align-self: stretch;
  min-height: 0;
  min-width: min(12.25rem, 44vw);
  box-sizing: border-box;
  padding: 0.4rem 0.5rem 0.4rem 0.4rem;
}

.product-stair-wc-price-cta-grid__action .product-stair-wc-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  white-space: normal;
  line-height: 1.2;
  font-size: 0.95rem;
  padding: 0.7rem 0.65rem;
  gap: 0.1em;
  align-self: center;
  border-radius: 11px;
}

.product-stair-wc-price-cta-grid__action .product-stair-wc-cta .product-stair-wc-cta__line {
  display: block;
  line-height: 1.1;
}

.product-stair-wc-price-label {
  display: inline;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.product-stair-wc-price-old {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: #c62828;
  text-decoration-thickness: 1.5px;
  white-space: nowrap;
}

.product-stair-wc-price-current {
  font-size: 1.82rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.12;
}

.product-stair-wc-includes-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.product-stair-wc-includes-list {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--text);
}

.product-stair-wc-includes-list li {
  margin-bottom: 0.35rem;
}

.product-stair-wc-spec {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.product-stair-wc-excerpt-body {
  line-height: 1.5;
}

.product-stair-wc-excerpt.is-collapsed .product-stair-wc-excerpt-body {
  max-height: var(--excerpt-6l, 8.1em);
  overflow: hidden;
}

.product-stair-wc-excerpt-toggle {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0073aa;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.product-stair-wc-excerpt-toggle:hover {
  color: #005a87;
}

.product-stair-wc-excerpt-toggle:focus-visible {
  outline: 2px solid var(--accent, #0073aa);
  outline-offset: 2px;
}

.product-stair-wc-highlight {
  margin: 0.35rem 0;
  font-size: 0.95rem;
}

.product-stair-wc-cta {
  display: inline-flex;
  margin-top: 0;
  padding: 0.85rem 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.88rem;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.product-stair-wc-cta:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.product-stair-wc-preview-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* —— Лайтбокс галереи: затемнение как у .home-video-dialog (backdrop из style.css); без внешней «рамки» окна —— */
.product-stair-lb.home-video-dialog {
  max-height: min(96dvh, 100dvh);
  overflow: hidden;
  background: transparent;
  color: #fff;
  border: none;
  box-shadow: none;
  box-sizing: border-box;
}

.product-stair-lb-inner.home-video-dialog__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  background: transparent;
  padding: 0.65rem 0.85rem 0.85rem;
  box-sizing: border-box;
}

/* Шапка с «×» на фоне окна (#0a0a0a), не на чёрной подложке кадра */
.product-stair-lb-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  padding: 0 0 0.15rem;
  box-sizing: border-box;
}

.product-stair-lb-inner .product-stair-lb-head .home-video-dialog__close {
  position: static;
  flex-shrink: 0;
}

/* «Закрыть» — как стрелки (.product-stair-lb-nav): заметный белый круг */
.product-stair-lb .product-stair-lb-head .home-video-dialog__close,
.product-stair-lb .product-stair-lb-head .product-stair-lb-close {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: var(--shadow);
  transition: background 0.15s ease;
}

.product-stair-lb .product-stair-lb-head .home-video-dialog__close:hover,
.product-stair-lb .product-stair-lb-head .home-video-dialog__close:focus-visible,
.product-stair-lb .product-stair-lb-head .product-stair-lb-close:hover,
.product-stair-lb .product-stair-lb-head .product-stair-lb-close:focus-visible {
  background: #fff;
}

.product-stair-lb-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
}

/* Ряд: стрелки на фоне окна, чёрная подложка только у .product-stair-lb-stage */
.product-stair-lb-row {
  flex: 0 1 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 0;
  max-width: 100%;
  width: max-content;
  box-sizing: border-box;
}

/* Чёрная подложка = только узкая рамка вокруг фото (паспарту) */
.product-stair-lb-stage {
  flex: 0 1 auto;
  min-width: 0;
  width: fit-content;
  max-width: min(calc(100vw - 6.5rem), 1200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  line-height: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.product-stair-lb-img {
  display: block;
  max-width: 100%;
  max-height: min(78dvh, calc(100dvh - 13rem));
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

/* Как .slide-prev / .slide-next у баннера */
.product-stair-lb-nav {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: background 0.15s ease;
}

.product-stair-lb-nav:hover,
.product-stair-lb-nav:focus-visible {
  background: #fff;
}

@media (max-width: 520px) {
  .product-stair-lb-nav {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.35rem;
  }

  .product-stair-lb-stage {
    max-width: min(calc(100vw - 5.75rem), 1200px);
  }
}

/* Миниатюры на фоне окна, без отдельной «чёрной полки» под кадром */
.product-stair-lb-thumbs {
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0 0.15rem;
  margin: 0;
  max-width: calc(100vw - 2.5rem);
  width: max-content;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow-x: auto;
  box-sizing: border-box;
}

.product-stair-lb-thumb {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0.88;
  transition:
    opacity 0.15s ease,
    border-color 0.15s ease;
}

.product-stair-lb-thumb:hover,
.product-stair-lb-thumb:focus-visible {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.42);
}

.product-stair-lb-thumb.is-active {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.product-stair-lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* —— Модалка «Заказать расчёт» —— */
.product-stair-order-dialog {
  width: calc(100vw - 1.5rem);
  max-width: 56rem;
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: #111;
  box-sizing: border-box;
}

.product-stair-order-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.product-stair-order-panel {
  background: #fff;
  border: 4px solid #000;
  border-radius: 2px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  max-height: min(92dvh, 92vh);
  overflow: auto;
}

.product-stair-order-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.product-stair-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #ddd;
}

.product-stair-order-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
}

.product-stair-order-close {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.product-stair-order-close:hover,
.product-stair-order-close:focus-visible {
  background: #333;
}

.product-stair-order-form {
  padding: 1rem 1.25rem 1.35rem;
}

.product-stair-order-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}

@media (max-width: 820px) {
  .product-stair-order-grid {
    grid-template-columns: 1fr;
  }
}

.product-stair-order-col-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.product-stair-order-field {
  margin-bottom: 0.85rem;
}

.product-stair-order-field:last-child {
  margin-bottom: 0;
}

.product-stair-order-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #333;
}

.product-stair-order-req {
  color: #c41e3a;
  font-weight: 700;
}

.product-stair-order-input,
.product-stair-order-textarea,
.product-stair-order-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.92rem;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  background: #fff;
  color: #111;
}

.product-stair-order-textarea {
  resize: vertical;
  min-height: 7rem;
}

.product-stair-order-input:focus-visible,
.product-stair-order-textarea:focus-visible,
.product-stair-order-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: #999;
}

.product-stair-order-stars {
  display: flex;
  gap: 0.2rem;
}

.product-stair-order-star {
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.65rem;
  line-height: 1;
  color: #d4d4d4;
  transition: color 0.12s ease;
}

.product-stair-order-star.is-active,
.product-stair-order-star:hover {
  color: #eab308;
}

.product-stair-order-consent-block {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e5e5;
  text-align: center;
}

.product-stair-order-consent-note {
  margin: 0 auto;
  max-width: 36rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #555;
  text-align: center;
}

.product-stair-order-consent-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.product-stair-order-consent-note a:hover {
  color: var(--accent-hover);
}

.product-stair-order-error {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: #b91c1c;
}

.product-stair-order-status {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: #444;
}

.product-stair-order-actions {
  margin-top: 1.1rem;
  display: flex;
  justify-content: center;
}

.product-stair-order-submit {
  min-width: min(100%, 16rem);
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.product-stair-order-submit:hover,
.product-stair-order-submit:focus-visible {
  background: var(--accent-hover);
}

.product-stair-order-submit:disabled {
  opacity: 0.75;
  cursor: wait;
}

.product-stair-order-thanks {
  padding: 2rem 1.5rem 2.25rem;
  text-align: center;
}

.product-stair-order-thanks p {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  line-height: 1.5;
}
