/* Catalog-only layer. Desktop keeps its original grid and sidebar. */
.petal-shop-mobile-title,
.petal-category-rail,
.petal-filter-trigger { display: none; }
.petal-filter-dialog:not([open]) { display: none; }
.petal-filter-submit > a { display: inline-block; margin-block: 12px; font-size: 12px; text-decoration: underline; }
.petal-active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 0 20px; }
.petal-active-filters a { display: inline-flex; gap: 10px; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: var(--green); }
.petal-active-filters a span:first-child { overflow-wrap: anywhere; }
.petal-active-filters .petal-clear-filters { border-color: transparent; text-decoration: underline; }
.petal-empty-help { color: var(--ink); margin-block: 16px 40px; }

@media (max-width: 767px) {
    .petal-catalog .shop-main { padding-block: 22px 56px; }
    .petal-catalog .shop-heading { display: block; padding: 0; margin-block: 0 16px; border: 0; }
    .petal-catalog .shop-heading .eyebrow,
    .petal-catalog .shop-heading p:not(.eyebrow),
    .petal-shop-desktop-title { display: none; }
    .petal-shop-mobile-title { display: inline; }
    .petal-catalog .shop-heading h1 { margin: 0 0 18px; font-size: clamp(28px, 7vw, 34px); line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
    .petal-catalog.rtl .shop-heading h1 { letter-spacing: 0; line-height: 1.5; }
    .petal-catalog .shop-heading .petal-search { width: 100%; margin: 0; min-height: 52px; border: 1px solid #d6dccc; background: #fff; border-radius: 12px; padding: 0; padding-inline-end: 4px; }
    .petal-catalog .shop-heading .petal-search input { min-width: 0; font-size: 16px; padding: 14px; }
    .petal-catalog .shop-heading .petal-search button { min-width: 48px; min-height: 48px; color: var(--green); }
    .petal-category-rail { display: flex; gap: 8px; overflow-x: auto; padding-block: 2px 10px; margin-block-end: 8px; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: #cad2bc transparent; }
    .petal-category-rail a { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; min-height: 44px; padding: 9px 14px; border: 1px solid #d6dccc; border-radius: 8px; font-size: 13px; font-weight: 500; color: #46533c; background: #fff; }
    .petal-category-rail a[aria-current] { background: var(--green); border-color: var(--green); color: white; }
    .petal-catalog .catalog-layout { display: block; }
    .petal-catalog .shop-sidebar { margin-block-end: 18px; }
    .petal-filters-enhanced .shop-sidebar { display: none; }
    .petal-catalog .catalog-products { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); column-gap: 10px; align-items: start; }
    .petal-catalog .catalog-products > * { grid-column: 1 / -1; min-width: 0; }
    .petal-catalog .catalog-products > .woocommerce-notices-wrapper { order: -4; }
    .petal-catalog .catalog-products > .woocommerce-result-count { order: -3; float: none; max-width: none; margin: 0 0 12px; color: #58624f; font-size: 12px; }
    .petal-filters-enhanced .petal-filter-trigger { display: flex; grid-column: 1; order: -2; align-items: center; justify-content: center; gap: 8px; min-height: 48px; width: 100%; margin-block-end: 20px; padding: 10px; background: #fff; color: var(--green); border: 1px solid #ccd4c1; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
    .petal-filter-count { display: inline-grid; place-items: center; background: var(--green); color: white; min-width: 20px; min-height: 20px; border-radius: 50%; font-size: 11px; }
    .petal-catalog .catalog-products > .woocommerce-ordering { grid-column: 1 / -1; order: -1; float: none; width: 100%; max-width: none; margin: 0 0 20px; }
    .petal-filters-enhanced .catalog-products > .woocommerce-ordering { grid-column: 2; order: -2; }
    .petal-catalog .woocommerce-ordering select { width: 100%; min-height: 48px; border-radius: 10px; padding: 10px 8px; background: transparent; font-size: 16px; color: var(--ink); border-color: #ccd4c1; text-overflow: ellipsis; }
    .petal-catalog .catalog-products ul.products { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 18px 12px !important; margin: 0; }
    .petal-catalog ul.products li.product { display: flex; flex-direction: column; width: 100% !important; margin: 0 !important; padding: 0 0 12px; overflow: hidden; border: 1px solid #e1e5d8; border-radius: 14px; background: #fff; }
    .petal-catalog ul.products li.product .woocommerce-LoopProduct-link { display: flex; flex-direction: column; flex: 1; min-width: 0; }
    .petal-catalog ul.products li.product a img { aspect-ratio: 1 / 1.12; width: 100%; height: auto; object-fit: contain; padding: 8px; margin: 0 0 12px; border-radius: 0; background: #f3f3eb; }
    .petal-catalog ul.products li.product .woocommerce-loop-product__title { min-height: 3.1em; margin: 0 12px 6px; padding: 0; font-size: 14px; line-height: 1.55; font-weight: 600; overflow-wrap: anywhere; }
    .petal-catalog ul.products li.product .petal-rating { margin: auto 12px 8px; font-size: 10px; color: #58624f; }
    .petal-catalog ul.products li.product .petal-rating > span { display: none; }
    .petal-catalog ul.products li.product .star-rating { margin-inline: 12px; }
    .petal-catalog ul.products li.product .price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; margin: 0 12px 12px; font-size: 15px; line-height: 1.5; color: var(--green); }
    .petal-catalog ul.products li.product .price del { font-size: 11px; color: #68725f; opacity: 1; }
    .petal-catalog ul.products li.product .price ins { text-decoration: none; }
    .petal-catalog ul.products li.product > .button { display: flex; align-items: center; justify-content: center; align-self: stretch; width: auto; min-height: 44px; margin: 0 10px; padding: 10px 6px; border-radius: 8px; background: var(--green); border-color: var(--green); color: #fff; font-size: 12px; line-height: 1.5; }
    .petal-catalog ul.products li.product > .button.loading { opacity: .65; }
    .petal-catalog ul.products li.product > .added_to_cart { display: block; text-align: center; min-height: 44px; margin: 6px 10px 0; padding: 10px 3px; font-size: 12px; }
    .petal-catalog ul.products li.product .onsale { inset-inline-start: 8px; top: 8px; font-size: 10px; }
    .petal-catalog .woocommerce-pagination { margin-block-start: 28px; }
    .petal-catalog .woocommerce-info { font-size: 14px; }
    .petal-catalog .petal-empty-help { font-size: 14px; line-height: 1.8; }
    .petal-active-filters { margin-block: 0 16px; }
    .petal-active-filters a { font-size: 12px; max-width: 100%; background: #edf1e6; }
    .petal-active-filters .petal-clear-filters { background: transparent; }
    .petal-filter-open { overflow: hidden; }
    .petal-filter-dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: 600px; max-height: 88vh; max-height: 88dvh; margin: 0 auto; padding: 0; border: 0; border-radius: 24px 24px 0 0; background: #fffdf8; color: var(--ink); overscroll-behavior: contain; }
    .petal-filter-dialog::backdrop { background: rgb(22 37 20 / .45); }
    .petal-filter-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 2; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fffdf8; }
    .petal-filter-header h2 { margin: 0; font-size: 21px; letter-spacing: 0; }
    .petal-filter-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; font-size: 26px; cursor: pointer; }
    .petal-filter-body { padding: 0 20px; }
    .petal-filter-body h3 { font-size: 15px; letter-spacing: 0; margin: 24px 0 12px; }
    .petal-filter-body ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
    .petal-filter-body li a { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; height: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; line-height: 1.6; color: #46533c; overflow-wrap: anywhere; }
    .petal-filter-body li a[aria-current] { background: #e9eedf; border-color: #8b9c78; font-weight: 600; }
    .petal-filter-body li span { font-size: 11px; }
    .petal-filter-body .price-fields label { color: #46533c; font-size: 13px; }
    .petal-filter-body .price-fields input { min-height: 48px; font-size: 16px; padding: 10px 12px; border-radius: 8px; }
    .petal-filter-body .consent { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-block: 16px; font-size: 14px; color: #46533c; }
    .petal-filter-body .consent input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--green); }
    .petal-filter-submit { display: flex; align-items: center; gap: 16px; }
    .petal-filter-body .petal-filter-submit { position: sticky; bottom: 0; margin-inline: -20px; padding: 16px 20px max(16px, env(safe-area-inset-bottom)); background: #fffdf8; border-top: 1px solid var(--line); }
    .petal-filter-submit > a { font-size: 13px; min-height: 44px; display: flex; align-items: center; margin: 0; color: var(--green); }
    .petal-filter-submit .button { flex: 1; min-height: 48px; padding: 12px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
    .petal-catalog :is(a, button, input, select):focus-visible,
    .petal-filter-dialog :is(a, button, input):focus-visible { outline: 2px solid #456332; outline-offset: 3px; }
    .petal-filter-trigger:active,
    .petal-catalog ul.products li.product > .button:active { transform: translateY(1px); }
}

@media (prefers-reduced-motion: reduce) {
    .petal-catalog *, .petal-filter-dialog * { scroll-behavior: auto !important; transition: none !important; }
}
