.mf-shop{
  width: 100%;
}

.mf-shop-layout{
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Search */
.mf-shop-search{
  margin: 0 0 18px;
}
.mf-shop-search__label{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.mf-shop-search__form{
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.mf-shop-search__input{
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 12px;
  font-size: 16px;
  line-height: 44px;
  outline: none;
}
.mf-shop-search__input:focus{
  border-color: rgba(0,0,0,.35);
  box-shadow: 0 0 0 3px rgba(235,189,47,.25);
}
.mf-shop-search__btn{
  flex: 0 0 auto;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: #ebbd2f;
  color: #000;
  font-weight: 900;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.mf-shop-search__btn:hover{ opacity: .92; }
.mf-shop-search__btn:active{ opacity: .85; }

/* Sort + view toolbar (under search) */
.mf-shop-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}
.mf-shop-sort{
  flex: 1 1 auto;
  min-width: 0;
}
.mf-shop-sort__select{
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  outline: none;
}
.mf-shop-sort__select:focus{
  border-color: rgba(0,0,0,.35);
  box-shadow: 0 0 0 3px rgba(235,189,47,.25);
}
.mf-shop-view{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mf-shop-view__btn{
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,.55);
  border-radius: 12px;
  text-decoration: none;
}
.mf-shop-view__btn:hover{
  background: rgba(0,0,0,.04);
  text-decoration: none;
}
.mf-shop-view__btn.is-active{
  color: #000;
  background: rgba(0,0,0,.06);
}

/* Pagination (Bitrix legacy output inside catalog.section) */
.mf-shop-main > div[data-pagination-num]{
  --mf-yellow: #ebbd2f;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mf-shop-main > div[data-pagination-num] > font.text{
  font-family: inherit;
  color: rgba(0,0,0,.55);
  font-size: 13px;
  line-height: 1.35;
}

/* 1st line has a <br> we don't need visually */
.mf-shop-main > div[data-pagination-num] > font.text br{
  display: none;
}

/* 2nd line is the actual navigation */
.mf-shop-main > div[data-pagination-num] > font.text + font.text{
  color: rgba(0,0,0,.28); /* separators like | */
  text-align: center;
  white-space: normal;
}

.mf-shop-main > div[data-pagination-num] > font.text + font.text a,
.mf-shop-main > div[data-pagination-num] > font.text + font.text b{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  margin: 0 4px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  font-weight: 900;
  letter-spacing: .2px;
  color: rgba(0,0,0,.70);
  text-decoration: none;
}

.mf-shop-main > div[data-pagination-num] > font.text + font.text a:hover{
  border-color: rgba(0,0,0,.18);
  color: rgba(0,0,0,.9);
  text-decoration: none;
}

.mf-shop-main > div[data-pagination-num] > font.text + font.text a:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(235,189,47,.25);
}

/* Active page is <b>1</b> */
.mf-shop-main > div[data-pagination-num] > font.text + font.text b{
  border-color: rgba(0,0,0,.12);
  background: var(--mf-yellow);
  color: #000;
}

@media (max-width: 991.98px){
  .mf-shop-layout{
    grid-template-columns: 1fr;
  }
  .mf-shop-sidebar{
    order: 2;
  }
}

/* Cards */
.mf-shop-cards{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
@media (max-width: 1199.98px){
  .mf-shop-cards{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575.98px){
  .mf-shop-cards{
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .mf-shop-search__form{
    gap: 10px;
    padding: 0;
  }
  .mf-shop-search__btn{
    padding: 0 14px;
  }
  .mf-shop-toolbar{
    gap: 10px;
  }
  .mf-shop-view{
    gap: 6px;
  }
  .mf-shop-modal__dialog{
    width: calc(100vw - 20px);
    margin-top: 16px;
    padding: 18px 16px 16px;
    max-height: calc(100vh - 24px);
  }
}

/* We fully control product cards markup now (mf-pcard / mf-pline).
   Keep legacy Bitrix selectors out to avoid fights with theme=blue. */

/* Category cards (mf_shop_cards) */
.mf-ccard{
  display: grid;
  grid-template-rows: 170px auto;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  text-decoration: none;
  color: #000;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mf-ccard:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0,0,0,.08);
  border-color: rgba(0,0,0,.14);
  text-decoration: none;
}
.mf-ccard__media{
  position: relative;
  background: #fff;
  min-height: 0;
}
.mf-ccard__media::before{
  content:"";
  position:absolute;
  inset:0;
  background: url("/bitrix/templates/eshop_bootstrap_v4/images/mf-no-photo.svg?v=2") center / 78px 78px no-repeat;
  opacity:.9;
  pointer-events:none;
}
.mf-ccard__media--has-img::before{
  display: none;
}
.mf-ccard__img{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.mf-ccard__body{
  padding: 14px 14px 16px;
  display: grid;
  gap: 8px;
}
.mf-ccard__title{
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}
.mf-ccard__hint{
  font-size: 12px;
  color: rgba(0,0,0,.55);
}

/* Product card (grid/tiles): new markup */
.mf-pcard{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mf-view-grid .catalog-section .product-item-container:hover .mf-pcard,
.mf-view-tiles .catalog-section .product-item-container:hover .mf-pcard{
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0,0,0,.08);
  border-color: rgba(0,0,0,.14);
}

/* Vertical spacing between product cards (grid/tiles) */
.mf-view-grid .catalog-section .product-item-container,
.mf-view-tiles .catalog-section .product-item-container{
  margin-bottom: 24px;
}
@media (max-width: 575.98px){
  .mf-view-grid .catalog-section .product-item-container,
  .mf-view-tiles .catalog-section .product-item-container{
    margin-bottom: 16px;
  }
}
.mf-pcard__media{
  display: block;
  position: relative;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, #f2f4f7, #e6eaef);
  overflow: hidden;
}
.mf-pcard__media-inner{
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fff url("/bitrix/templates/eshop_bootstrap_v4/images/mf-no-photo.svg?v=2") center / 78px 78px no-repeat;
}
.mf-pcard__media-inner--placeholder,
.mf-pcard__media-inner:has(.mf-img--placeholder){
  background: #fff url("/bitrix/templates/eshop_bootstrap_v4/images/mf-no-photo.svg?v=2") center / 78px 78px no-repeat;
}
.mf-pcard__media-img.mf-img--placeholder{
  opacity: 1;
}
.mf-pcard__media-inner::before{
  content:"";
  display:block;
  padding-top: 100%;
}
.mf-pcard__media-img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  position: absolute;
  inset: 0;
}
.mf-pcard__top{
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.mf-pcard__chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .3px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.10);
  color: #000;
  text-transform: uppercase;
}
.mf-pcard__chip--sale{
  background: rgba(235,189,47,.95);
  border-color: rgba(0,0,0,.10);
}
/* Статус наличия: читаемо на фото, без лишней кричащести */
.mf-pcard__chip--ok,
.mf-pcard__chip--order,
.mf-pcard__chip--no{
  min-height: 22px;
  padding: 2px 9px;
  font-size: 10px;
  letter-spacing: .28px;
  border-width: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,.14);
}
.mf-pcard__chip--ok{
  background: rgba(21, 115, 71, .92);
  border-color: rgba(0,0,0,.12);
  color: #fff;
}
.mf-pcard__chip--order{
  background: #e67e22;
  border-color: rgba(0,0,0,.12);
  color: #fff;
}
.mf-pcard__chip--no{
  background: rgba(180, 35, 24, .92);
  border-color: rgba(0,0,0,.12);
  color: #fff;
}
.mf-pcard__body{
  padding: 12px 12px 14px;
  display: grid;
  gap: 10px;
}
.mf-pcard__title{
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  min-height: 2.5em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mf-pcard__title a{ color: #000; text-decoration: none; }
.mf-pcard__title a:hover{ text-decoration: none; }
.mf-pcard__sub{
  margin-top: -2px;
  font-size: 12px;
  line-height: 1.25;
  color: rgba(0,0,0,.60);
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mf-pcard__sub-brand{
  font-weight: 900;
  color: rgba(0,0,0,.72);
}
.mf-pcard__sub-sep{
  color: rgba(0,0,0,.25);
}
.mf-pcard__sub-article{
  color: rgba(0,0,0,.60);
}
.mf-pcard__price{
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.mf-pcard__old{
  font-size: 12px;
  color: rgba(0,0,0,.45);
  text-decoration: line-through;
}
.mf-pcard__cur{
  font-size: 16px;
  font-weight: 900;
  color: #000;
  white-space: nowrap;
}
.mf-pcard__qty .product-item-amount-field-container{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 6px 10px;
  background: #fff;
}
.mf-pcard__qty .product-item-amount-field{
  width: 64px;
  height: 34px;
  border: 0;
  outline: none;
  font-weight: 800;
}
.mf-pcard__qty .product-item-amount-field-btn-minus,
.mf-pcard__qty .product-item-amount-field-btn-plus{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0,0,0,.04);
}
.mf-pcard__qty .product-item-amount-field-btn-minus:hover,
.mf-pcard__qty .product-item-amount-field-btn-plus:hover{
  background: rgba(0,0,0,.07);
}
.mf-pcard__qty .product-item-amount-description-container{
  display: none;
}
.mf-pcard__actions .btn{
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ebbd2f !important;
  border: 0 !important;
  color: #000 !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: .8px !important;
}
.mf-pcard__actions .btn:hover{ opacity: .92; }
.mf-pcard__actions .btn:active{ opacity: .85; }
.mf-pcard__actions .js-mf-add-store[data-in-basket="1"]{
  background: #e2e5ea !important;
  color: rgba(0,0,0,.72) !important;
}
.mf-pcard__actions .btn.btn-link{
  background: transparent !important;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 800;
  color: rgba(0,0,0,.65);
}

/* Product line (list): new markup */
.mf-pline{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  background: #fff;
  padding: 12px 12px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
@media (max-width: 991.98px){
  .mf-pline{
    grid-template-columns: 110px minmax(0, 1fr);
    grid-template-areas:
      "img title"
      "img side";
  }
  .mf-pline__media{ grid-area: img; }
  .mf-pline__main{ grid-area: title; }
  .mf-pline__side{ grid-area: side; }
}
.mf-pline__media-link{
  display: block;
  width: 100%;
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background:
    url("/bitrix/templates/eshop_bootstrap_v4/images/mf-no-photo.svg?v=2") center / 64px 64px no-repeat,
    linear-gradient(135deg, #f2f4f7, #e6eaef);
  border: 1px solid rgba(0,0,0,.06);
}
.mf-pline__media-link::before{
  content:"";
  display:block;
  padding-top: 100%;
}
.mf-pline__media-img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  position: absolute;
  inset: 0;
}
.mf-pline__title{
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}
.mf-pline__title a{ color: #000; text-decoration: none; }
.mf-pline__sub{
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.25;
  color: rgba(0,0,0,.60);
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mf-pline__sub-brand{
  font-weight: 900;
  color: rgba(0,0,0,.72);
}
.mf-pline__sub-sep{
  color: rgba(0,0,0,.25);
}

/* TEMP: hide brand+article line in catalog cards and list view */
.mf-pcard__sub,
.mf-pline__sub{
  display: none !important;
}
.mf-pline__side{
  display: grid;
  gap: 10px;
  justify-items: end;
}
@media (max-width: 991.98px){
  .mf-pline__side{ justify-items: start; }
}
.mf-pline__cur{
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}
.mf-pline__actions .btn{
  border-radius: 12px;
  background: #ebbd2f !important;
  border: 0 !important;
  color: #000 !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: .8px !important;
}
.mf-pline__actions .js-mf-add-store[data-in-basket="1"]{
  background: #e2e5ea !important;
  color: rgba(0,0,0,.72) !important;
}

.mf-shop-modal{
  position: fixed;
  inset: 0;
  z-index: 10000;
}
.mf-shop-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.mf-shop-modal__dialog{
  position: relative;
  width: min(560px, calc(100vw - 32px));
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  max-height: calc(100vh - 48px);
  overflow: auto;
}
.mf-shop-modal__close{
  position: absolute;
  right: 12px;
  top: 10px;
  border: 0;
  background: transparent;
  color: rgba(0,0,0,.55);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.mf-shop-modal__title{
  font-size: 22px;
  font-weight: 900;
  color: #000;
}
.mf-shop-modal__subtitle{
  margin-top: 6px;
  color: rgba(0,0,0,.68);
  font-size: 14px;
  line-height: 1.45;
}
.mf-shop-modal__auth{
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fafafa;
}
.mf-shop-modal__auth-text{
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(0,0,0,.75);
}
.mf-shop-modal__auth-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.mf-shop-modal__auth-btn{
  font-weight: 800;
  border-radius: 10px;
}
.mf-shop-modal__auth-btn:hover,
.mf-shop-modal__auth-btn:focus{
  background-color: #ebbd2f !important;
  border-color: #ebbd2f !important;
  color: #000 !important;
}
.mf-shop-modal__auth-btn:focus{
  box-shadow: 0 0 0 3px rgba(235,189,47,.35);
}
.mf-shop-modal__message{
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.mf-shop-modal__message.is-success{
  background: rgba(40,167,69,.1);
  color: #1f6f35;
}
.mf-shop-modal__message.is-error{
  background: rgba(220,53,69,.08);
  color: #a12a36;
  white-space: pre-line;
}
.mf-shop-modal__form{
  margin-top: 16px;
}
.mf-shop-modal__form .form-group{
  margin-bottom: 14px;
}
.mf-shop-modal__form label{
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 900;
  color: rgba(0,0,0,.82);
}
.mf-shop-modal__actions{
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 12px;
}
.mf-shop-modal__submit{
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  min-height: 42px;
  font-weight: 900;
  background: #ebbd2f !important;
  color: #000 !important;
  border: 0 !important;
  border-radius: 12px !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.mf-shop-modal-open{
  overflow: hidden;
}

/* Detail page uses mf-shop but no sidebar grid */
.mf-shop--detail .mf-shop-layout{
  grid-template-columns: 1fr;
}

/* Brand + article on product detail (top meta line) */
.mf-product-meta{
  margin: 10px 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mf-product-meta__item{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(235,189,47,.14);
}
.mf-product-meta__label{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  text-transform: uppercase;
  color: rgba(0,0,0,.55);
}
.mf-product-meta__value{
  font-size: 13px;
  font-weight: 900;
  color: #000;
}

/* Product detail (catalog.element): redesign via CSS (keep Bitrix logic) */
.mf-shop .bx-catalog-element{
  --mf-card-radius: 16px;
  --mf-card-border: 1px solid rgba(0,0,0,.08);
}
.mf-shop .bx-catalog-element .container-fluid{
  padding-left: 0;
  padding-right: 0;
}
.mf-shop .bx-catalog-element > .container-fluid > .row{
  margin-left: 0;
  margin-right: 0;
}
.mf-shop .bx-catalog-element > .container-fluid > .row > [class*="col-"]{
  padding-left: 0;
  padding-right: 0;
}

/* Detail layout: make gallery + buy panel look like a product page */
@media (min-width: 992px){
  /* First row in catalog.element is the top area (gallery + right column) */
  .mf-shop--detail .bx-catalog-element > .container-fluid > .row:first-child{
    display: grid;
    grid-template-columns: minmax(0, 30%) minmax(0, 70%);
    gap: 18px;
    align-items: start;
  }
  /* Bootstrap 3 clearfix pseudo-elements break CSS grid auto-placement */
  .mf-shop--detail .bx-catalog-element > .container-fluid > .row:first-child::before,
  .mf-shop--detail .bx-catalog-element > .container-fluid > .row:first-child::after{
    content: none !important;
    display: none !important;
  }
  .mf-shop--detail .bx-catalog-element > .container-fluid > .row:first-child > [class*="col-"]{
    width: auto;
    max-width: none;
    flex: none;
  }

  /* Right column: stack info + pay blocks, full width */
  .mf-shop--detail .bx-catalog-element > .container-fluid > .row:first-child > [class*="col-"]:nth-child(2) > .row{
    display: block;
    margin: 0;
  }
  .mf-shop--detail .bx-catalog-element > .container-fluid > .row:first-child > [class*="col-"]:nth-child(2) > .row > [class*="col-"]{
    width: 100%;
    max-width: none;
    flex: none;
    padding: 0;
  }
}

/* Hide empty "info" card to avoid blank blocks */
.mf-shop--detail .product-item-detail-info-section:empty{
  display: none !important;
}

/* We render our own right-side summary/tabs on detail page */
.mf-shop--detail .product-item-detail-info-section,
.mf-shop--detail .product-item-detail-pay-block,
.mf-shop--detail [id$="_tabs"],
.mf-shop--detail [id$="_tab_containers"]{
  display: none !important;
}

/* Gallery */
.mf-shop .product-item-detail-slider-container{
  border: var(--mf-card-border);
  border-radius: var(--mf-card-radius);
  background: linear-gradient(135deg, #f2f4f7, #e6eaef);
  overflow: hidden;
}
.mf-shop .product-item-detail-slider-block{
  padding: 12px;
}
.mf-shop .product-item-detail-slider-images-container{
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.mf-shop .product-item-detail-slider-image{
  display: none;
  background: #fff;
}
.mf-shop .product-item-detail-slider-image.active{
  display: block;
}
.mf-shop .product-item-detail-slider-image img{
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 520px;
}
.mf-shop .product-item-detail-slider-controls-block{
  margin-top: 0;
  padding: 0 12px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.mf-shop .product-item-detail-slider-controls-image{
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  cursor: pointer;
}
.mf-shop .product-item-detail-slider-controls-image.active{
  border-color: rgba(0,0,0,.22);
  box-shadow: 0 0 0 3px rgba(235,189,47,.22);
}
.mf-shop .product-item-detail-slider-controls-image img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

/* Hide controls when there is a single image */
.mf-shop .product-item-detail-slider-container.mf-gallery--single .product-item-detail-slider-controls-block{
  display: none;
}

/* Fullscreen preview (Bitrix adds .popup class via JS; template doesn't ship default CSS) */
.mf-shop .product-item-detail-slider-close{
  display: none;
}
.mf-shop .product-item-detail-slider-container.popup{
  position: fixed;
  inset: 0;
  z-index: 999999;
  border: 0;
  border-radius: 0;
  background: rgba(0,0,0,.88);
  box-shadow: none;
  animation: mfImgPopupShow .2s ease-out;
}

@keyframes mfImgPopupShow{
  from { opacity: 0; }
  to { opacity: 1; }
}

.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-close{
  display: block;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  z-index: 5;
  border-radius: 12px;
  background:
    rgba(255,255,255,.92)
    url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M11.41%2010l6.3-6.29a1%201%200%201%200-1.42-1.42L10%208.59%203.71%202.29A1%201%200%200%200%202.29%203.7L8.59%2010l-6.3%206.29a1%201%200%201%200%201.42%201.42L10%2011.41l6.29%206.3a1%201%200%200%200%201.42-1.42z%22%2F%3E%3C%2Fsvg%3E")
    no-repeat center;
  cursor: pointer;
  opacity: .92;
}
.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-close:hover{ opacity: 1; }

.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-block{
  padding: 16px 16px 0;
  height: calc(100vh - 120px);
}
.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-images-container{
  height: 100%;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-image{
  background: transparent;
}
.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-image img{
  max-width: 100%;
  max-height: calc(100vh - 170px);
  width: auto;
  cursor: default;
}

.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-controls-block{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.92);
  border-top: 1px solid rgba(0,0,0,.10);
  backdrop-filter: blur(10px);
}

.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-left,
.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-right{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  z-index: 4;
  opacity: .85;
}
.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-left{ left: 0; }
.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-right{ right: 0; transform: translateY(-50%) rotate(180deg); }
.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-left:hover,
.mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-right:hover{
  opacity: 1;
}

@media (max-width: 767px){
  .mf-detail-tabs__content{
    padding: 14px;
  }
  .mf-detail-shell__min-price{
    font-size: 17px;
  }
  .mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-block{
    padding: 12px 12px 0;
    height: calc(100vh - 112px);
  }
  .mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-image img{
    max-height: calc(100vh - 152px);
  }
  .mf-shop .product-item-detail-slider-container.popup .product-item-detail-slider-close{
    top: 10px;
    right: 10px;
  }
}

/* Info panel */
.mf-shop .product-item-detail-info-section{
  border: var(--mf-card-border);
  border-radius: var(--mf-card-radius);
  background: #fff;
  padding: 14px;
}
@media (min-width: 992px){
  .mf-shop .product-item-detail-info-section{
    position: sticky;
    top: 16px;
  }
}

/* Hide original fixed buy bar (we move it into pay-block via JS) */
.mf-shop--detail .product-item-detail-short-card-fixed{
  display: none !important;
}

/* Simple section heading on detail page (replaces Bitrix tabs header) */
.mf-shop--detail .mf-detail-h2{
  margin: 22px 0 12px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

/* Restyle moved buy panel */
.mf-shop--detail .product-item-detail-pay-block{
  margin-top: 10px;
}
.mf-detail-shell{
  margin: 0 0 14px;
}
.mf-detail-shell__brief{
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(0,0,0,.82);
}
/* Под вкладками: краткое описание не отталкивает таб «Склад» вниз */
.mf-detail-shell__brief--below-tabs{
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,.08);
}
.mf-detail-shell__brief p{
  margin: 0 0 10px;
}
.mf-detail-shell__brief p:last-child{
  margin-bottom: 0;
}
.mf-detail-shell__brief ul,
.mf-detail-shell__brief ol{
  margin: 0 0 10px;
  padding-left: 1.25rem;
}
.mf-detail-shell__brief li{
  margin: 0.25em 0;
}
.mf-detail-shell__brief a{
  color: inherit;
  text-decoration: underline;
}
.mf-detail-shell__brief strong,
.mf-detail-shell__brief b{
  font-weight: 800;
  color: rgba(0,0,0,.92);
}
.mf-detail-shell__min-price{
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 900;
  color: rgba(0,0,0,.68);
}
.mf-detail-shell__min-price span{
  color: #000;
}
.mf-product-meta--detail{
  margin: 0 0 14px;
}
/* Обёртка аналогов на детальной: не раздувает вкладку за пределы колонки */
.mf-product-analogs{
  min-width: 0;
  max-width: 100%;
}
.mf-detail-tabs{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  max-width: 100%;
}
.mf-detail-tabs__nav{
  display: flex;
  align-items: center;
  overflow-x: auto;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.018);
}
.mf-detail-tabs__btn{
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 900;
  color: rgba(0,0,0,.58);
  white-space: nowrap;
  cursor: pointer;
}
.mf-detail-tabs__btn.is-active{
  color: #000;
  border-bottom-color: #ebbd2f;
  background: #fff;
}
.mf-detail-tabs__content{
  padding: 16px;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mf-detail-tabs__pane{
  display: block;
}
.mf-detail-tabs__pane[hidden]{
  display: none !important;
}
.mf-detail-tabs__pane--description{
  font-size: 14px;
  line-height: 1.6;
  color: rgba(0,0,0,.82);
}
.mf-detail-tabs__pane--description p:last-child{
  margin-bottom: 0;
}
.mf-detail-tabs__oem-value{
  font-size: 14px;
  line-height: 1.6;
  color: rgba(0,0,0,.82);
  word-break: break-word;
}
.mf-detail-tabs__empty{
  padding: 8px 0;
  color: rgba(0,0,0,.58);
}
.mf-detail-stock-wrap .table{
  margin-bottom: 0;
}
.mf-detail-stock-wrap--empty{
  padding: 4px 0 8px;
}
.mf-detail-stock-table th,
.mf-detail-stock-table td{
  vertical-align: middle !important;
}
.mf-detail-stock-table__delivery{
  color: rgba(0,0,0,.78);
  white-space: nowrap;
}
.mf-detail-stock-table__spb,
.mf-detail-stock-table__spb-col{
  text-align: center;
  vertical-align: middle !important;
  width: 1%;
  white-space: nowrap;
}
.mf-detail-stock-table__price{
  white-space: nowrap;
  width: 1%;
}
.mf-detail-stock-table__qty-stepper .mf-search-qty{
  margin-left: auto;
}
/* Доставка до СПБ: индикатор в кружке */
.mf-store-delivery-spb{
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  vertical-align: middle;
  box-sizing: border-box;
}
.mf-store-delivery-spb--ok{
  background: #198754;
}
.mf-store-delivery-spb--bad{
  background: #e67e22;
}
@media (max-width: 575.98px){
  .mf-detail-stock-table__delivery{
    white-space: normal;
  }
}
.mf-detail-analogs-list .list-group-item:first-child{
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.mf-detail-analogs-list .list-group-item:last-child{
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-short-card-content-container{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-short-card-content-container table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-short-card-image{
  width: 92px;
  padding: 12px;
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-short-card-image img{
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  background: linear-gradient(135deg, #f2f4f7, #e6eaef);
  border: 1px solid rgba(0,0,0,.06);
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-short-title-container{
  padding: 12px 12px 12px 0;
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-short-title-text{
  font-weight: 900;
  font-size: 14px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-short-card-price{
  padding: 12px 12px 12px 0;
  white-space: nowrap;
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-price-current{
  font-weight: 900;
  font-size: 18px;
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-short-card-btn{
  padding: 12px;
  white-space: nowrap;
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-buy-button.btn{
  border-radius: 12px;
  background: #ebbd2f !important;
  border: 0 !important;
  color: #000 !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: .8px !important;
}
.mf-shop--detail .product-item-detail-pay-block .product-item-detail-buy-button.btn.btn-link{
  background: transparent !important;
  text-transform: uppercase !important;
  letter-spacing: .6px !important;
  border: 1px dashed rgba(0,0,0,.18) !important;
  color: rgba(0,0,0,.65) !important;
}

@media (min-width: 992px){
  .mf-shop--detail .product-item-detail-pay-block{
    margin-top: 0;
    position: sticky;
    top: 24px;
  }
  /* Title is already shown as page H1 */
  .mf-shop--detail .product-item-detail-pay-block .product-item-detail-short-title-container{
    display: none;
  }
}
.mf-shop .product-item-detail-title{
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  margin: 0 0 10px;
}
.mf-shop .product-item-detail-price-current{
  font-size: 24px;
  font-weight: 900;
  color: #000;
}
.mf-shop .product-item-detail-price-old{
  font-size: 14px;
  color: rgba(0,0,0,.45);
  text-decoration: line-through;
}
.mf-shop .product-item-detail-info-container-title{
  font-size: 12px;
  color: rgba(0,0,0,.55);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 6px;
}

/* Quantity */
.mf-shop .product-item-amount-field-container{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 6px 10px;
  background: #fff;
}

/* Buttons */
.mf-shop .product-item-detail-buy-button{
  width: 100%;
  border-radius: 12px;
  background: #ebbd2f;
  border: 0;
  color: #000;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.mf-shop .product-item-detail-buy-button:hover{ opacity: .92; }
.mf-shop .product-item-detail-buy-button:active{ opacity: .85; }
.mf-shop .product-item-detail-compare-container .btn,
.mf-shop .product-item-detail-properties-link{
  border-radius: 12px;
}
.mf-view-list .catalog-section .product-item-line-card .product-item-title{
  margin-bottom: 10px;
  min-height: 0;
  -webkit-line-clamp: 2;
}
.mf-view-list .catalog-section .product-item-line-card .product-item-title a{
  font-size: 16px;
  font-weight: 900;
  color: #000;
}
.mf-view-list .catalog-section .product-item-line-card .product-item-image-wrapper{
  padding-top: 90%;
  margin-bottom: 0;
}
.mf-view-list .catalog-section .product-item-line-card .product-item-price-current{
  font-size: 18px;
}

/* Tree */
.mf-shop-tree{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  background: #fff;
  padding: 12px 12px;
}
.mf-shop-tree__title{
  font-weight: 900;
  font-size: 14px;
  margin: 2px 0 10px;
}
.mf-shop-tree__list{
  list-style: none;
  margin: 0;
  padding: 0;
}
.mf-shop-tree__list[data-level="2"],
.mf-shop-tree__list[data-level="3"],
.mf-shop-tree__list[data-level="4"]{
  padding-left: 14px;
  border-left: 1px dashed rgba(0,0,0,.12);
  margin-left: 8px;
}

.mf-shop-tree__details{
  margin: 0;
}
.mf-shop-tree__summary{
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 10px;
  user-select: none;
}
.mf-shop-tree__summary::-webkit-details-marker{ display: none; }
.mf-shop-tree__summary:hover{
  background: rgba(0,0,0,.04);
}
.mf-shop-tree__caret{
  width: 10px;
  height: 10px;
  display: inline-block;
  border-right: 2px solid rgba(0,0,0,.45);
  border-bottom: 2px solid rgba(0,0,0,.45);
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex: 0 0 auto;
  margin-top: -1px;
}
details[open] > .mf-shop-tree__summary .mf-shop-tree__caret{
  transform: rotate(45deg);
}
.mf-shop-tree__link,
.mf-shop-tree__leaf{
  color: #000;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  min-width: 0;
}
.mf-shop-tree__link{
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.mf-shop-tree__text{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mf-shop-tree__link.is-current,
.mf-shop-tree__leaf.is-current{
  color: #647886;
}
.mf-shop-tree__leaf{
  display: block;
  padding: 8px 8px 8px 26px;
  border-radius: 10px;
  font-weight: 600;
}
.mf-shop-tree__leaf:hover{
  background: rgba(0,0,0,.04);
  text-decoration: none;
}

