/**
 * Site-wide responsive overrides.
 * Loaded last — fixes legacy fixed widths / overflow on 375–991.
 */

/* —— Global safety —— */
img,
svg,
video {
  max-width: 100%;
}

/* —— Header —— */
@media screen and (min-width: 992px) {
  .desktop-header .head-menu-content {
    flex-wrap: nowrap !important;
    align-items: center !important;
  }

  .desktop-header .head-menu-content > [class*="col-"] {
    float: none !important;
  }

  .desktop-header .head-menu-content > .col-lg-2 {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 180px !important;
    min-width: 0 !important;
  }

  .desktop-header .head-menu-content > .col-lg-7 {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .desktop-header .head-menu-content > .col-lg-3 {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .desktop-header .desktop-header-logo .logo {
    max-height: 42px;
  }

  .bottom_head .menu_link {
    text-align: center;
  }

  .bottom_head .menu_link nav > ul {
    flex-wrap: nowrap !important;
    justify-content: center !important;
    white-space: nowrap;
    text-align: center;
  }

  .bottom_head .menu_link nav > ul > li {
    margin: 0 14px !important;
    flex: 0 0 auto;
  }

  .bottom_head .menu_link nav > ul > li:first-child {
    margin-left: 0 !important;
  }

  .bottom_head .menu_link nav > ul > li:last-child {
    margin-right: 0 !important;
  }

  .bottom_head .menu_link nav > ul > li > a {
    padding-top: 22px !important;
    padding-bottom: 22px !important;
    font-size: 16px !important;
  }
}

/* Иконки + CTA — как до «под макет» */
.desktop-header-actions {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

.desktop-header-actions > .e-cart,
.desktop-header-actions > .header-cart-wrap {
  flex: 0 0 28px !important;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.desktop-header-actions .cart-bar {
  width: 28px !important;
  max-width: 28px !important;
  min-height: 28px !important;
}

.desktop-header-actions .cart-bar span img {
  margin-right: 0 !important;
  width: 18px !important;
  height: 18px !important;
}

.desktop-header-actions .cart-count {
  left: auto !important;
  right: -6px !important;
  top: -6px !important;
}

.desktop-header-actions .button-block,
.desktop-header-actions .button-fn-rp-1 {
  flex: 0 1 auto;
  margin-left: 6px;
  white-space: nowrap;
}

/* Планшет: чуть плотнее, без переноса */
@media screen and (max-width: 1199px) and (min-width: 992px) {
  .bottom_head .menu_link nav > ul > li {
    margin: 0 8px !important;
  }

  .bottom_head .menu_link nav > ul > li > a {
    font-size: 14px !important;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
  }

  .desktop-header-actions .button-block,
  .desktop-header-actions .button-fn-rp-1 {
    font-size: 11px !important;
    padding: 7px 8px !important;
    min-width: 0 !important;
    white-space: nowrap;
    margin-left: 4px;
  }
}

@media screen and (max-width: 1099px) and (min-width: 992px) {
  .desktop-header-actions .button-block,
  .desktop-header-actions .button-fn-rp-1 {
    padding: 6px 7px !important;
    font-size: 10px !important;
    letter-spacing: 0;
  }

  .desktop-header-actions {
    gap: 6px !important;
  }

  .bottom_head .menu_link nav > ul > li {
    margin: 0 6px !important;
  }
}

@media screen and (max-width: 991px) {
  /* Header search: kill min-width that overflows tablet */
  form.search-input input[type="text"] {
    min-width: 0 !important;
    width: 100%;
    float: none;
  }

  .search-input,
  .search-bar {
    max-width: 100%;
    width: 100%;
  }

  /* kill legacy padding that stacks icons */
  .e-cart {
    padding-right: 0 !important;
  }

  .desktop-header-actions {
    display: none !important;
  }

  /* Catalog: не даём legacy prod-img / float раздувать карточку */
  #shop-listing,
  .catalog-page-v2,
  .catalog-grid-wrap,
  .catalog-cards,
  .catalog-card {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .catalog-card__media .prod-img {
    height: 100% !important;
    min-height: 0 !important;
  }

  /* Mobile drawer: never wider than viewport */
  .menu_link {
    width: min(375px, 100vw) !important;
  }

  .togglebtn.active {
    left: min(375px, 100vw - 50px) !important;
  }

  /* Catalog sidebar leftover fixed widths */
  .shop-panel {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Checkout legacy fixed columns */
  .delivery-blk,
  .ordersummary-blk {
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 0 !important;
  }

  .write-form,
  .write-review {
    width: 100% !important;
    padding-left: 0 !important;
  }

  .write-wrapper {
    flex-direction: column;
  }
}

@media screen and (max-width: 860px) {
  /* Home banner: fixed px widths caused horizontal scroll */
  .home-banner img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
}

@media screen and (max-width: 768px) {
  /* Tabs: 100px side padding overflow */
  .nav-tabs {
    display: flex !important;
    flex-wrap: nowrap;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    text-align: left;
  }

  .nav-tabs > .nav-item {
    flex: 0 0 auto;
  }

  /* PDP reviews block */
  .overall-ratting {
    flex-direction: column;
  }

  .rating-left,
  .rating-right {
    width: 100% !important;
    padding-left: 0 !important;
    border-right: 0 !important;
    min-height: 0 !important;
  }

  .rating-left {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgb(118 119 135 / 20%);
  }

  /* PDP meta row: 3 nowrap cols overflow on tablet */
  .product-detail-info {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .product-detail-info > div {
    white-space: normal !important;
    min-width: 0 !important;
  }

  .progress-col {
    flex-direction: column;
  }

  .progress-title,
  .progress {
    width: 100% !important;
  }

  .progress-title {
    margin-bottom: 8px;
  }
}

@media screen and (max-width: 480px) {
  .menu_link {
    width: 100% !important;
  }

  .togglebtn.active {
    left: auto !important;
    right: 12px !important;
  }
}
