/* Shared legacy price cards: phones and portrait tablets only. */
@media (max-width: 991px), (min-width: 992px) and (max-width: 1199px) and (orientation: portrait) {
  html body .windows:is(.page-reshotki, .page-zamena) { min-height: 0; padding-bottom: 32px; }
  html body .windows:is(.page-reshotki, .page-zamena) .head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin: 24px 15px;
    padding: 22px;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head > .col-md-6 {
    width: 100%;
    min-width: 0;
    padding: 0;
    float: none;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c > img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    margin: 0 auto;
    align-self: center;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c .r-t {
    width: auto;
    min-width: 0;
    padding: 0;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c .r-t h3 {
    font-size: 24px;
    line-height: 1.2;
    margin: 0 0 16px;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c .r-t .line {
    width: 100%;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .r-c { padding: 0; }
  html body .windows:is(.page-reshotki, .page-zamena) .head .r-c h3 {
    padding: 0;
    margin: 0 0 12px;
    background: transparent;
    color: #29473d;
    text-align: left;
    font-size: 20px;
    line-height: 1.3;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .r-c h3 + p {
    display: block;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 14px;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .r-c .chars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .r-c .chars > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    margin: 0;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .r-c .chars p { margin: 0 0 6px; font-size: 12px; }
  html body .windows:is(.page-reshotki, .page-zamena) .head .r-c .chars .stars {
    display: flex;
    width: auto;
    height: auto;
    gap: 2px;
    margin: 0;
    position: static;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .r-c .chars .stars::before,
  html body .windows:is(.page-reshotki, .page-zamena) .head .r-c .chars .stars::after { content: none; display: none; }
  html body .windows:is(.page-reshotki, .page-zamena) .head .r-c .chars .stars img {
    width: 14px;
    height: 14px;
    margin: 0;
    flex: 0 0 14px;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .head .skidka-mark { width: 66px; }
  html body .windows:is(.page-reshotki, .page-zamena) .products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0 15px;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products::before,
  html body .windows:is(.page-reshotki, .page-zamena) .products::after { display: none; }
  html body .windows:is(.page-reshotki, .page-zamena) .products > div {
    display: flex;
    width: auto;
    min-width: 0;
    padding: 0;
    float: none;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    padding: 0;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .head-img {
    flex: 0 0 auto;
    height: 210px;
    background: #f0efeb;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .head-img > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 18px 14px;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body h3 {
    min-height: 0;
    font-size: 18px;
    line-height: 1.3;
    margin: 0 0 16px;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body .p-b {
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-bottom: 16px;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body .price {
    font-size: 25px;
    line-height: 1.2;
    white-space: nowrap;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body .price-prev {
    font-size: 13px;
    margin-left: 0;
    white-space: nowrap;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body .line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 8px;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body .line p,
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body .line .unit span { font-size: 13px; line-height: 1.6; }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body ul {
    display: block;
    min-height: 0;
    margin: 12px 0;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body ul li { font-size: 13px; line-height: 1.4; padding-left: 23px; }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body h4 {
    display: block;
    font-size: 16px;
    line-height: 1.3;
    margin: 14px 0 0;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body .call-block {
    margin-top: auto;
    flex-shrink: 0;
    min-height: 48px;
    height: auto;
  }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body ul:last-of-type { margin-bottom: 22px; }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .item-shadow { display: none; }
  /* Keep the already redesigned Actions variant, only normalize its mobile photos. */
  html body #actions-window-tiers.vo-actions-window-tiers .products .head-img > img { object-fit: contain; }
}
@media (min-width: 700px) and (max-width: 991px) {
  html body #actions-window-tiers.vo-actions-window-tiers .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 560px) and (max-width: 699px) {
  html body .windows:is(.page-reshotki, .page-zamena) .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body #actions-window-tiers.vo-actions-window-tiers .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body #actions-window-tiers.vo-actions-window-tiers .products .body { padding: 18px 14px; }
  html body #actions-window-tiers.vo-actions-window-tiers .products .body h3 { font-size: 18px; }
  html body #actions-window-tiers.vo-actions-window-tiers .products .price { font-size: 25px; }
  html body .windows:is(.page-reshotki, .page-zamena) .products > div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - 8px);
    justify-self: center;
  }
}
@media (max-width: 559px) {
  html body .windows:is(.page-reshotki, .page-zamena) .head { padding: 18px; gap: 18px; }
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c { grid-template-columns: 78px minmax(0, 1fr); gap: 14px; }
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c > img { max-height: 145px; }
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c .r-t h3 { font-size: 20px; }
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c .r-t .line p,
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c .r-t .line .unit span,
  html body .windows:is(.page-reshotki, .page-zamena) .head .l-c .r-t .line > span { font-size: 13px; line-height: 1.5; }
  html body .windows:is(.page-reshotki, .page-zamena) .head .skidka-mark { width: 48px; }
  html body .windows:is(.page-reshotki, .page-zamena) .products { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .head-img { height: 220px; }
  html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body { padding: 18px; }
}
@media (max-width: 767px) {
  html body #actions-window-tiers.vo-actions-window-tiers .products .head-img,
  html body #actions-window-tiers.vo-actions-window-tiers .products .head-img > img { height: 220px; }
}
@media (min-width: 992px) and (max-width: 1199px) and (orientation: portrait) {
  html body .windows:is(.page-reshotki, .page-zamena) .label-price { position: static; height: auto; }
  html body .windows:is(.page-reshotki, .page-zamena) .label-price > img { display: none; }
  html body .windows:is(.page-reshotki, .page-zamena) .label-price h2 { position: static; margin: 26px 15px; color: #29473d; }
  html body .windows:is(.page-reshotki, .page-zamena) .label-price h2 span { color: #29473d; }
}

/* Owner-approved defect fixes. No content, metadata or imagery changes. */
/* Keep every existing service shortcut, on one row where tablets have room. */
@media (min-width: 600px) and (max-width: 991px), (min-width: 992px) and (max-width: 1199px) and (orientation: portrait) {
  html body .new_shaibs_back .row { display: flex; flex-wrap: nowrap; gap: 10px; margin-left: 0; margin-right: 0; }
  html body .new_shaibs_back .row::before,
  html body .new_shaibs_back .row::after,
  html body .new_shaibs_back .row .kvadrat { display: none; }
  html body .new_shaibs_back .row .item-sh { display: block; float: none; flex: 1 1 0; width: 0; min-width: 0; margin: 0; padding: 0; }
  html body .new_shaibs_back .item-sh > a { width: 168px; max-width: 100%; min-height: 0; }
  html body .new_shaibs_back .item-sh > a > div:first-child { height: clamp(70px, 11vw, 112px) !important; }
  html body .new_shaibs_back .item-sh > a > div:last-child { min-height: 52px; font-size: 12px; overflow-wrap: break-word; }
}
/* All five stages fit their container on tablets, without clipping the ends.
   Phones retain the existing two-at-a-time Bootstrap carousel. */
@media (min-width: 768px) and (max-width: 1199px) {
  html body .work-order #carousel_order { width: 100%; min-width: 0; }
  html body .work-order .items { width: 100%; margin-left: 0; margin-right: 0; }
  html body .work-order #carousel_order > .carousel-inner { display: flex; width: 100%; overflow: visible; align-items: flex-start; }
  html body .work-order #carousel_order > .carousel-inner > .item { display: flex; flex: 2 1 0; width: 0; min-width: 0; padding: 0; position: static; transform: none; }
  html body .work-order #carousel_order > .carousel-inner > .item:last-child { flex: 1 1 0; }
  html body .work-order #carousel_order .item > .i { width: 50%; min-width: 0; margin: 0; padding: 0 9px; }
  html body .work-order #carousel_order .item:last-child > .i { width: 100%; }
  html body .work-order #carousel_order .i img { width: min(100%, 120px); height: auto; margin: 0 auto 16px; display: block; }
  html body .work-order #carousel_order .i p { font-size: 14px; line-height: 1.35; overflow-wrap: break-word; }
  html body .work-order #carousel_order > .carousel-control { display: none; }
}
/* Keep FAQ toggles within the question rather than outside the viewport. */
@media (max-width: 1199px) {
  html body .questions .question { padding-right: 52px; }
  html body .questions .question > div { min-width: 0; }
  html body .questions .question > div > span { flex-shrink: 0; }
  html body .questions .question svg.plus,
  html body .questions .question svg.minus { right: 4px; width: 44px; height: 44px; }
  html body a.regulirovka.modalbox.button { box-sizing: border-box; max-width: 100%; white-space: normal; height: auto; min-height: 48px; }
  html body a.regulirovka.modalbox.button > span { box-sizing: border-box; max-width: 100%; }
}
/* A genuinely visible, tappable close control, also when the dialog is open. */
html body #myModal_new button.close { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; top: 8px; right: 8px; padding: 0; margin: 0; font-size: 36px; line-height: 1; color: #29473d; opacity: 1; background: #fff; border: 1px solid #e8dcd4; border-radius: 50%; z-index: 10; text-shadow: none; }
html body #myModal_new button.close:focus-visible { outline: 3px solid #e98b61; outline-offset: 2px; }
html body #myModal_new .modal-header { padding-right: 64px; }
/* Equal card / order-button alignment in the two legacy service variants. */
html body .windows:is(.page-reshotki, .page-zamena) .products { align-items: stretch; }
html body .windows:is(.page-reshotki, .page-zamena) .products > div { display: flex; }
html body .windows:is(.page-reshotki, .page-zamena) .products .item-p { display: flex; flex-direction: column; width: 100%; }
html body .windows:is(.page-reshotki, .page-zamena) .products .item-p .body { display: flex; flex-direction: column; flex: 1; }
html body .windows:is(.page-reshotki, .page-zamena) .products .call-block { margin-top: auto; height: auto; min-height: 48px; }

@media (min-width: 600px) and (max-width: 1199px) {
  html body .mvw-cost #carousel-mvw > .carousel-indicators { left: 0; right: auto; margin-left: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
}
@media (max-width: 1199px) {
  html body #mvw-cost > .bg { padding-bottom: 30px; }
  html body .mvw-cost #carousel-mvw { display: flex; flex-direction: column; }
  html body .mvw-cost #carousel-mvw > .carousel-inner { order: 1; flex: 0 0 auto; width: 100%; }
  html body .mvw-cost #carousel-mvw > .carousel-indicators { order: 2; position: static; display: flex; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; width: 100%; max-width: 100%; margin: 16px 0 0; }
  html body .mvw-cost #carousel-mvw > .carousel-indicators > div { flex: 0 0 220px; }
  html body .mvw-cost #carousel-mvw > .prev-control { order: 3; display: flex; justify-content: space-between; position: static; width: 100%; margin: 12px 0 0; }
  html body .mvw-cost #carousel-mvw > .prev-control > span { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; }
}
@media (min-width: 992px) {
  html body .windows:is(.page-reshotki, .page-zamena) .products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html body .windows:is(.page-reshotki, .page-zamena) .products::before,
  html body .windows:is(.page-reshotki, .page-zamena) .products::after { display: none; }
  html body .windows:is(.page-reshotki, .page-zamena) .products > div { width: auto; min-width: 0; }
  html body .windows:is(.page-reshotki, .page-zamena) .products .p-b { flex-wrap: wrap; gap: 6px 10px; }
  html body .windows:is(.page-reshotki, .page-zamena) .products .price,
  html body .windows:is(.page-reshotki, .page-zamena) .products .price-prev { white-space: nowrap; }
  html body .windows:is(.page-reshotki, .page-zamena) .products .price-prev { margin-left: 0; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  html body .vidi-stp .item .top .imgs > .itm > .popup { width: 240px; max-width: calc(100vw - 40px); white-space: normal; box-sizing: border-box; }
  html body .vidi-stp .item .top .imgs > .itm:nth-child(1) > .popup { left: 0; }
  html body .vidi-stp .item .top .imgs > .itm:nth-child(2) > .popup { left: -60px; }
  html body .vidi-stp .item .top .imgs > .itm:nth-child(3) > .popup { left: -120px; }
  html body .vidi-stp .item .top .imgs > .itm:nth-child(4) > .popup { left: -180px; }
}
@media (max-width: 1199px) {
  html body .dstnstv.regulirovka-pvh .item .t-scr { min-width: 0; max-width: 100%; }
  html body .dstnstv.regulirovka-pvh .item .t-scr p { overflow-wrap: anywhere; }
}
/* Legacy rating strips also need to fit the landscape tablet header. */
@media (min-width: 992px) and (max-width: 1199px) and (orientation: landscape) {
  html body .windows .head .r-c .chars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  html body .windows .head .r-c .chars > div { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; margin: 0; }
  html body .windows .head .r-c .chars p { margin: 0 0 6px; font-size: 12px; }
  html body .windows .head .r-c .chars .stars { display: flex; width: auto; height: auto; gap: 2px; margin: 0; position: static; }
  html body .windows .head .r-c .chars .stars::before,
  html body .windows .head .r-c .chars .stars::after { content: none; display: none; }
  html body .windows .head .r-c .chars .stars img { width: 14px; height: 14px; margin: 0; flex: 0 0 14px; }
}
/* Preserve all photos: 10 thumbnails = 5 × 2, 8 thumbnails = 4 × 2.
   The repair page already has its own five-column gallery, leave it intact. */
html body .main-views-otd:not(#repair-materials-gallery) .carousel > .carousel-indicators:has(> li:nth-child(8):last-child) { --vo-thumb-columns: 4; }
html body .main-views-otd:not(#repair-materials-gallery) .carousel > .carousel-indicators:has(> li:nth-child(10):last-child) { --vo-thumb-columns: 5; }
html body .main-views-otd:not(#repair-materials-gallery) .carousel > .carousel-indicators:is(:has(> li:nth-child(8):last-child), :has(> li:nth-child(10):last-child)) {
  display: grid; grid-template-columns: repeat(var(--vo-thumb-columns), minmax(0, 1fr)); gap: 6px; position: static; width: 100%; max-width: 100%; height: auto; left: auto; bottom: auto; margin: 12px 0 0; padding: 0; transform: none;
}
html body .main-views-otd:not(#repair-materials-gallery) .carousel > .carousel-indicators:is(:has(> li:nth-child(8):last-child), :has(> li:nth-child(10):last-child)) > li {
  display: block; width: 100%; height: auto; min-width: 0; aspect-ratio: 3 / 4; max-height: 90px; margin: 0; padding: 0; overflow: hidden;
}
html body .main-views-otd:not(#repair-materials-gallery) .carousel > .carousel-indicators:is(:has(> li:nth-child(8):last-child), :has(> li:nth-child(10):last-child)) > li > img,
html body .main-views-otd:not(#repair-materials-gallery) .carousel > .carousel-indicators:is(:has(> li:nth-child(8):last-child), :has(> li:nth-child(10):last-child)) .vo-carousel-thumb-frame,
html body .main-views-otd:not(#repair-materials-gallery) .carousel > .carousel-indicators:is(:has(> li:nth-child(8):last-child), :has(> li:nth-child(10):last-child)) .vo-carousel-thumb-frame > img { display: block; width: 100%; height: 100%; object-fit: cover; }

