/**
 * Snabtorg32 template — local overrides.
 *
 * Bootstrap 5 + theme styles come from child-theme.min.css (the WP theme bundle).
 * This file holds Joomla-specific fixes and later the JoomShopping / rcmjsfilter restyle
 * (using --rcmf-* tokens) to match the original 1:1.
 */

/* Ensure jdoc module wrappers don't break the Bootstrap grid. */
#wrapper-hero > div { width: 100%; }

/* ==========================================================================
   rcmjsfilter restyle — match the original WordPress WOOF sidebar filter 1:1
   Loaded AFTER media/mod_rcm_js_filter/css/default.min.css, so these win.
   Theme primary blue = #0087cf (original navbar .bg-primary + WOOF accent).
   Only --rcmf-* token + BEM overrides; no markup/mechanics changes.
   ========================================================================== */
.rcmf {
  /* WOOF palette */
  --rcmf-color-text: #2d374b;
  --rcmf-color-text-muted: #5a6577;
  --rcmf-color-heading: #2d374b;
  --rcmf-color-bg: #fff;
  --rcmf-color-bg-muted: transparent;     /* container had #f0f0f0 — WOOF panel is bare */
  --rcmf-color-border: #cfd6e0;
  --rcmf-color-border-block: #e0e0e0;
  --rcmf-color-accent: #0087cf;           /* submit / links / toggle count / mobile apply */
  --rcmf-color-accent-text: #fff;
  --rcmf-radius-sm: 4px;
  --rcmf-radius-md: 4px;
  --rcmf-font-title: 16px;
  --rcmf-space-block-x: 0px;              /* WOOF lists are flush to the column edge */
  --rcmf-space-block-head-l: 0px;
  /* price slider in theme blue */
  --rcmf-slider-accent: #0087cf;
  --rcmf-slider-handle-bg: #0087cf;
  --rcmf-slider-track-border: #bcdcef;
  --rcmf-slider-inactive: #eef3f7;

  font-size: 14px;
  line-height: 1.3;
}

/* Bare panel — no muted card background */
.rcmf .rcmf__container { background: transparent; padding: 0; }

/* "Фильтры товаров" panel heading (desktop). cfg title is empty + no module
   chrome title in dev, so inject the WOOF widget heading via CSS content. */
@media (min-width: 769px) {
  .rcmf .rcmf__form::before {
    content: "Фильтры товаров";
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--rcmf-color-heading);
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--rcmf-color-border-block);
  }
}

/* Facet blocks: drop the boxed top/bottom borders, space them out */
.rcmf .rcmf-block { border: 0; margin-bottom: 14px; }

/* Section header: title left, thin underline, toggle triangle on the RIGHT */
.rcmf .rcmf-block__header {
  padding: 0 0 8px;
  margin-bottom: 9px;
  border-bottom: 1px solid var(--rcmf-color-border-block);
}
.rcmf .rcmf-block__title { font-size: var(--rcmf-font-title); font-weight: 500; }

/* Recolour + reposition the collapse triangle to the right edge, theme blue */
.rcmf .rcmf-block__ctrl {
  left: auto;
  right: 2px;
  top: 6px;
  border-top-color: var(--rcmf-color-accent);
}
.rcmf .rcmf-block__ctrl.roll { border-left-color: var(--rcmf-color-accent); }

/* Collapsible filter blocks (rcmf-collapse.js): click header/arrow to collapse a block */
.rcmf .rcmf-block__header { cursor: pointer; user-select: none; }
.rcmf .rcmf-block--collapsed > *:not(.rcmf-block__header) { display: none !important; }
.rcmf .rcmf-block--collapsed .rcmf-block__header { margin-bottom: 0; border-bottom-color: transparent; }

/* Option rows: compact, term names in theme blue (WOOF link style) */
.rcmf .rcmf-block__params { padding: 0; }
.rcmf .rcmf-block .rcmf-block__params:first-child { padding: 0; }
.rcmf .rcmf-block__params label { padding: 4px 0; align-items: center; }
.rcmf .rcmf-block__params label:hover { color: inherit; }
.rcmf .rcmf-block__params span {
  color: var(--rcmf-color-accent);
  text-decoration: none;
  font-size: 14.4px;
  line-height: 1.2;
}
.rcmf .rcmf-block__params label:hover span { color: #005f93; }
.rcmf .rcmf-block__params input[disabled] + span { color: var(--rcmf-color-disabled); }

/* Checkboxes / radios: soft grey rounded squares, fill theme blue when active */
.rcmf .rcmf-block__params input[type=checkbox],
.rcmf .rcmf-block__params input[type=radio] {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
  background: #e9edf2;
  border: 1px solid #cfd6e0;
  cursor: pointer;
}
.rcmf .rcmf-block__params input[type=checkbox] { border-radius: 4px; }
.rcmf .rcmf-block__params input[type=radio] { border-radius: 50%; }
.rcmf .rcmf-block__params input[type=checkbox]:checked,
.rcmf .rcmf-block__params input[type=radio]:checked {
  background: var(--rcmf-color-accent);
  border-color: var(--rcmf-color-accent);
}
.rcmf .rcmf-block__params input[type=checkbox]:checked::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  margin: 1px auto 0;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.rcmf .rcmf-block__params input[type=radio]:checked::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: #fff;
}

/* Price slider digits inputs — neutral, theme border on focus */
.rcmf .rcmf-slider .rcmf-slider__min-input,
.rcmf .rcmf-slider .rcmf-slider__max-input {
  border: 1px solid var(--rcmf-color-border);
  border-radius: var(--rcmf-radius-sm);
}

/* Visual order: WOOF leads with brand/area/packaging — push the price block
   (always the first .rcmf-block) below the other facets, above the buttons. */
.rcmf .rcmf__form { display: flex; flex-direction: column; }
.rcmf .rcmf__form > .rcmf-block:first-of-type { order: 50; }
.rcmf .rcmf__buttons { order: 60; }

/* Submit = full-width primary "Фильтровать"; reset = subtle text link below */
.rcmf .rcmf__buttons { display: block; margin-top: 16px; }
.rcmf input.rcmf__submit {
  display: block;
  width: 100%;
  /* The rcm filter preset (default.min.css) sets `.rcmf__buttons input { height: 29px }`
     with box-sizing:border-box, which together with 11px top/bottom padding leaves only
     ~5px content box, clipping "Показать" (overflow:clip). Drop the height cap, restore
     line-height and let the symmetric padding size the button so the text is fully
     visible and vertically centred. */
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  box-sizing: border-box;
  padding: 11px 14px;
  line-height: 1.3;
  background: var(--rcmf-color-accent);
  border: 1px solid var(--rcmf-color-accent);
  border-radius: var(--rcmf-radius-md);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.rcmf input.rcmf__submit:hover { background: #0077b8; border-color: #0077b8; }
.rcmf input.rcmf__reset {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 4px;
  background: transparent;
  border: 0;
  color: var(--rcmf-color-text-muted);
  font-size: 13px;
  text-decoration: underline;
}
.rcmf input.rcmf__reset:hover { color: var(--rcmf-color-accent); }

/* Facet "Показать больше / Скрыть" cap (template JS rcmf-cards.js) — mirrors the
   original WOOF compact lists: only the first N options show until expanded. */
.rcmf .rcmf-block:not(.rcmf-expanded) .rcmf-block__params label.rcmf-extra { display: none !important; }
.rcmf .rcmf-more {
  display: inline-block;
  margin: 6px 0 2px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--rcmf-color-accent);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.rcmf .rcmf-more::before {
  content: "+ ";
  font-weight: 700;
}
.rcmf .rcmf-block.rcmf-expanded .rcmf-more::before { content: "− "; }
.rcmf .rcmf-more:hover { color: #005f93; text-decoration: underline; }

/* FIX (re-audit #6) — filtered-state floating "Показать [N]" quick-apply tip.
   The filter JS renders it position:absolute with an inline left:-125px, so it
   hangs off / overlaps the top-left of the sidebar. The original WOOF sidebar
   has no such floating box, and the full-width "Показать" submit button below
   already applies the filter (the module itself hides this tip on mobile). Drop
   it on desktop too so nothing overlaps the filter panel/header. */
.rcmf .rcmf-tip { display: none !important; }

/* =====================================================================
   CATALOG (product card + product page) — snabtorg migration fixes.
   Scope: com_jshopping overrides only. Does NOT touch the .rcmf filter
   section above. Complements child-theme.min.css (ported WooCommerce CSS)
   by restoring the parent-theme rules that were not ported.
   ===================================================================== */

/* FIX #4 — remove JoomShopping "Copyright MAXXmarketing GmbH / JoomShopping
   Download & Support" credit (emitted by the core controller as #mxcpr).
   Also removed from the DOM by js/cleanup.js; this is the no-flash fallback. */
#mxcpr { display: none !important; }

/* FIX (re-audit #1) — pages that must have NO filter sidebar (full-width, like
   the original): the product DETAIL view (.jshop.productview) and the /brands
   manufacturer LIST (.jshop_list_manufacturer — original is col-md-12). The body
   class is "view-category"/"view-manufacturer" on these, so we scope via :has()
   on the component markup. The category listing and a single manufacturer's
   product listing (.jshop_list_product) keep their filter column intact. This
   also drops the filter module's stray "1" (.msg) those pages would render. */
#content .row:has(#primary .jshop.productview) #left-sidebar,
#content .row:has(#primary .jshop_list_manufacturer) #left-sidebar { display: none !important; }
#content .row:has(#primary .jshop.productview) > main#primary,
#content .row:has(#primary .jshop_list_manufacturer) > main#primary {
  flex: 0 0 100%;
  max-width: 100%;
}

/* FIX #6 — product card title: keep it small, themed and clamped so long
   names don't overflow / run together (parent-theme rule was not ported). */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 500;
  color: #0087cf; /* original: blue link-coloured title */
  margin: 0;
  padding: 0.5rem 0.75rem; /* symmetric vertical (original = 8px/8px), not 9.6/4 */
  text-align: center;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Card links: NO underline at rest OR hover — the original card link is
   text-decoration:none; Bootstrap 5's default a{underline} leaked onto
   .woocommerce-loop-product__link (and thus over the title/price inside it). */
.woocommerce ul.products li.product a,
.woocommerce ul.products li.product a:hover,
.woocommerce ul.products li.product a:focus { text-decoration: none; }
/* Price: match the original — green, ~13.7px, no underline (it sits inside the card link) */
.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .price .woocommerce-Price-amount {
  color: #198754;
  font-size: 0.857rem;
  font-weight: 400;
  text-decoration: none;
}
.woocommerce ul.products li.product .price { margin: 0 0 0.5em; } /* original bottom gap ~6.86px */

/* FIX #6 — category/subcategory tile title (top-level catalog pages). */
.jshop_categ .category_name a.product_link,
.jshop_categ .category_name {
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 600;
  color: #2d374b;
  text-align: center;
  overflow-wrap: break-word;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* PRODUCT DETAIL 2-COLUMN LAYOUT — match the original 1:1.
   Original WooCommerce single product: gallery (left) and .summary (right) are
   equal ~47% columns; the tabs (Описание/Детали) live INSIDE the .summary column.
   We use Bootstrap col-lg-6 / col-lg-6 for the equal split; these rules make the
   main image fill its column (the stock JoomShopping <img> renders at natural
   size otherwise, so the image block looked too small). */
.jshop.productview .image_middle { margin-bottom: 1rem; }
.jshop.productview .image_middle a.lightbox,
.jshop.productview .image_middle #list_product_image_middle,
.jshop.productview .image_middle a.lightbox img,
.jshop.productview .image_middle > img,
.jshop.productview #list_product_image_middle img {
  display: block;
  width: 100%;
  height: auto;
}
/* Tabs sit inside the right column; keep a little breathing room from the cart. */
.jshop.productview .summary .woocommerce-tabs { margin-top: 1.2rem; }
.jshop.productview .summary .woocommerce-tabs ul.wc-tabs { margin-top: 0; }

/* FIX #3 — short description block under the price (right column).
   Rescoped (re-audit #6): our wrapper has `woocommerce` + `product` on the SAME
   element (.jshop.productview.woocommerce.product), so `.woocommerce div.product`
   never matched. Scope to .jshop.productview .summary instead. */
.jshop.productview .summary .woocommerce-product-details__short-description {
  margin: 0.5rem 0 1.1rem;
  color: #5a6577;
  line-height: 1.5;
}

/* FIX (re-audit #5) — single-product price: green, 20px. The previous rule
   `.woocommerce div.product .summary .price` never matched (same-element wrapper),
   so the price inherited the default size. Rescope to .jshop.productview. */
.jshop.productview .summary .price,
.jshop.productview .summary .price .woocommerce-Price-amount,
.jshop.productview .summary .prod_price.price #block_price {
  font-size: 20px;
  color: #198754;
}

/* FIX #5 — product-page tabs (Описание / Детали). Tab strip styling was not
   ported; the panels themselves are already styled by child-theme.min.css. */
.woocommerce-tabs ul.wc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border-bottom: 1px solid #e0e0e0;
}
.woocommerce-tabs ul.wc-tabs li { margin: 0; padding: 0; background: none; border: 0; }
.woocommerce-tabs ul.wc-tabs li a {
  display: block;
  padding: 0.6rem 1.4rem;
  color: #2d374b;
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
}
.woocommerce-tabs ul.wc-tabs li.active a {
  border-color: #e0e0e0;
  background: #fff;
  font-weight: 600;
  border-radius: 4px 4px 0 0;
}
.woocommerce-tabs .woocommerce-Tabs-panel { padding: 1.3rem 0.2rem; }

/* FIX #2 — characteristics table (WooCommerce shop_attributes 1:1). */
.shop_attributes,
.woocommerce-product-attributes {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.shop_attributes th,
.shop_attributes td,
.woocommerce-product-attributes th,
.woocommerce-product-attributes td {
  border: 1px solid #e0e0e0;
  padding: 0.55rem 0.85rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.4;
}
.shop_attributes th,
.woocommerce-product-attributes th {
  width: 32%;
  font-weight: 600;
  background: #f7f9fb;
  color: #2d374b;
}
.shop_attributes td p,
.woocommerce-product-attributes td p { margin: 0; }

/* =====================================================================
   PAGE-HEADER BAND — interior dark page-title band (FIX #1).
   Port of the WP child-theme "<div class="bg-dark box-shadow-v1 mb-3">"
   header. bg-dark / box-shadow-v1 / mb-3 / py-3 come from Bootstrap +
   child-theme; content-space-1 / content-space-lg-2 are no-ops in the
   original too, so spacing already matches 1:1. Rendered in index.php
   ONLY for com_content single-article pages (matches the original; NOT on
   category / product / home).
   ===================================================================== */
.bg-dark.box-shadow-v1 > .container > h1.text-white,
.bg-dark.box-shadow-v1 > .container-fluid > h1.text-white {
  margin: 0;
  font-weight: 500; /* FIX #9 — original band h1 is 500 (was 600) */
  line-height: 1.2;
}
/* FIX #9 — band height ~88px (original) vs 80px: nudge the inner padding.
   Bootstrap's .py-3 utility is !important, so override in kind. */
.bg-dark.box-shadow-v1 > .container,
.bg-dark.box-shadow-v1 > .container-fluid {
  padding-top: 20px !important;
  padding-bottom: 20px !important;
}

/* =====================================================================
   FIX #1 — catalog & product H1 size = 28px / 500 (original WooCommerce).
   Joomla's default 40px h1 leaks onto the category title
   (.woocommerce-products-header__title) and the product title
   (.jshop.productview h1.product_title). The article dark-band h1
   (.bg-dark .text-white) is intentionally NOT included — it stays 40px/500.
   ===================================================================== */
.woocommerce-products-header__title,
.jshop.productview h1.product_title {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
}

/* =====================================================================
   BREADCRUMBS — match the original WooCommerce .woocommerce-breadcrumb 1:1.
   Original computed: font-size 14.72px (0.92rem) / line-height 1.5, colour
   #767676 for BOTH the links and the current (last) item, font-weight 400,
   links underlined; nav margin 16px 0 14.72px(1em), padding 0 12px.
   Ours leaked 16px/24px, #2d374b current text and #0087cf blue links, and
   had no bottom margin or side padding — bring it in line.
   ===================================================================== */
.woocommerce-breadcrumb {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #767676;            /* current (last) item — plain text node */
  font-weight: 400;
  margin: 16px 0 1em;
  /* No side padding: in our layout the breadcrumb sits directly in the .container
     (full-width, above the row), so the container gutter already provides the edge.
     The original's 12px came from its column wrapper; here it would double-indent the
     crumb past the title/content edge. Zero it (and beat child-theme's !important gutter). */
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.woocommerce-breadcrumb a {
  color: #767676;            /* links — same muted grey, underlined */
  font-size: inherit;
  font-weight: 400;
  text-decoration: underline;
}

/* =====================================================================
   PAGINATION (FIX #3) — restyle JoomShopping pagination
   (.jshop_pagination .pagination > li.page-item > a.page-link) to match the
   original WooCommerce control: centered, joined/bordered box, #006ca6
   current, #0087cf hover, single prev/next arrows (first/last & the disabled
   prev on page 1 are hidden, exactly like the original).
   ===================================================================== */
.jshop_pagination { text-align: center; margin: 1.5rem 0 1.5rem; }
/* The outer `div.pagination` inherits Bootstrap's `.pagination { display:flex }`, so its
   child `nav.pagination__wrapper` shrinks to content and lands at flex-start (left) —
   text-align:center on the ancestors can't move a flex item. Centre the flex line. */
.jshop_pagination div.pagination { display: flex; justify-content: center; }
.jshop_pagination .pagination__wrapper { display: block; text-align: center; }
.jshop_pagination ul.pagination {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  list-style: none;
  margin: 1px auto !important;
  padding: 0;
  border: 1px solid #cfc8d8;
  border-right: 0;
}
.jshop_pagination ul.pagination .page-item { margin: 0; border-right: 1px solid #cfc8d8; }
.jshop_pagination ul.pagination .page-item .page-link {
  display: block;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #816e99;
  padding: .75em 1.25em;
  line-height: 1;
  font-weight: 400;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: none;
}
.jshop_pagination ul.pagination .page-item:not(.active):not(.disabled) .page-link:hover,
.jshop_pagination ul.pagination .page-item:not(.active):not(.disabled) .page-link:focus {
  background: #0087cf;
  color: #fff;
}
.jshop_pagination ul.pagination .page-item.active .page-link {
  background: #006ca6;
  color: #fff;
  z-index: auto;
}
/* Match the original: hide first/last (double-chevron) controls and any
   disabled control (e.g. the greyed prev on page 1). */
.jshop_pagination ul.pagination .page-item.disabled,
.jshop_pagination ul.pagination .page-item:has(.icon-angle-double-left),
.jshop_pagination ul.pagination .page-item:has(.icon-angle-double-right) { display: none; }
/* Render the prev/next arrow glyphs (Joomla icomoon font is not loaded here). */
.jshop_pagination .icon-angle-left::before  { content: "\2039"; font-style: normal; }
.jshop_pagination .icon-angle-right::before { content: "\203A"; font-style: normal; }
.jshop_pagination .pagination_result_counter {
  margin-top: .75rem;
  color: #5a6577;
  font-size: .9rem;
}

/* =====================================================================
   GRID OFFSET FIX — a global `ol, ul { padding-left: 2rem }` (core/Bootstrap reboot)
   indents the product grid (and category-tiles list) to the right inside the products
   column. Reset list padding/margin/marker for the WooCommerce product list and the
   JoomShopping category-tiles list, scoped to catalog (category + brand) pages.
   ===================================================================== */
.woocommerce ul.products,
.woocommerce .jshop_list_category ul,
#comjshop .jshop_list_category .row-fluid {
  padding-left: 0;
  margin-left: 0;
  list-style: none;
}

/* =====================================================================
   CATEGORY PROPORTIONS (FIX #4) — constrain product card image height so the
   product grid keeps the original card proportions and the filter column does
   not look squeezed. Original loop image is width:100%/height:auto on a 25%
   (columns-4) card; we cap the visual height and center via object-fit so tall
   portrait photos don't blow the cards up.
   ===================================================================== */
.woocommerce ul.products li.product a.woocommerce-loop-product__link img,
.woocommerce ul.products li.product img.jshop_img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1em;
  box-shadow: none;
}

/* =====================================================================
   MANUFACTURERS / BRANDS (FIX re-audit #5c) — clean branded placeholder for
   manufacturers that have no logo (replaces the raw noimage.gif graphic). The
   manufacturer NAME is shown in a soft, themed box matching the logo footprint.
   ===================================================================== */
.jshop_list_manufacturer .manufacturer .image .manufacturer-noimage {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 120px;
  max-height: 300px;
  margin: 0 auto 1em;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, #f3f7fb 0%, #e9f1f8 100%);
  border: 1px solid #d4e2ee;
  border-radius: 6px;
  color: #006ca6;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* =====================================================================
   PRODUCTS TOOLBAR — match the original WooCommerce bar: result-count (left)
   + ordering select (right). Replaces JoomShopping's standard sort/count block.
   ===================================================================== */
.woocommerce .woocommerce-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin: 0 0 1.25rem;
}
/* FIX #3 — result count: match original WooCommerce (16px, #2d374b). */
.woocommerce .woocommerce-toolbar .woocommerce-result-count {
  margin: 0;
  float: none;
  color: #2d374b;
  font-size: 16px;
}
.woocommerce .woocommerce-toolbar .woocommerce-ordering {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  float: none;
}
/* FIX #3 — clean single ordering <select> (no "Сортировка:" label, no dir arrow);
   16px to match the original. */
.woocommerce .woocommerce-toolbar .woocommerce-ordering select {
  display: inline-block;
  width: auto;
  min-width: 190px;
  padding: .375rem 2rem .375rem .75rem;
  font-size: 16px;
  line-height: 1.5;
  color: #2d374b;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 16px 12px;
  border: 1px solid #ced4da;
  border-radius: .375rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
@media (max-width: 575.98px) {
  .woocommerce .woocommerce-toolbar { justify-content: flex-start; }
  .woocommerce .woocommerce-toolbar .woocommerce-ordering { width: 100%; }
  .woocommerce .woocommerce-toolbar .woocommerce-ordering select { flex: 1 1 auto; }
}

/* =====================================================================
   RESPONSIVE AUDIT FIXES (porting parity with the WP original)
   Added after the cross-breakpoint audit (325/425/600/768/1024/1200/1600).
   The ported child-theme.min.css already drives the WooCommerce product-grid
   column counts (.columns-4 li.product → 1 / 2 / 3 / 4 at <576 / 576 / 768 / 992),
   and those match the original 1:1 once the viewport meta is emitted. The rules
   below fix the LAYOUT seams that the WP→Joomla port introduced.
   ===================================================================== */

/* FIX (responsive #1) — filter column / product grid at the 768px seam.
   The rcmjsfilter package switches to its "Фильтр" drawer at @media(max-width:768px),
   but the catalog layout uses Bootstrap .col-md-3/.col-md-9 which go side-by-side at
   >=768px. At EXACTLY 768px the filter is a drawer (the #left-sidebar holds only the
   small toggle button) yet the col-md-3 still reserves ~180px, squeezing the products
   into the 9-col track (cramped 3-up against an empty strip). The original keeps the
   filter inline and the products fill the row. Collapse the 2-col grid to full-width
   stacking whenever the filter is in drawer mode (<=768) so the toggle sits on its own
   row and the product grid spans the full width (still 3-up via the ported grid rules,
   matching the original's column count). Desktop (>=992, and 769-991) is untouched. */
@media (max-width: 768px) {
  #content .row > #left-sidebar,
  #content .row > main#primary {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }
}

/* Cookie/analytics consent + Yandex.Metrika UI: вынесено в модуль mod_rcm_cookie
   (баннер #snabtorg-consent и его стили удалены 2026-06-26 как дубль). */

/* ============================================================================
   Mobile header on one line (logo + phone + hamburger)
   Below the lg breakpoint (navbar-expand-lg) the brand img is forced to 95px by
   child-theme.min.css and the phone block to ~230px, so the three items overflow
   the row and the hamburger wraps to a second line. Keep them on a single row:
   shrink the logo, group the phone to the right next to the toggler, fit the font.
   ============================================================================ */
@media (max-width: 991.98px) {
  #main-nav .container,
  #main-nav .container-fluid { flex-wrap: nowrap; }

  #main-nav .navbar-brand { flex: 0 0 auto; margin-right: .5rem; }
  #main-nav .navbar-brand img { height: 40px; width: auto; }

  /* Phone sits to the right, just before the hamburger; drop row gutters. */
  #main-nav .row.ms-lg-auto { --bs-gutter-x: 0; margin-left: auto; flex: 0 1 auto; min-width: 0; }
  #main-nav .row.ms-lg-auto .fs-5 { font-size: 1rem; line-height: 1.2; }
  #main-nav .row.ms-lg-auto a { white-space: nowrap; }
  #main-nav .row.ms-lg-auto .fa-phone { margin-right: .35rem !important; }

  #main-nav .navbar-toggler { flex: 0 0 auto; margin-left: .5rem; padding: .25rem .5rem; }
}

/* Very small phones (≤374px): tighten a touch more so nothing overflows. */
@media (max-width: 374.98px) {
  #main-nav .navbar-brand img { height: 34px; }
  #main-nav .row.ms-lg-auto .fs-5 { font-size: .9rem; }
  #main-nav .navbar-toggler { margin-left: .35rem; }
}

/* Quick-order button wrapper: it reuses WooCommerce's `.cart` class, which inherits a
   table border (border:1px solid #ccc; border-collapse:collapse) from child-theme.min.css
   and renders as a stray divider under the "Быстрый заказ" button. It is a button wrapper,
   not a cart table (catalog mode has no cart), so drop the border. Scoped to this wrapper. */
.prod_buttons.one_click_order_wrap.cart {
  border: 0;
  border-collapse: initial;
}

/* #89 Подкатегории/товары: размер заголовка как на проде (WooCommerce base отсутствует в Joomla).
   На проде .woocommerce-loop-*__title = 16px/500/1.2/center/#0087cf. */
.woocommerce ul.products li.product-category .woocommerce-loop-category__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    color: #0087cf;
    margin: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
