/* ==========================================================================
   Furni Store — the WordPress layer.
   The approved Stage 1.5 stylesheet lives in theme.css; this file carries
   what the block editor and WooCommerce add on top of it: the block grid of
   the product page, the reset of the core block defaults and the commerce
   surfaces.

   Rules of the house: radius 3px, no shadow, no gradient, no blur,
   no monospace, no coloured side border above 1px.
   ========================================================================== */

/* ---- сброс ядра WordPress ------------------------------------------------ */

body.ostov h1,
body.ostov h2,
body.ostov h3,
body.ostov h4,
body.ostov h5,
body.ostov h6,
body.ostov p,
body.ostov figure,
body.ostov blockquote,
body.ostov dl,
body.ostov dd,
body.ostov ul,
body.ostov ol,
body.ostov table {
  margin: 0;
}

body.ostov ul,
body.ostov ol {
  padding: 0;
  list-style: none;
}

body.ostov .wp-block-heading,
body.ostov .wp-block-image,
body.ostov .wp-block-group,
body.ostov .wp-block-post-content,
body.ostov .wp-block-post-excerpt,
body.ostov .wp-block-post-title,
body.ostov .wp-block-query-title,
body.ostov .wp-block-button,
body.ostov .wp-block-buttons {
  margin: 0;
}

body.ostov .wp-block-image img {
  width: 100%;
  height: auto;
}

body.ostov :focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- шапка: бренд и навигация -------------------------------------------- */

body.ostov .wp-block-site-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .19em;
  line-height: 1;
  text-transform: uppercase;
}

body.ostov .wp-block-site-title a {
  color: var(--ink);
  text-decoration: none;
}

body.ostov .wp-block-site-tagline {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .15em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--ink-2);
}

body.ostov .nav .wp-block-navigation__container {
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: nowrap;
}

body.ostov .nav .wp-block-navigation-link {
  padding: 4px 0;
  font-size: 14.5px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}

body.ostov .nav .wp-block-navigation-link a {
  color: var(--ink);
  text-decoration: none;
}

body.ostov .nav .wp-block-navigation-link:hover,
body.ostov .nav .wp-block-navigation-link.current-menu-item {
  border-bottom-color: var(--ink);
}

body.ostov .masthead__end .woocommerce-cart-count {
  font-variant-numeric: tabular-nums;
}

body.ostov .nav-area {
  position: relative;
  min-width: 0;
}

body.ostov .nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

body.ostov .nav-toggle__icon,
body.ostov .nav-toggle__icon::before,
body.ostov .nav-toggle__icon::after {
  display: block;
  width: 16px;
  height: 1px;
  background: currentColor;
}

body.ostov .nav-toggle__icon {
  position: relative;
}

body.ostov .nav-toggle__icon::before,
body.ostov .nav-toggle__icon::after {
  position: absolute;
  left: 0;
  content: "";
}

body.ostov .nav-toggle__icon::before { top: -5px; }
body.ostov .nav-toggle__icon::after { top: 5px; }
body.ostov .nav-backdrop,
body.ostov .nav-close { display: none; }

@media (max-width: 1080px) {
  body.ostov .masthead__row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
  }

  body.ostov .nav-area { justify-self: end; }
  body.ostov .nav-toggle { display: none; }
  html.has-js body.ostov .nav-toggle { display: inline-flex; }

  body.ostov .nav-area .nav {
    width: min(54vw, 440px);
    max-width: calc(100vw - 32px);
    overflow-x: auto;
  }

  html.has-js body.ostov .nav-backdrop {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(25, 23, 18, .34);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    cursor: default;
  }

  html.has-js body.ostov .nav-area .nav {
    position: fixed;
    z-index: 50;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, calc(100vw - 48px));
    max-width: none;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 26px 24px;
    border-left: 1px solid var(--ink);
    background: var(--sheet);
    transform: translateX(102%);
    visibility: hidden;
    transition: transform .22s ease, visibility .22s ease;
  }

  html.has-js body.ostov .nav-area.is-open .nav {
    transform: translateX(0);
    visibility: visible;
  }

  html.has-js body.ostov .nav-area.is-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }

  html.has-js body.ostov .nav-area.is-open .nav .wp-block-navigation__container {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  html.has-js body.ostov .nav-area .nav-close {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    margin-bottom: 16px;
    padding: 8px 0 14px;
    border: 0;
    border-bottom: 1px solid var(--ink);
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
  }

  html.has-js body.ostov .nav-close__icon,
  html.has-js body.ostov .nav-close__icon::after {
    display: block;
    width: 16px;
    height: 1px;
    background: currentColor;
    transform: rotate(45deg);
  }

  html.has-js body.ostov .nav-close__icon::after {
    content: "";
    transform: rotate(90deg);
  }

  html.has-js body.ostov .nav-area .wp-block-navigation-link {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule-2);
  }

  body.ostov.has-sticky-purchase .nav-area .nav { bottom: 88px; }
  body.ostov.menu-open { overflow: hidden; }
}

@media (max-width: 560px) {
  html.has-js body.ostov .nav-toggle { min-height: 42px; padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  body.ostov .nav-area .nav,
  body.ostov .nav-backdrop { transition: none; }
}

/* ---- сетка каталога ------------------------------------------------------ */

body.ostov .shell__main {
  min-width: 0;
}

body.ostov .plates {
  padding-top: 44px;
}

/* ---- карточка изделия ---------------------------------------------------- */

.pdp {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
  margin-top: 26px;
}

.pdp__head { grid-column: 1 / -1; }
.pdp__title { font-size: clamp(34px, 4.6vw, 68px); font-weight: 600; letter-spacing: -.028em; line-height: 1.08; }
.pdp__blurb { margin-top: 14px; max-width: 56ch; font-size: 16.5px; color: var(--ink-2); }
.pdp__media { grid-column: 1 / span 7; }
.pdp__aside { grid-column: 8 / span 5; }
.pdp__aside-text { grid-column: 7 / span 6; }
.pdp__plate { grid-column: 1 / span 6; }
.pdp--material { margin-top: 74px; align-items: center; }
.pdp__aside-title { font-size: clamp(22px, 2.2vw, 32px); font-weight: 500; letter-spacing: -.022em; }
.pdp__aside-text p { margin-top: 16px; }
.pdp__plate img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

.pdp-section { margin-top: 74px; }
.pdp-section .drawing { margin-top: 22px; }

.crumbs { padding-top: 22px; font-size: 13px; }
.crumbs p { max-width: none; }

.sec-head { margin-bottom: 22px; }
.sec-head__title { font-size: clamp(24px, 2.7vw, 42px); font-weight: 500; letter-spacing: -.022em; }
.sec-head__note { margin-top: 8px; font-size: 14px; }

.related-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 12px;
}

.related-head__title { font-size: 19px; font-weight: 600; }
.related-head + .ostov-catalogue .plates { padding-top: 44px; }

@media (max-width: 1080px) {
  .pdp__media,
  .pdp__aside,
  .pdp__aside-text,
  .pdp__plate { grid-column: 1 / -1; }
  .pdp__aside { margin-top: 22px; }
  .pdp--material { margin-top: 56px; }
}

/* ---- полоса с интерьером -------------------------------------------------- */

.band__img { margin: 0; }
.band__img img { width: 100%; aspect-ratio: 16/7; object-fit: cover; }
.band__note p { max-width: none; }
@media (max-width: 760px) { .band__img img { aspect-ratio: 4/3; } }

/* ---- галерея изделия ----------------------------------------------------- */

.ostov-gallery { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; }
.ostov-gallery__thumbs { display: flex; flex-direction: column; gap: 10px; }
.ostov-gallery__thumb {
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  background: var(--sheet-2);
  cursor: pointer;
  aspect-ratio: 1/1;
}
.ostov-gallery__thumb[aria-current="true"] { border-color: var(--ink); }
.ostov-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ostov-gallery__stage {
  position: relative;
  overflow: hidden;
  background: var(--sheet-2);
  aspect-ratio: 4/5;
  margin: 0;
}
.ostov-gallery__stage img { width: 100%; height: 100%; object-fit: cover; }
.ostov-gallery__caption { position: absolute; right: 0; bottom: 0; margin: 0; padding: 7px 11px; font-size: 12px; color: var(--ink-2); background: var(--sheet); }

@media (max-width: 760px) {
  .ostov-gallery { grid-template-columns: minmax(0, 1fr); }
  .ostov-gallery__thumbs { order: 2; flex-direction: row; overflow-x: auto; }
  .ostov-gallery__thumb { width: 68px; flex: 0 0 auto; }
}

/* ---- панель покупки ------------------------------------------------------ */

.ostov-buy-panel__lead-note { margin-top: 16px; }
.ostov-buy-panel__qty-input {
  font-family: inherit;
  width: 72px;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}
.ostov-buy-panel__option { margin: 0 0 10px; }
.ostov-buy-panel__option-title { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.ostov-buy-panel__qty { margin-top: 18px; }
.ostov-buy-panel__qty-label { font-size: 13px; color: var(--ink-2); }
.ostov-buy-panel__passport { margin-top: 26px; }
.ostov-buy-panel__passport-head { margin-bottom: 10px; }
.ostov-buy-panel__cart { margin-top: 20px; }
.ostov-buy-panel__add { width: 100%; }

/* ---- торговые экраны ----------------------------------------------------- */

.ostov-notice {
  border-top: 1px solid var(--draft);
  background: var(--draft-soft);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 18px;
}
.ostov-notice p { max-width: none; }
.ostov-notice b { color: var(--ink); }

.model-note { margin-bottom: 16px; }

body.ostov .wc-block-components-form .input-text,
body.ostov input[type="text"],
body.ostov input[type="email"],
body.ostov input[type="tel"],
body.ostov input[type="number"],
body.ostov select,
body.ostov textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 9px 12px;
}

body.ostov .wc-block-components-button,
body.ostov .wp-block-button__link {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.005em;
  padding: 15px 26px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--sheet);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}

body.ostov .wc-block-components-button:hover,
body.ostov .wp-block-button__link:hover {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff;
}

body.ostov .wc-block-components-button.is-primary,
body.ostov .wc-block-components-text-button.is-primary {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff;
}

body.ostov .wc-block-components-button.is-primary:hover {
  background: #7E3A19;
  border-color: #7E3A19;
}

body.ostov .wc-block-cart, body.ostov .wc-block-checkout { border-top: 1px solid var(--ink); padding-top: 22px; }
body.ostov .wc-block-components-sidebar-layout { gap: 48px; }
body.ostov .wc-block-components-sidebar-layout__sidebar { width: 360px; }
body.ostov .wc-block-components-totals-item__value { font-variant-numeric: tabular-nums; }

/* ---- поиск и ошибка ------------------------------------------------------ */

.search-form { display: flex; gap: 12px; align-items: center; }
.search-form label { flex: 1; }
.search-form .wp-block-search__input { border: 1px solid var(--rule); border-radius: var(--radius); padding: 11px 14px; width: 100%; font-family: inherit; background: var(--paper); }
.search-form .wp-block-search__button { font-family: inherit; font-size: 15px; font-weight: 600; padding: 12px 22px; border-radius: var(--radius); background: var(--ink); color: var(--sheet); border: 1px solid var(--ink); cursor: pointer; }
.search-form .wp-block-search__button:hover { background: var(--clay); border-color: var(--clay); }

.error-404 { padding: 74px 0; }
.error-404 h1 { font-size: clamp(34px, 4.6vw, 68px); }
.error-404 p { margin-top: 14px; }
.error-404 .link { display: inline-block; margin-top: 24px; }

/* ---- указатель помещений ------------------------------------------------- */

.rooms h3 { font-size: 17px; font-weight: 600; }
.rooms .dim { display: block; margin-top: 4px; }

/* Три помещения не оставляют дырку в сетке из четырёх колонок: колонки
   подстраиваются под число разделов. */
.rooms { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
@media (max-width: 760px) { .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .rooms { grid-template-columns: minmax(0, 1fr); } }

/* ---- избранное ----------------------------------------------------------- */

.ostov-wishlist__list { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 28px; margin-top: 22px; }
.ostov-wishlist__list > li { grid-column: span 4; }
@media (max-width: 620px) { .ostov-wishlist__list > li { grid-column: span 12; } }
