/* Общая оболочка: desktop сохраняет действующую шапку; мобильная использует
   тот же логотип/поиск и нативное раскрываемое меню. Иконки FA6 не переопределяются. */
.gh-mobile-menu, .gh-mobile-cart { display: none; }
/* Поздние правила темы обнуляют outline даже при :focus-visible. Для новых
   общих элементов сохраняем явную рамку клавиатурного фокуса. */
.gh-site-header :is(a,button,input,select,summary):focus-visible,
.gh-catalog :is(a,button,input,select,summary):focus-visible,
.single-product :is(a,button,input,select,summary):focus-visible {
    outline: 2px solid #315f16 !important; outline-offset: 3px;
}
.gh-catalog-intro { margin: 12px 0 20px; border: 1px solid #d9e1d5; border-radius: 8px; }
.gh-catalog-intro > summary, .gh-catalog-filters > summary { padding: 14px 16px; color: #315f16; cursor: pointer; font-weight: 600; }
.gh-catalog-intro > :not(summary) { margin: 12px 16px; }
.gh-catalog-filters > summary { border: 1px solid #d9e1d5; border-radius: 8px; margin-bottom: 16px; }
.gh-catalog-filters[open] > summary { margin-bottom: 20px; }
/* Действующая активная ссылка меню должна быть читаема и на desktop. */
#top-megamenu-nav .navbar-nav > li.current-menu-item > a { background: #38691d; color: #fff; }

@media (max-width: 991px) {
    body .top-bar, .gh-site-header #top-megamenu-nav,
    .gh-site-header .top-cart-row, .gh-site-header .contact-row { display: none; }
    body .gh-site-header { padding: 0; margin: 0; }
    .gh-site-header > .container.no-padding { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; padding: 10px 16px 14px !important; width: 100%; }
    .gh-site-header > .container::before, .gh-site-header > .container::after { display: none; }
    .gh-site-header .logo-holder { width: auto; padding: 0; margin: 0; align-self: center; }
    body .gh-site-header .logo-holder .logo { margin: 0 !important; padding: 0; height: 60px; text-align: left; }
    .gh-site-header .logo a { display: block; padding: 0; line-height: 0; }
    .gh-site-header .logo img { width: 100px; height: 60px; object-fit: contain; }
    .gh-mobile-cart { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 48px; min-height: 48px; align-self: center; color: #38691d; font-size: 22px; }
    .gh-mobile-cart .count { font: 600 12px/1.4 'Open Sans',sans-serif; padding: 2px 4px; border-radius: 4px; background: #eef4ea; }
    .gh-mobile-menu { display: block; align-self: center; }
    .gh-mobile-menu > summary { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; cursor: pointer; color: #315f16; font-size: 11px; list-style: none; }
    .gh-mobile-menu > summary::-webkit-details-marker { display: none; }
    .gh-mobile-menu > summary .fa { font-size: 23px; margin-bottom: 3px; }
    /* Меню находится в потоке, поэтому не перекрывает поиск, нижнюю панель или фокус. */
    .gh-mobile-menu[open] { grid-column: 1 / -1; grid-row: 2; }
    .gh-mobile-menu[open] > summary { align-items: flex-start; flex-direction: row; gap: 8px; justify-content: flex-start; font-size: 15px; min-height: 44px; }
    .gh-mobile-menu nav { background: #f6f8f4; border: 1px solid #d9e1d5; border-radius: 8px; padding: 8px 12px; }
    .gh-mobile-menu nav ul { padding: 0; margin: 0; list-style: none; }
    .gh-mobile-menu nav ul ul { padding-left: 16px; }
    .gh-mobile-menu nav a, .gh-mobile-menu nav summary { display: flex; align-items: center; min-height: 44px; padding: 8px; line-height: 1.45; color: #315f16; overflow-wrap: anywhere; }
    .gh-mobile-menu nav .gh-menu-catalog { font-weight: 700; border-bottom: 1px solid #d9e1d5; }
    .gh-menu-links .menu-item-object-page.current-menu-item > a { font-weight: 700; }
    .gh-site-header .top-search-holder { grid-column: 1 / -1; width: auto; padding: 0; margin: 0; }
    .gh-site-header .mc-search-bar { margin: 0; }
    .gh-site-header .mc-search-bar form .input-group { display: grid; grid-template-columns: minmax(0,1fr) 48px; width: 100%; border: 1px solid #bbc8b3; border-radius: 8px; overflow: visible; }
    .gh-site-header .mc-search-bar .search-field, .gh-site-header .twitter-typeahead { width: 100% !important; min-width: 0; }
    .gh-site-header .mc-search-bar .search-field { height: 46px; padding: 10px 12px; font-size: 16px; border: 0; border-radius: 8px 0 0 8px; }
    /* Нативный выбор области поиска остаётся видимым, в собственной строке.
       Скрывается только декоративная копия customSelect, не выбранное условие. */
    .gh-site-header .mc-search-bar .input-group-addon { display: contents; padding: 0; border: 0; background: transparent; }
    .gh-site-header .mc-search-bar .input-group-addon select { grid-row: 2; grid-column: 1 / -1; display: block !important; position: static !important; opacity: 1 !important; width: 100% !important; height: 44px !important; padding: 8px 12px; font-size: 14px; border: 0; border-top: 1px solid #d9e1d5; background: #f6f8f4; border-radius: 0 0 7px 7px; }
    .gh-site-header .mc-search-bar .customSelect, .gh-site-header .mc-search-bar .mc-search-bar-select { display: none !important; }
    .gh-site-header .mc-search-bar .input-group-addon button { grid-row: 1; grid-column: 2; width: 48px; height: 46px; padding: 0; border-radius: 0 7px 0 0; }
    .gh-site-header .breadcrumb-nav-holder { display: block; width: 100%; max-width: 100%; margin: 0; }
    .gh-site-header .breadcrumb-nav-holder .container { width: 100%; }
    .gh-site-header .breadcrumb-nav-holder > ul.mc-breadcrumb { display: flex; width: 100%; overflow-x: auto; white-space: nowrap; margin: 0; padding: 0 12px; }
    .gh-site-header .mc-breadcrumb > li { flex: 0 0 auto; float: none; display: flex; align-items: center; min-height: 44px; }
    /* Выпадающая копия главного меню в крошках на телефоне избыточна. */
    .gh-site-header .breadcrumb-nav-holder.minimal .mc-breadcrumb > li.le-le-dropdown { display: none !important; }
    /* Панель категорий — реальные прежние виджеты, перед выдачей на телефоне. */
    body.gh-catalog #content.site-content { padding-top: 16px !important; }
    .gh-catalog #content > .row { display: flex; flex-wrap: wrap; }
    .gh-catalog #content > .row > #primary { order: 2; width: 100%; }
    .gh-catalog #content > .row > #sidebar { display: block; order: 1; width: 100%; padding: 0 15px; margin: 0; }
    .gh-catalog #secondary { display: block; }
    .gh-catalog #secondary .col-xs-12 { float: none; width: 100%; padding: 0; }
    .gh-catalog-filters { margin: 0; }
    .gh-catalog-filters .widget { margin-bottom: 20px; }
    .gh-catalog-filters a { min-height: 44px; line-height: 1.5; padding-top: 10px; padding-bottom: 10px; }
    .gh-catalog .woocommerce-products-header { padding: 0; margin: 0; }
    .gh-catalog .woocommerce-products-header h1 { margin: 4px 0 12px; font-size: 25px; line-height: 1.3; }
    .gh-catalog .control-bar { margin: 12px 0 16px; padding: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
    .gh-catalog .control-bar .woocommerce-ordering { margin: 0; flex: 1; min-width: 0; }
    .gh-catalog .control-bar select { min-height: 44px; width: 100%; max-width: 100%; font-size: 14px; }
    .gh-catalog .control-bar .shop-view-switcher { flex: 0 0 88px; display: flex; padding: 0; }
    .gh-catalog .control-bar .shop-view-switcher > li { float: none; margin: 0; }
    .gh-catalog .control-bar .shop-view-switcher a { width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 0; }
    .gh-catalog .control-bar .shop-view-switcher a .fa { font-size: 20px; }
    /* Категории и товары адаптируются без обрезки длинного названия. Высота,
       которую JS темы выравнивает для desktop, на телефоне не фиксируется. */
    .gh-catalog #grid-view ul.products { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; padding: 0; }
    .gh-catalog #grid-view ul.products::before, .gh-catalog #grid-view ul.products::after { display: none; }
    .gh-catalog #grid-view ul.products > li.product { width: auto !important; height: auto !important; margin: 0 !important; min-width: 0; float: none; }
    .gh-catalog #grid-view .product-category > a { display: flex; align-items: center; gap: 8px; padding: 10px; min-height: 84px; }
    .gh-catalog #grid-view .product-category .product-cat-thumbnail-wrapper { flex: 0 0 40px; width: 40px; height: 48px; margin: 0; }
    .gh-catalog #grid-view .product-category img { position: static; transform: none; width: 40px; height: 48px; object-fit: contain; }
    .gh-catalog #grid-view .product-category h2 { font-size: 13px; line-height: 1.45; padding: 0; margin: 0; overflow-wrap: anywhere; }
    .gh-catalog #grid-view .type-product .product-inner { display: flex; flex-direction: column; height: 100%; padding: 10px; border: 1px solid #e0e5dc; box-shadow: none; }
    .gh-catalog #grid-view .type-product .woocommerce-LoopProduct-link { display: flex; flex-direction: column; flex: 1; padding: 0; }
    .gh-catalog #grid-view .type-product .product-thumbnail-wrapper { width: 100%; aspect-ratio: 1; height: auto; margin: 0 0 10px; }
    .gh-catalog #grid-view .type-product img { position: static; transform: none; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
    .gh-catalog #grid-view .type-product .title-area { height: auto !important; min-height: 0; margin: 0 0 10px; }
    .gh-catalog #grid-view .type-product h2 { font-size: 14px; line-height: 1.45; margin: 0 0 6px; overflow-wrap: anywhere; }
    .gh-catalog #grid-view .type-product .price { padding: 10px 0; margin-top: auto; text-align: left; }
    .gh-catalog #grid-view .type-product .price .amount { font-size: 18px; }
    .gh-catalog #grid-view .type-product .hover-area { display: block !important; position: static !important; width: auto; padding: 0; border: 0; box-shadow: none; opacity: 1; visibility: visible; background: transparent; }
    .gh-catalog #grid-view .hover-area-inner { padding: 0; margin: 0; }
    .gh-catalog #grid-view .hover-area a.button { display: flex; align-items: center; justify-content: center; position: static; transform: none; min-height: 44px; width: 100%; margin: 0; padding: 8px 4px; font-size: 14px; border-radius: 6px; }
    .gh-catalog #grid-view .hover-area .action-buttons { display: flex; justify-content: space-around; align-items: center; gap: 4px; margin-top: 6px; padding: 0; }
    .gh-catalog #grid-view .action-buttons .yith-wcwl-add-to-wishlist { margin: 0; padding: 0; }
    .gh-catalog #grid-view .action-buttons a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0; padding: 4px; color: #38691d; }
    .gh-catalog #grid-view .action-buttons a svg { width: 22px; height: 22px; margin: 0; }
    .gh-catalog #grid-view .action-buttons a span, .gh-catalog #grid-view .action-buttons .feedback { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    /* После добавления YITH заменяет кнопку ссылкой на список. Она тоже имеет
       видимую иконку и прежнее доступное имя, а не длинную строку поверх соседа. */
    .gh-catalog #grid-view :is(.yith-wcwl-wishlistaddedbrowse,.yith-wcwl-wishlistexistsbrowse) > a { font-size: 0; }
    .gh-catalog #grid-view :is(.yith-wcwl-wishlistaddedbrowse,.yith-wcwl-wishlistexistsbrowse) > a::before { content: '\f004'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 22px; }
    .gh-catalog #grid-view .action-buttons .compare::before { font-size: 20px; margin: 0; }
    .gh-catalog #grid-view .hover-area .added_to_cart { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 8px 2px; white-space: normal; font-size: 13px; line-height: 1.35; }
    /* Единый блок покупки. Нативные формы сохраняются, неподвижной второй
       кнопки поверх нижней панели не создаётся. */
    .single-product #content { padding-top: 16px; }
    .single-product #content .images-and-summary { display: flex; flex-direction: column; margin: 0; }
    /* На 768–991 px тема добавляет галерее offset 16,6% с !important.
       В одноколоночной компоновке этот desktop-offset больше не нужен. */
    .single-product #content .images-and-summary :is(.product-images,.summary) { width: 100% !important; float: none; margin: 0 !important; padding: 0 !important; }
    .single-product #content .images-and-summary .product-images { margin-bottom: 16px !important; }
    .single-product .woocommerce-product-gallery { width: 100% !important; margin: 0; }
    .single-product .woocommerce-product-gallery img { max-height: 240px; width: 100%; height: auto; object-fit: contain; }
    .single-product .summary h1 { font-size: 24px; line-height: 1.3; margin: 0 0 8px; }
    .single-product .summary .price { margin: 12px 0; }
    .single-product .summary form.cart { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
    .single-product .summary form.cart .quantity { margin: 0; }
    .single-product .summary form.cart .single_add_to_cart_button { min-height: 48px; margin: 0; flex: 1; }
    .single-product .summary form.variations_form > * { flex-basis: 100%; }
    .single-product .summary .product-action-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
    .single-product .product-action-buttons a { min-height: 44px; display: inline-flex; align-items: center; }
    .single-product .summary .woocommerce-product-details__short-description { font-size: 15px; line-height: 1.55; margin-top: 16px; }
    .single-product .summary .woocommerce-product-details__short-description h4 { font: inherit; }
    /* Нижняя навигация остаётся в стиле Контактов; резервируем её высоту. */
    body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .mc-handheld-footer-bar { padding-bottom: env(safe-area-inset-bottom); }
    a, button, input, select, summary { scroll-margin-top: 16px; scroll-margin-bottom: 90px; }
    summary:focus-visible { outline: 2px solid #315f16; outline-offset: 3px; }
}
