/*
Theme Name:   MAHE Store
Theme URI:    https://shop.maheest.com
Author:       Orinq
Description:  Enquiry-first WooCommerce catalogue theme for MAHE Hydraulic Solutions, Dammam. Modern industrial with a small traditional touch. Built to match the main maheest.com site.
Version:      1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain:  mahe-store
*/

/* ==========================================================================
   1. DESIGN TOKENS  (taken from the live maheest.vercel.app site)
   ========================================================================== */
:root {
	--red: #d33231;
	--red-dark: #b02625;
	--navy: #121738;
	--navy-deep: #0b0f2b;
	--navy-2: #2b357d;
	--mist: #dadeef;
	--mist-2: #b5bcdf;
	--paper: #f4f3f0;
	--sand: #e3ded7;
	--ink: #1d2036;
	--ink-2: #4b5066;
	--ink-3: #80838f;
	--white: #fff;
	--wa: #1faf5a;

	--line: rgba(18, 23, 56, 0.12);
	--line-dark: rgba(255, 255, 255, 0.14);
	--radius: 6px;
	--radius-lg: 10px;
	--container: 1240px;
	--font: "Manrope", "Noto Kufi Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

	/* Traditional touch: eight-point star lattice (khatam). */
	--star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpath d='M32 6 L39.62 13.62 L50.38 13.62 L50.38 24.38 L58 32 L50.38 39.62 L50.38 50.38 L39.62 50.38 L32 58 L24.38 50.38 L13.62 50.38 L13.62 39.62 L6 32 L13.62 24.38 L13.62 13.62 L24.38 13.62Z' fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='1'/%3E%3C/svg%3E");
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--white);
	-webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--navy); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--navy-2); outline-offset: 2px; border-radius: 3px; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 200; background: var(--navy); color: #fff; padding: .7rem 1rem; border-radius: var(--radius); }
.skip-link:focus { top: 1rem; color: #fff; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
[dir="rtl"] .icon--dir { transform: scaleX(-1); }

/* ==========================================================================
   3. TYPE + BUTTONS
   ========================================================================== */
.eyebrow {
	display: inline-flex; align-items: center; gap: .7rem;
	font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--red);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; }
.on-dark .eyebrow { color: #ff8f8e; }
.h-xl { font-size: clamp(2.3rem, 4.8vw, 3.9rem); line-height: 1.04; }
.h-lg { font-size: clamp(1.7rem, 2.8vw, 2.4rem); }
.lead { font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: var(--ink-2); max-width: 58ch; }
.on-dark .lead { color: var(--mist); }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
	min-height: 46px; padding: 0 1.25rem; border-radius: var(--radius);
	font-weight: 700; font-size: .94rem; line-height: 1; border: 1.5px solid transparent;
	transition: background .15s, color .15s, border-color .15s, transform .15s;
	white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-dark); color: #fff; }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-2); color: #fff; }
.btn--ghost { border-color: var(--line); color: var(--navy); background: #fff; }
.btn--ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn--outline-light { border-color: rgba(255,255,255,.4); color: #fff; }
.btn--outline-light:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }
.btn--white { background: #fff; color: var(--navy); }
.btn--white:hover { background: var(--paper); color: var(--red); }
.btn--sm { min-height: 38px; padding: 0 .95rem; font-size: .85rem; }

/* ==========================================================================
   4. HEADER
   ========================================================================== */
.utility { background: var(--navy-deep); color: var(--mist-2); font-size: .8rem; }
.utility__in { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 38px; }
.utility__group { display: flex; gap: 1.4rem; align-items: center; }
.utility a { display: inline-flex; align-items: center; gap: .45rem; color: var(--mist); }
.utility a:hover { color: #fff; }
.utility .icon { width: 1em; height: 1em; opacity: .8; }

.site-header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.site-header.is-scrolled { box-shadow: 0 8px 24px -14px rgba(18,23,56,.35); }
.site-header__in { display: flex; align-items: center; gap: 1.1rem; min-height: 74px; }

.brand { display: inline-flex; align-items: center; gap: .7rem; flex: none; }
.brand img, .brand .custom-logo { max-height: 46px; width: auto; }
.brand__mark { display: inline-grid; place-items: center; width: 42px; height: 42px; background: var(--red); color: #fff; font-weight: 800; letter-spacing: -.04em; border-radius: var(--radius); }
.brand__text { display: grid; line-height: 1; }
.brand__name { font-weight: 800; font-size: 1.28rem; letter-spacing: .02em; color: var(--navy); }
.brand__name span { color: var(--red); }
.brand__sub { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-top: .3rem; font-weight: 600; }

.mega-trigger { gap: .6rem; }
.mega-trigger[aria-expanded="true"] { background: var(--red); }
.hsearch { flex: 1; position: relative; min-width: 0; }
.hsearch input {
	width: 100%; height: 46px; padding-inline: 2.8rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius);
	font: inherit; font-size: .94rem; background: var(--paper); color: var(--ink);
}
.hsearch input:focus { outline: none; border-color: var(--navy-2); background: #fff; }
.hsearch .icon { position: absolute; inset-inline-start: .95rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.hnav { display: flex; gap: 1.2rem; align-items: center; font-weight: 600; font-size: .9rem; color: var(--ink); }
.hnav a { display: inline-flex; align-items: center; gap: .3rem; }
.hnav .icon { width: .85em; height: .85em; opacity: .5; }

/* Mega panel */
.mega { position: absolute; inset-inline: 0; top: 100%; background: #fff; border-bottom: 4px solid var(--red); box-shadow: 0 40px 60px -30px rgba(11,15,43,.45); }
.mega__in { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 2rem; padding-block: 2rem 2.2rem; max-height: min(70vh, 620px); overflow-y: auto; }
.mega__col h3 { font-size: .98rem; margin-bottom: .8rem; padding-bottom: .7rem; border-bottom: 2px solid var(--navy); display: flex; align-items: center; gap: .6rem; }
.mega__col h3 .icon { color: var(--red); }
.mega__col li a { display: block; padding: .32rem 0; font-size: .9rem; color: var(--ink-2); font-weight: 500; }
.mega__col li a:hover { color: var(--red); padding-inline-start: .3rem; }
.mega__all { margin-top: .6rem; display: inline-flex !important; align-items: center; gap: .4rem; color: var(--red) !important; font-weight: 700 !important; }

/* ==========================================================================
   5. HOME: HERO
   ========================================================================== */
.hero { position: relative; background: var(--navy); color: #fff; overflow: hidden; padding-block: clamp(3rem, 6.5vw, 5.5rem) clamp(6rem, 10vw, 8.5rem); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: var(--star); background-size: 64px 64px; mask-image: linear-gradient(100deg, transparent 5%, #000 55%, #000); -webkit-mask-image: linear-gradient(100deg, transparent 5%, #000 55%, #000); }
.hero::after { content: ""; position: absolute; width: 640px; height: 640px; inset-inline-end: -180px; top: -240px; background: radial-gradient(closest-side, rgba(211,50,49,.38), transparent); pointer-events: none; }
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { color: #fff; margin: 1.1rem 0 1.3rem; }
.hero h1 em { font-style: normal; box-shadow: inset 0 -.14em 0 var(--red); }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero__ar { font-weight: 700; letter-spacing: 0; }

.finder { background: var(--paper); color: var(--ink); border-radius: var(--radius-lg); border-top: 4px solid var(--red); padding: clamp(1.4rem, 2.5vw, 2rem); box-shadow: 0 40px 70px -30px rgba(0,0,0,.65); }
.finder h2 { font-size: 1.25rem; margin-bottom: .3rem; }
.finder p { color: var(--ink-2); font-size: .9rem; margin-bottom: 1rem; }
.finder__row { display: flex; gap: .5rem; }
.finder__row input { flex: 1; min-width: 0; height: 52px; padding-inline: 1rem; font: inherit; font-family: var(--mono); font-size: .92rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; }
.finder__row input:focus { outline: none; border-color: var(--navy-2); }
.finder__row .btn { height: 52px; }
.finder__label { margin: 1.3rem 0 .6rem; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-flex; align-items: center; padding: .38rem .8rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--navy); }
.chip:hover { border-color: var(--red); color: var(--red); }

/* Stat bar overlapping the hero */
.statbar { position: relative; z-index: 3; margin-top: -3.4rem; }
.statbar__in { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-radius: var(--radius-lg); box-shadow: 0 24px 50px -24px rgba(18,23,56,.4); border-top: 3px solid var(--navy); }
.stat { padding: 1.4rem 1.6rem; }
.stat + .stat { border-inline-start: 1px solid var(--line); }
.stat b { display: block; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; color: var(--navy); letter-spacing: -.03em; line-height: 1; }
.stat b sup { font-size: .5em; color: var(--red); margin-inline-start: .1em; top: -.6em; }
.stat span { display: block; margin-top: .5rem; font-size: .84rem; color: var(--ink-2); }

/* ==========================================================================
   6. HOME: SECTIONS
   ========================================================================== */
.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section--paper { background: var(--paper); }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2.2rem; }
.section__head h2 { margin-top: .7rem; }
.link-arrow { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--navy); }
.link-arrow:hover { color: var(--red); }

/* Category tiles */
.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.1rem; }
.cat { grid-column: span 2; position: relative; display: flex; flex-direction: column; gap: .9rem; padding: 1.6rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: transform .18s, border-color .18s, box-shadow .18s; overflow: hidden; }
.cat:nth-child(1), .cat:nth-child(2) { grid-column: span 3; }
.cat:hover { transform: translateY(-3px); border-color: var(--red); box-shadow: 0 22px 40px -26px rgba(18,23,56,.5); color: inherit; }
.cat__icon { width: 52px; height: 52px; display: grid; place-items: center; background: var(--navy); color: #fff; border-radius: var(--radius); }
.cat__icon .icon { width: 28px; height: 28px; }
.cat h3 { font-size: 1.3rem; }
.cat p { color: var(--ink-2); font-size: .92rem; margin: 0; }
.cat__count { font-size: .78rem; font-weight: 700; color: var(--red); letter-spacing: .04em; text-transform: uppercase; }
.cat .chips { margin-top: auto; padding-top: .4rem; }
.cat .chip { background: #fff; font-size: .76rem; padding: .28rem .65rem; }
.cat__go { position: absolute; inset-inline-end: 1.3rem; top: 1.4rem; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--navy); background: #fff; transition: .18s; }
.cat:hover .cat__go { background: var(--red); border-color: var(--red); color: #fff; }
.cat:nth-child(1) { background: var(--navy); border-color: var(--navy); color: #fff; background-image: var(--star); background-size: 64px 64px; }
.cat:nth-child(1) h3 { color: #fff; }
.cat:nth-child(1) p { color: var(--mist); }
.cat:nth-child(1) .cat__icon { background: var(--red); }
.cat:nth-child(1) .cat__count { color: #ff8f8e; }
.cat:nth-child(1) .chip { background: rgba(255,255,255,.08); border-color: var(--line-dark); color: #fff; }
.cat:nth-child(1) .cat__go { background: transparent; border-color: var(--line-dark); color: #fff; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; counter-reset: s; position: relative; }
.step { position: relative; padding-top: 1.2rem; border-top: 2px solid var(--navy); }
.step::before { counter-increment: s; content: "0" counter(s); display: block; font-size: 3.6rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--red); margin-bottom: 1rem; }
.step h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.step p { color: var(--ink-2); margin: 0; font-size: .95rem; }

/* Product cards (spec plate) */
.grid-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.pcard { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s; }
.pcard:hover { transform: translateY(-3px); border-color: var(--navy); box-shadow: 0 22px 40px -26px rgba(18,23,56,.55); }
.pcard__plate { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 168px; padding: 1rem 1.1rem; background: var(--mist); background-image: linear-gradient(135deg, rgba(255,255,255,.55) 0 1px, transparent 1px); background-size: 14px 14px; color: var(--navy); }
.pcard__plate::after { content: ""; position: absolute; inset-inline-end: -26px; bottom: -26px; width: 92px; height: 92px; background-image: var(--star); background-size: 92px 92px; filter: invert(1); opacity: .5; }
.pcard__brand { font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--navy-2); }
.pcard__main { font-weight: 800; font-size: clamp(1.1rem, 1.7vw, 1.4rem); line-height: 1.1; letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; position: relative; z-index: 1; }
.pcard__code { font-family: var(--mono); font-size: .78rem; font-weight: 600; color: var(--red-dark); position: relative; z-index: 1; }
.pcard__img { background: #fff; }
.pcard__img img { width: 100%; aspect-ratio: 4/3; object-fit: contain; padding: .7rem; }
.pcard__body { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem; flex: 1; }
.pcard__cat { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.pcard__title { font-size: 1rem; line-height: 1.25; letter-spacing: -.01em; }
.pcard__title a:hover { color: var(--red); }
.pcard__tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: 3px; background: var(--paper); color: var(--ink-2); }
.pcard__foot { margin-top: auto; padding-top: .8rem; display: flex; gap: .5rem; }
.pcard__foot .btn { flex: 1; }

/* Services strip */
.services { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.services::before { content: ""; position: absolute; inset: 0; background-image: var(--star); background-size: 64px 64px; mask-image: linear-gradient(270deg, #000, transparent 70%); -webkit-mask-image: linear-gradient(270deg, #000, transparent 70%); }
.services .container { position: relative; }
.services h2 { color: #fff; }
.svc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); border-radius: var(--radius-lg); overflow: hidden; margin-top: 2.2rem; }
.svc__item { background: var(--navy); padding: 1.9rem; display: flex; flex-direction: column; gap: .7rem; }
.svc__item .icon { width: 34px; height: 34px; color: #ff8f8e; }
.svc__big { font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: #fff; }
.svc__item h3 { color: #fff; font-size: 1.1rem; }
.svc__item p { color: var(--mist); font-size: .92rem; margin: 0; }
.svc__item a { margin-top: auto; padding-top: .8rem; display: inline-flex; align-items: center; gap: .45rem; color: #fff; font-weight: 700; font-size: .9rem; }
.svc__item a:hover { color: #ff8f8e; }

/* Brands + certification */
.brands { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.brandbox { display: grid; place-items: center; min-height: 92px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); }
.certs { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.cert { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border: 1.5px solid var(--navy); border-radius: 99px; font-size: .8rem; font-weight: 700; color: var(--navy); }
.cert .icon { width: 1em; height: 1em; color: var(--red); }

/* CTA band */
.cta { position: relative; background: var(--red); color: #fff; overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; background-image: var(--star); background-size: 64px 64px; opacity: .8; }
.cta__in { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; padding-block: clamp(2.6rem, 5vw, 4rem); }
.cta h2 { color: #fff; max-width: 22ch; }
.cta p { color: #ffe1e0; margin: .8rem 0 0; max-width: 52ch; }
.cta__btns { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.site-footer { background: var(--navy-deep); color: var(--mist-2); font-size: .92rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 2.5rem; padding-block: 4rem 3rem; }
.footer__brand p { margin-top: 1.1rem; max-width: 34ch; color: var(--mist-2); }
.site-footer .brand__name { color: #fff; }
.site-footer .brand__sub { color: var(--mist-2); }
.site-footer h3 { color: #fff; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 1.1rem; font-weight: 800; }
.site-footer li { margin-bottom: .55rem; }
.site-footer a:hover { color: #fff; }
.footer__contact li { display: flex; gap: .7rem; align-items: flex-start; }
.footer__contact .icon { margin-top: .2em; color: #ff8f8e; width: 1.1em; height: 1.1em; }
.footer__bar { border-top: 1px solid var(--line-dark); }
.footer__bar .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1.3rem; font-size: .82rem; }
.footer__bar nav { display: flex; gap: 1.4rem; }
.footer__note { padding-bottom: 1.6rem; font-size: .78rem; color: var(--ink-3); max-width: 90ch; }

.wa-float { position: fixed; inset-inline-end: 1.2rem; bottom: 1.2rem; z-index: 90; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--wa); color: #fff; box-shadow: 0 14px 30px -10px rgba(31,175,90,.7); transition: transform .15s; }
.wa-float:hover { transform: scale(1.07); color: #fff; }
.wa-float .icon { width: 28px; height: 28px; }

/* Generic content + WooCommerce containment (page templates are designed in later steps) */
.page-wrap { padding-block: 3rem 5rem; }
.page-wrap .entry-title { margin-bottom: 1.5rem; }

/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
	.hnav { display: none; }
	.grid-products { grid-template-columns: repeat(3, 1fr); }
	.footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
	.hero__grid { grid-template-columns: 1fr; }
	.statbar__in { grid-template-columns: repeat(2, 1fr); }
	.stat:nth-child(3) { border-inline-start: 0; }
	.stat:nth-child(n+3) { border-top: 1px solid var(--line); }
	.cats { grid-template-columns: 1fr; }
	.cat, .cat:nth-child(1), .cat:nth-child(2) { grid-column: auto; }
	.steps, .svc { grid-template-columns: 1fr; }
	.brands { grid-template-columns: repeat(2, 1fr); }
	.grid-products { grid-template-columns: repeat(2, 1fr); }
	.site-header__in { flex-wrap: wrap; padding-block: .8rem; min-height: 0; }
	.hsearch { order: 5; flex-basis: 100%; }
	.mega-trigger { margin-inline-start: auto; }
	.header-cta { display: none; }
	.utility__group--l { display: none; }
	.utility__in { justify-content: center; }
}
@media (max-width: 560px) {
	.grid-products, .footer__grid { grid-template-columns: 1fr; }
	.finder__row { flex-direction: column; }
	.finder__row .btn { width: 100%; }
	.brand__sub { display: none; }
	.cta h2 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   9. PRODUCTS PAGE (shop, category, tag, search)
   ========================================================================== */
.icon--flip { transform: scaleX(-1); }
[dir="rtl"] .icon--flip { transform: none; }

.shop-head { background: var(--paper); border-bottom: 1px solid var(--line); padding-block: 1.5rem 1.9rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; font-size: .8rem; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-inline-end: .4rem; opacity: .5; }
.crumbs a:hover { color: var(--red); }
.crumbs [aria-current] { color: var(--ink-2); font-weight: 600; }
.shop-head h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.shop-head p { margin: .6rem 0 0; max-width: 70ch; color: var(--ink-2); }

.shop { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 2.4rem; padding-block: 2.2rem 4.5rem; align-items: start; }

/* Sidebar */
.filters { position: sticky; top: 94px; max-height: calc(100vh - 112px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.filters__top { display: none; }
.filters__sec { padding: 1.2rem 1.3rem; border-bottom: 1px solid var(--line); }
.filters__sec:last-child { border-bottom: 0; }
.filters h2 { margin-bottom: .8rem; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); font-weight: 800; }
.tree ul { margin: .1rem 0 .45rem .35rem; padding-inline-start: .7rem; border-inline-start: 2px solid var(--line); }
.tree a { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; padding: .38rem .55rem; margin-inline: -.55rem; border-radius: 5px; font-size: .9rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.tree ul a { font-weight: 500; font-size: .86rem; color: var(--ink-2); }
.tree a:hover { background: var(--paper); color: var(--navy); }
.tree a.is-active, .tree ul a.is-active { background: var(--navy); color: #fff; font-weight: 700; }
.tree .n { flex: none; font-size: .74rem; font-weight: 600; opacity: .6; }
.check { display: flex; align-items: center; gap: .65rem; padding: .36rem 0; font-size: .9rem; font-weight: 600; color: var(--ink); }
.check i { position: relative; width: 18px; height: 18px; flex: none; border: 1.5px solid var(--ink-3); border-radius: 4px; background: #fff; }
.check.is-active i { background: var(--red); border-color: var(--red); }
.check.is-active i::after { content: ""; position: absolute; left: 4px; top: 2.5px; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.check .n { margin-inline-start: auto; font-size: .76rem; color: var(--ink-3); }
.check:hover { color: var(--red); }
.filters .chip.is-on, .activef .chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.filters .chip { font-size: .78rem; padding: .3rem .7rem; }
.filters__help { background: var(--navy); color: #fff; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.filters__help strong { display: block; margin-bottom: .3rem; }
.filters__help p { margin: 0 0 .9rem; font-size: .86rem; color: var(--mist); }

/* Toolbar */
.subcats { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.3rem; }
.subcats .chip { font-size: .84rem; padding: .45rem .9rem; }
.subcats small { margin-inline-start: .35rem; color: var(--ink-3); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1.1rem; margin-bottom: 1.3rem; border-bottom: 1px solid var(--line); }
.toolbar__l, .toolbar__ctl { display: flex; align-items: center; gap: .8rem; }
.toolbar__count { margin: 0; font-size: .92rem; color: var(--ink-2); }
.toolbar__count b { color: var(--navy); }
.btn-filters { display: none; }
.sortform { margin: 0; }
.select { height: 42px; padding-inline: .9rem 2.2rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--navy); background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); appearance: none; -webkit-appearance: none; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%23121738' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right .85rem center; }
[dir="rtl"] .select { background-position: left .85rem center; }
.select:focus { outline: none; border-color: var(--navy-2); }
.viewtoggle { display: flex; overflow: hidden; border: 1.5px solid var(--line); border-radius: var(--radius); }
.viewtoggle button { display: grid; place-items: center; width: 42px; height: 39px; border: 0; background: #fff; color: var(--ink-3); }
.viewtoggle button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.activef { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.2rem; }
.activef .chip .icon { width: .85em; height: .85em; margin-inline-start: .35rem; }
.activef .clear { margin-inline-start: .3rem; font-size: .84rem; font-weight: 700; color: var(--red); }

/* Product grid (catalogue cards) */
.grid-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.pcard--catalog .pcard__img { position: relative; background: #fff; border-bottom: 1px solid var(--line); }
.pcard--catalog .pcard__img img { aspect-ratio: 4 / 3; object-fit: contain; padding: .9rem; }
.pcard--catalog .pcard__plate { min-height: 190px; }
.pcard__badge { position: absolute; inset-block-start: .7rem; inset-inline-start: .7rem; z-index: 2; padding: .22rem .5rem; border-radius: 3px; background: var(--navy); color: #fff; font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.pcard__spec { margin: 0; font-size: .84rem; line-height: 1.35; color: var(--ink-2); }
.pcard__sku { font-family: var(--mono); font-size: .74rem; font-weight: 600; color: var(--red-dark); word-break: break-all; }
.pcard--catalog .pcard__title { font-size: .98rem; }

/* List view */
.grid-catalog.is-list { grid-template-columns: 1fr; }
.is-list .pcard { flex-direction: row; }
.is-list .pcard__link { flex: 0 0 230px; border-inline-end: 1px solid var(--line); }
.is-list .pcard__img { border-bottom: 0; height: 100%; display: grid; align-items: center; }
.is-list .pcard__plate { height: 100%; min-height: 150px; }
.is-list .pcard__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.2rem; align-content: center; }
.is-list .pcard__body > * { grid-column: 1; }
.is-list .pcard__foot { grid-column: 2; grid-row: 1 / span 5; align-self: center; margin: 0; padding: 0; flex-direction: column; min-width: 150px; }

/* Pagination */
.pager { margin-top: 2.4rem; }
.pager ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.pager a, .pager span { display: grid; place-items: center; min-width: 42px; height: 42px; padding-inline: .6rem; border: 1.5px solid var(--line); border-radius: var(--radius); font-size: .9rem; font-weight: 700; color: var(--navy); background: #fff; }
.pager a:hover { border-color: var(--navy); color: var(--navy); }
.pager .current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager .dots { border-color: transparent; background: transparent; }

.empty { padding: 4rem 1.5rem; text-align: center; border: 1.5px dashed var(--line); border-radius: var(--radius-lg); }
.empty h2 { font-size: 1.5rem; margin-bottom: .6rem; }
.empty p { color: var(--ink-2); margin-bottom: 1.4rem; }

.filters-overlay { position: fixed; inset: 0; z-index: 140; background: rgba(11, 15, 43, .55); }

@media (max-width: 1100px) {
	.grid-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.shop { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.btn-filters { display: inline-flex; }
	.filters { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 150; width: min(88vw, 340px); max-height: none; border-radius: 0; border: 0; transform: translateX(-104%); transition: transform .24s ease; }
	[dir="rtl"] .filters { transform: translateX(104%); }
	.filters.is-open { transform: none; }
	.filters__top { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
	.filters__close { display: grid; place-items: center; width: 38px; height: 38px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; }
	.filters__help { border-radius: 0; }
}
@media (max-width: 640px) {
	.grid-catalog { grid-template-columns: minmax(0, 1fr); }
	.toolbar__l { width: 100%; justify-content: space-between; }
	.is-list .pcard { flex-direction: column; }
	.is-list .pcard__link { flex: none; border-inline-end: 0; }
	.is-list .pcard__body { display: flex; }
	.is-list .pcard__foot { flex-direction: row; min-width: 0; padding-top: .8rem; }
}
