/* Step 4: opt-in shop/search and category presentation; existing controls own state. */
body.frefta-catalog {
    --primary: #b63e20; --primary-hover: #923019; --catalog-ink: #192f36;
    --catalog-muted: #58686b; --catalog-line: #e1e4dc; --catalog-soft: #fff0e9;
    --radius: 14px; --shadow: 0 4px 20px #192f3608;
    color: var(--catalog-ink); background: #faf8f5 !important;
}
body.frefta-catalog .shell { margin-bottom: 64px; }
body.frefta-catalog .shell :is(h1,h2,h3) { color: var(--catalog-ink); }
body.frefta-catalog .shell :is(.hero,.cat-hero) {
    background: #f0eee5; border: 1px solid var(--catalog-line); border-radius: 20px;
    box-shadow: none; padding: clamp(24px,4vw,48px); margin-top: 24px; margin-bottom: 24px;
}
body.frefta-catalog .shell :is(.hero,.cat-hero) h1 {
    font-size: clamp(1.9rem,3.8vw,3.3rem); letter-spacing: -.04em !important; line-height: 1.12;
}
body.frefta-catalog .shell :is(.hero,.cat-hero) p { color: var(--catalog-muted); font-size: .93rem; line-height: 1.7; }
body.frefta-catalog :is(.eyebrow,.category,.focused-children-label) { color: var(--primary); font-size: .7rem; letter-spacing: .09em; }
body.frefta-catalog .focused-hero-icon { background: #fff; color: var(--primary); box-shadow: none; border: 1px solid var(--catalog-line); border-radius: 14px; }
body.frefta-catalog :is(.focused-breadcrumb,.breadcrumb) { color: var(--catalog-muted); font-size: .8rem; }
body.frefta-catalog :is(.focused-breadcrumb,.breadcrumb) a { color: var(--primary); }
body.frefta-catalog .focused-children { border-top: 1px solid #192f3626; padding-top: 20px; }
body.frefta-catalog :is(.focused-pill,.focused-clear,.results-clear) {
    border: 1px solid var(--catalog-line); background: #fff; color: var(--catalog-ink);
    min-height: 44px; border-radius: 10px; font-size: .82rem; box-shadow: none; transform: none;
}
body.frefta-catalog .focused-pill:hover { background: #fff0e9; border-color: var(--primary); transform: none; }
body.frefta-catalog .filters {
    background: #fff; border: 1px solid var(--catalog-line); border-radius: 14px;
    box-shadow: none; padding: 20px; gap: 12px; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr) auto;
}
body.frefta-catalog .shell :is(input:not([type="hidden"]),select) {
    min-width: 0; max-width: 100%; min-height: 48px; padding: 12px 14px;
    border: 1px solid #718078; border-radius: 10px; background: #fff;
    color: var(--catalog-ink); font: inherit; font-size: .9rem;
}
body.frefta-catalog .shell input::placeholder { color: var(--catalog-muted); opacity: 1; }
body.frefta-catalog .shell :is(.btn,.actions a,.actions button,.card-icon-btn) {
    min-height: 44px; border-radius: 10px; padding: 12px 16px; font-size: .85rem;
    font-weight: 600; line-height: 1.35; box-shadow: none; transform: none;
    text-align: center; white-space: normal; text-decoration: none;
}
body.frefta-catalog .shell :is(.btn-primary,.filters .btn,.actions .primary) { background: var(--primary); color: #fff; border: 1px solid transparent; }
body.frefta-catalog .shell :is(.btn-primary,.filters .btn,.actions .primary):hover { background: var(--primary-hover); transform: none; }
body.frefta-catalog .shell :is(.btn-secondary,.btn-ghost,.actions .secondary) { background: #fff; color: var(--catalog-ink); border: 1px solid #718078; }
body.frefta-catalog .shell :is(.btn-secondary,.btn-ghost,.actions .secondary):hover { background: #f0eee5; transform: none; }
body.frefta-catalog .shell button:disabled { color: var(--catalog-muted); background: #eef0eb; opacity: 1; cursor: not-allowed; transform: none; box-shadow: none; }
body.frefta-catalog .results-head { margin: 32px 0 24px; align-items: center; flex-wrap: wrap; }
body.frefta-catalog :is(.results-head,.cat-canvas-head,.category-nav-head) p { color: var(--catalog-muted); font-size: .88rem; }
body.frefta-catalog .results-head h2 { font-size: clamp(1.25rem,2vw,1.6rem); }
body.frefta-catalog .product-grid { gap: 24px; }
body.frefta-catalog .product-grid.is-list { grid-template-columns: minmax(0,1fr) !important; }
body.frefta-catalog :is(.card,.child-card) {
    border: 1px solid var(--catalog-line); background: #fff; border-radius: 14px;
    box-shadow: none !important; transform: none; min-width: 0;
}
body.frefta-catalog :is(.card,.child-card):hover { border-color: #aab6ab; box-shadow: 0 8px 24px #192f360a !important; transform: none; }
body.frefta-catalog :is(.media,.child-card-media) { background: #f1f0eb !important; color: #718078; }
body.frefta-catalog .media > a { color: inherit; text-decoration: none; }
body.frefta-catalog :is(.media,.child-card-media) img { object-fit: contain; transform: none; }
body.frefta-catalog .product-grid :is(.body,.child-card-body) { padding: 20px; min-width: 0; }
body.frefta-catalog .product-grid :is(.title,.child-card-name) {
    font-size: .95rem; font-weight: 500; line-height: 1.45; color: var(--catalog-ink);
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2 !important;
    min-height: 0; max-height: 2.9em !important; overflow: hidden; overflow-wrap: anywhere;
}
body.frefta-catalog :is(.price-row,.child-card-count) { flex-wrap: wrap; gap: 6px 10px; }
body.frefta-catalog .price-row { margin-top: 12px; align-items: baseline; }
body.frefta-catalog :is(.price-row,.child-card-count) strong { font-size: 1.05rem; font-weight: 650; color: var(--catalog-ink); font-variant-numeric: tabular-nums; }
body.frefta-catalog .price-row > span { color: var(--catalog-muted); font-size: .82rem; }
body.frefta-catalog :is(.actions,.card-action-row) { gap: 8px; padding-top: 20px; margin-top: auto; }
body.frefta-catalog .product-grid :is(.actions a,.actions button,.card-action-row .btn) { padding: 12px 8px; min-width: 0; font-size: .8rem; }
body.frefta-catalog .wish { width: 44px; height: 44px; border: 1px solid var(--catalog-line); box-shadow: none; background: #fff; }
body.frefta-catalog .card-icon-btn { width: 44px; height: 44px; flex: 0 0 44px; padding: 0 !important; border-color: var(--catalog-line); background: #fff; color: var(--primary); }
body.frefta-catalog .card-icon-btn[aria-pressed="true"], body.frefta-catalog .wish[aria-pressed="true"] { background: #fff0e9 !important; color: var(--primary); border-color: var(--primary); }
body.frefta-catalog .badge { background: #fff0e9; color: var(--primary); font-size: .68rem; font-weight: 600; padding: 5px 9px; }
body.frefta-catalog .badge.discount-badge { background: #192f36; color: #fff; }
body.frefta-catalog .shell > div:has(> a[title^="Show only"]),
body.frefta-catalog .shell > div:has(> a[title^="Keep only"]) { row-gap: 8px !important; }
body.frefta-catalog .shell a[title^="Show only"],
body.frefta-catalog .shell a[title^="Keep only"],
body.frefta-catalog .shell a[title^="Remove color"],
body.frefta-catalog .shell a[title^="Remove size"] { min-height: 44px; padding: 8px 12px !important; }
body.frefta-catalog .stock { font-size: .8rem; line-height: 1.5; }
body.frefta-catalog :is(.empty,.cat-empty) { border: 1px solid var(--catalog-line); border-radius: 20px; background: #fff; box-shadow: none; padding: 40px 24px; }
body.frefta-catalog :is(.empty,.cat-empty) p { color: var(--catalog-muted); line-height: 1.75; }
body.frefta-catalog .cat-stats { gap: 8px; margin-top: 20px; }
body.frefta-catalog .cat-stats .pill { background: #fff; border: 1px solid var(--catalog-line); color: var(--catalog-muted); font-weight: 500; padding: 6px 12px; }
body.frefta-catalog .category-nav-section { padding: 24px; border: 1px solid var(--catalog-line); border-radius: 20px; box-shadow: none; background: #fff; margin-bottom: 32px; }
body.frefta-catalog .category-nav-head { gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
body.frefta-catalog .category-nav-row .child-card-body { padding: 16px; }
body.frefta-catalog .category-nav-row .child-card-name { font-weight: 600; line-height: 1.45; }
body.frefta-catalog .category-nav-row.is-carousel .child-card { flex: 0 0 180px; }
body.frefta-catalog .category-nav-row .child-card-cta .btn { font-size: .78rem; min-height: 44px; padding: 10px; }
body.frefta-catalog .catalog-layout { gap: 24px; }
body.frefta-catalog .cat-filter-bar { border: 1px solid var(--catalog-line); border-radius: 14px; background: #fff; box-shadow: none; padding: 20px; position: static !important; }
body.frefta-catalog .cat-filter-bar form { gap: 12px; min-width: 0; }
body.frefta-catalog .cat-filter-bar :is(select,input) { width: 100%; }
body.frefta-catalog .catalog-results { gap: 24px; }
body.frefta-catalog .cat-canvas-head { align-items: center; }
body.frefta-catalog .pagination { margin-top: 8px; gap: 8px; }
body.frefta-catalog .pagination :is(a,span) { min-width: 44px; min-height: 44px; border-radius: 10px; border-color: var(--catalog-line); font-weight: 500; }
body.frefta-catalog .pagination .active { background: var(--catalog-ink); border-color: var(--catalog-ink); color: #fff; }
body.frefta-catalog .pagination a:hover { border-color: var(--primary); color: var(--primary); }
body.frefta-catalog .shell :is(a,button,input,select):focus-visible { outline: 3px solid #1d677e; outline-offset: 3px; }
@media (max-width: 1040px) {
    body.frefta-catalog .catalog-layout:is(.is-filter-left,.is-filter-right) .product-grid:not(.is-list) { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 899px) {
    body.frefta-catalog .cat-filter-bar form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 860px) {
    body.frefta-catalog .filters { display: none; grid-template-columns: minmax(0,1fr); }
    body.frefta-catalog .filters.open { display: grid; padding: 16px; }
    body.frefta-catalog .filter-toggle { border: 1px solid #718078; min-height: 48px; padding: 12px 16px; border-radius: 10px; background: #fff; }
    body.frefta-catalog .filters :is(input,select,.btn) { font-size: 16px !important; border-radius: 10px !important; }
    body.frefta-catalog .results-head { margin-top: 24px; }
    body.frefta-catalog .product-grid { gap: 16px !important; }
}
@media (max-width: 520px) {
    body.frefta-catalog .shell :is(.hero,.cat-hero) { padding: 24px; border-radius: 14px; margin-top: 16px; }
    body.frefta-catalog .shell :is(.hero,.cat-hero) h1 { font-size: 1.9rem; }
    body.frefta-catalog .focused-hero-main { grid-template-columns: minmax(0,1fr); gap: 16px; }
    body.frefta-catalog .focused-hero-icon { width: 56px; height: 56px; font-size: 1.8rem; }
    body.frefta-catalog .product-grid { gap: 12px !important; }
    body.frefta-catalog .product-grid :is(.body,.child-card-body) { padding: 12px !important; }
    body.frefta-catalog .product-grid :is(.title,.child-card-name) { font-size: .86rem; }
    body.frefta-catalog .product-grid :is(.actions,.card-action-row) { flex-wrap: wrap; padding-top: 16px; }
    body.frefta-catalog .product-grid .actions { flex-direction: column; }
    body.frefta-catalog .card-action-row > .btn { flex-basis: 100%; }
    body.frefta-catalog .category-nav-section { padding: 16px; border-radius: 14px; }
    body.frefta-catalog .category-nav-row.is-carousel .child-card { flex-basis: 156px; }
    body.frefta-catalog .cat-filter-bar { padding: 16px; }
    body.frefta-catalog .cat-filter-bar form { grid-template-columns: minmax(0,1fr); }
    body.frefta-catalog .shell :is(input:not([type="hidden"]),select) { font-size: 16px; }
    body.frefta-catalog .product-grid.is-list .child-card { grid-template-columns: minmax(96px,35%) minmax(0,1fr); }
    body.frefta-catalog .product-grid.is-list .child-card-media { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
    body.frefta-catalog .shell :is(a,button,img,.card,.child-card) { transition: none !important; }
}
