/* ==========================================================================
   OC Cars – Shop category bar + product search (sits under the main menu)
   ========================================================================== */

.occ-bar {
	--ob-navy: #1c507e;
	--ob-ink: #13212f;
	--ob-muted: #5a6876;
	--ob-line: #e2e8ee;
	--ob-soft: #f3f6f9;
	position: relative;
	z-index: 400;
	background: #fff;
	border-top: 1px solid var(--ob-line);
	border-bottom: 1px solid var(--ob-line);
	box-shadow: 0 2px 10px rgba(16, 32, 48, .04);
	font-size: 15px;
	line-height: 1.3;
	color: var(--ob-ink);
}
.occ-bar *, .occ-bar *::before, .occ-bar *::after { box-sizing: border-box; }
.occ-bar ul { list-style: none; margin: 0; padding: 0; }
.occ-bar a,
.occ-bar a:hover,
.occ-bar a:focus,
.occ-bar a:visited,
.occ-bar a * { text-decoration: none !important; border-bottom: 0 !important; box-shadow: none !important; }
.occ-bar svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.occ-bar__inner {
	max-width: calc(var(--site_width, 1240px) + 32px);
	margin: 0 auto;
	padding: 0 16px;
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 60px;
	position: relative;
}

/* Sticky state (set by JS when scrolled past) */
.occ-bar.is-stuck {
	position: fixed; left: 0; right: 0; z-index: 9990;
	border-top-color: transparent;
	box-shadow: 0 6px 18px rgba(16, 32, 48, .10);
	animation: occBarIn .2s ease-out;
}
.occ-bar.is-stuck .occ-bar__inner { min-height: 54px; }
@keyframes occBarIn { from { transform: translateY(-8px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------- Menu ---------- */
.occ-bar__menu { display: flex; align-items: stretch; gap: 4px; flex: 1; min-width: 0; align-self: stretch; }
.occ-bar__item { position: relative; display: flex; }
.occ-bar__link {
	position: relative;
	display: inline-flex; align-items: center; gap: 5px;
	padding: 0 12px;
	font-weight: 700; font-size: 15px; white-space: nowrap;
	color: var(--ob-ink) !important;
	transition: color .15s;
}
.occ-bar__link::after {
	content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px;
	border-radius: 3px 3px 0 0; background: var(--ob-navy);
	transform: scaleX(0); transition: transform .2s;
}
.occ-bar__link:hover, .occ-bar__item:focus-within > .occ-bar__link { color: var(--ob-navy) !important; }
.occ-bar__item.is-active > .occ-bar__link { color: var(--ob-navy) !important; }
.occ-bar__item.is-active > .occ-bar__link::after,
.occ-bar__link:hover::after { transform: scaleX(1); }
.occ-bar__chev { width: 13px !important; height: 13px !important; opacity: .6; transition: transform .2s; }
.occ-bar__item:hover .occ-bar__chev, .occ-bar__item:focus-within .occ-bar__chev { transform: rotate(180deg); }

/* Mega menu – full-width panel of image tiles */
.occ-bar__item.has-sub { position: static; }
.occ-bar__mega {
	position: absolute; top: 100%; left: 16px; right: 16px;
	margin-top: 1px;
	padding: 22px 24px 18px;
	background: #fff; border: 1px solid var(--ob-line); border-top: 0;
	border-radius: 0 0 14px 14px;
	box-shadow: 0 22px 44px rgba(16, 32, 48, .14);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .15s ease .12s, transform .15s ease .12s, visibility 0s linear .27s;
}
.occ-bar__item:hover > .occ-bar__mega,
.occ-bar__item:focus-within > .occ-bar__mega {
	opacity: 1; visibility: visible; transform: none;
	transition-delay: .08s, .08s, 0s;
}
.occ-bar__tiles { display: grid !important; grid-template-columns: repeat(var(--occ-cols, 5), minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .occ-bar__tiles { grid-template-columns: repeat(min(var(--occ-cols, 5), 4), minmax(0, 1fr)); } }
.occ-bar__tile {
	display: flex; flex-direction: column; align-items: center; gap: 10px;
	padding: 14px 12px 12px; border-radius: 12px; border: 1px solid transparent;
	color: var(--ob-navy) !important; text-align: center;
	transition: background .15s, border-color .15s, transform .15s;
}
.occ-bar__tile:hover, .occ-bar__tile:focus-visible, .occ-bar__tile.is-active {
	background: var(--ob-soft); border-color: var(--ob-line); transform: translateY(-2px);
}
.occ-bar__tile-name { font-weight: 700; font-size: 15px; line-height: 1.3; min-height: calc(2 * 1.3em + 18px); display: flex; flex-direction: column; justify-content: flex-end; }
.occ-bar__tile-name small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--ob-muted); }
.occ-bar__tile-img { width: 100%; max-width: 230px; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.occ-bar__tile-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; transition: transform .25s; }
.occ-bar__tile:hover .occ-bar__tile-img img { transform: scale(1.05); }
.occ-bar__mega-foot { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ob-line); }
.occ-bar__mega-foot a { font-weight: 700; font-size: 14.5px; color: var(--ob-navy) !important; }
.occ-bar__mega-foot a:hover { color: #163f63 !important; }

/* ---------- Search ---------- */
.occ-bar__search { position: relative; flex: 0 1 320px; min-width: 220px; margin: 0; }
.occ-bar__field {
	display: flex; align-items: center; gap: 8px;
	height: 42px; padding: 0 6px 0 14px;
	background: var(--ob-soft); border: 1px solid var(--ob-line); border-radius: 999px;
	transition: border-color .15s, background .15s, box-shadow .15s;
}
.occ-bar__field:focus-within { background: #fff; border-color: var(--ob-navy); box-shadow: 0 0 0 3px rgba(28, 80, 126, .12); }
.occ-bar__field > svg { color: var(--ob-muted); }
.occ-bar__search input[type=search] {
	flex: 1; min-width: 0; height: 40px !important; margin: 0 !important; padding: 0 !important;
	border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none;
	font-size: 15px !important; color: var(--ob-ink) !important;
}
.occ-bar__search input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.occ-bar__go {
	display: inline-flex; align-items: center; justify-content: center;
	height: 32px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
	background: var(--ob-navy); color: #fff; font-weight: 700; font-size: 13.5px;
}
.occ-bar__go:hover { background: #163f63; }

/* Suggestions */
.occ-bar__results {
	position: absolute; top: calc(100% + 8px); right: 0; width: min(420px, calc(100vw - 32px));
	background: #fff; border: 1px solid var(--ob-line); border-radius: 14px;
	box-shadow: 0 18px 44px rgba(16, 32, 48, .16); overflow: hidden;
}
.occ-bar__results[hidden] { display: none; }
.occ-bar__result {
	display: flex; align-items: center; gap: 12px; padding: 10px 14px;
	color: var(--ob-ink) !important; border-bottom: 1px solid var(--ob-line);
}
.occ-bar__result:hover, .occ-bar__result.is-focus { background: var(--ob-soft); }
.occ-bar__result img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--ob-line); flex: none; }
.occ-bar__result span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.occ-bar__result b { font-weight: 600; font-size: 14.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.occ-bar__result em { font-style: normal; font-weight: 700; color: var(--ob-navy); font-size: 14px; }
.occ-bar__result em del { color: var(--ob-muted); font-weight: 500; margin-left: 6px; }
.occ-bar__all, .occ-bar__empty { display: block; padding: 12px 14px; font-size: 14px; font-weight: 700; color: var(--ob-navy) !important; background: #fff; }
.occ-bar__all:hover, .occ-bar__all.is-focus { background: var(--ob-soft); }
.occ-bar__empty { color: var(--ob-muted) !important; font-weight: 500; }

/* ---------- Tablet / mobile ---------- */
@media (max-width: 1100px) {
	.occ-bar__link { padding: 0 9px; font-size: 14.5px; }
	.occ-bar__link::after { left: 9px; right: 9px; }
	.occ-bar__search { flex-basis: 260px; }
}
@media (max-width: 900px) {
	.occ-bar__inner { flex-direction: column; align-items: stretch; gap: 0; padding: 12px 0 0; min-height: 0; }
	.occ-bar__search { order: -1; flex: none; min-width: 0; margin: 0 16px 6px; }
	.occ-bar__results { left: 0; right: 0; width: auto; }
	.occ-bar__menu {
		overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none;
		padding: 0 8px; gap: 0; min-height: 48px;
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
		        mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
	}
	.occ-bar__menu::-webkit-scrollbar { display: none; }
	.occ-bar__link { padding: 0 10px; min-height: 48px; }
	.occ-bar__chev, .occ-bar__mega { display: none !important; }
	.occ-bar__menu > li:last-child { padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.occ-bar *, .occ-bar *::before, .occ-bar *::after { transition: none !important; }
}
