/* ================================================
   RED POINT — CATEGORY MENU
   ================================================
   The button and drawer shared by all three category strips: the Hero (home and the landing
   pages), Category Tabs (product page) and Category Hero (category archive).

   One stylesheet rather than three copies. Two rounds of this build were spent fixing the same
   bug twice because a strip had been duplicated instead of shared.

   Not in the Figma — the client asked for it once the real catalogue outgrew the design's
   eight-pill row.
   ================================================ */

.rp-catmenu {
	position: relative;
	flex-shrink: 0;
}

/* ------------------------------------------------
   THE STRIP IS TWO ITEMS, NOT NINE
   ------------------------------------------------
   The pills and the menu button used to be siblings in one wrapping flex row. That works only
   while everything fits on one line. It did at 1440px and at 1366px — which is why this looked
   fine for weeks — but the eight pills measure ~1155px and the button needs another 68px, and
   the hero's content box is only `viewport - 120px`. Below about 1340px the button was the item
   that wrapped: it left the strip, landed alone on a second line at the RTL row start (the
   right), and straddled the hero's bottom edge. The client read that as the hamburger being
   missing on desktop, and they were right — it was no longer in the strip.

   So the pills now sit in their own wrapper and THAT is what wraps. The button is a sibling of
   the set, which means no amount of pills can push it onto a line of its own: it stays on the
   strip, vertically centred, at the far left under RTL.

   `gap: inherit` rather than a number — each strip sets its own (16px, 12px at tablet), and the
   set has to keep whatever its row is using or the tablet override would be lost.
   `justify-content: inherit` for the same reason: the hero and category archive start their rows
   at the RTL right edge, the product page centres its chips.
   `min-width: 0` so the set is allowed to shrink and wrap internally instead of forcing the row
   wider than its container.

   THE TAG NAME IS IN THE SELECTOR ON PURPOSE — `.rp-hero nav.rp-hero__pills`, not
   `.rp-hero__pills`. The base rows declare `flex-wrap: wrap` in their own stylesheets at (0,1,0),
   this file is enqueued BEFORE those on some pages, and an equal-weight rule loses on load
   order. Shipped once without this and the fix silently did nothing on the live site: the row
   kept wrapping and the button kept dropping off it, exactly as before. (0,2,1) settles it. */
/* `:not(.rp-blogx__filter)` — THE BLOG BROWSER BORROWS THESE CLASS NAMES.
   Its post filter renders as `<nav class="rp-ctabs rp-blogx__filter">` with an `.rp-ctabs__list`
   inside, to inherit the chip styling. It is NOT a category strip: it has no menu button, and
   its chips filter posts rather than linking to product archives.

   Without this exclusion the rule below matched it at (0,2,1), beating the blog stylesheet's
   own `flex-wrap: wrap` at (0,2,0) — so its nine chips could no longer wrap and ran straight
   off the edge of the page. Same story for the phone rule further down, which hid the blog
   filter outright and left no way to filter posts on a phone. */
.rp-hero nav.rp-hero__pills,
.rp-ctabs:not(.rp-blogx__filter) div.rp-ctabs__list,
.rp-cathero nav.rp-cathero__chips {
	flex-wrap: nowrap;
}

.rp-strip__set {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: inherit;
	gap: inherit;
	min-width: 0;
}

/* Built to the same recipe as a pill — 40px tall, 100px radius, the same translucent ground —
   so it reads as part of the strip rather than a control bolted on beside it. The only
   difference is width: it holds three bars, not a label.

   The `.rp-catmenu` ancestor takes the selector to (0,2,0) so it beats Hello Elementor's
   `.elementor button` (0,1,1), which otherwise gives it a border, a fill and a padding box. */
.rp-catmenu .rp-catmenu__btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	width: 52px;
	height: 40px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 100px;
	background-color: rgba(37, 37, 37, 0.6);
	box-sizing: border-box;
	box-shadow: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.rp-catmenu .rp-catmenu__btn:hover {
	background-color: #252525;
	border-color: #FFFFFF;
}

.rp-catmenu .rp-catmenu__bar {
	display: block;
	width: 20px;
	height: 2px;
	flex-shrink: 0;
	border-radius: 2px;
	background-color: #FFFFFF;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.rp-catmenu .rp-catmenu__btn.is-open .rp-catmenu__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.rp-catmenu .rp-catmenu__btn.is-open .rp-catmenu__bar:nth-child(2) {
	opacity: 0;
}

.rp-catmenu .rp-catmenu__btn.is-open .rp-catmenu__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ------------------------------------------------
   THE DRAWER
   ------------------------------------------------
   `position: fixed`, for two reasons:

     1. Every strip sits inside a section with `overflow: hidden` (the hero for its media and
        scrims, the others for their own bands). An absolutely-positioned panel was clipped to
        a sliver whichever way it opened. Fixed positions against the viewport and escapes it.
     2. Full viewport height means the whole category list fits without a scrollbar.

   `left` is PHYSICAL on purpose. Under RTL the logical properties resolve to the RIGHT, and the
   drawer has to come from the left whatever the text direction. */
.rp-catmenu__panel {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 200;
	display: flex;
	flex-direction: column;
	/* Centred: the drawer is full height and the list falls well short of it, so anchored to the
	   top it reads as stranded in the corner. */
	justify-content: center;
	gap: 4px;
	width: min(86vw, 330px);
	padding: 28px 16px;
	box-sizing: border-box;
	border-inline-end: 1px solid rgba(255, 255, 255, 0.12);
	background-color: #0C0C0C;
	box-shadow: 20px 0 48px rgba(0, 0, 0, 0.6);

	/* overflow stays as a safety net for a very short viewport, without the scroll marker. */
	overflow-y: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;

	/* Closed: parked off-screen. visibility is delayed until the slide finishes so the links
	   cannot be tabbed into on the way out. */
	transform: translateX(-100%);
	visibility: hidden;
	transition: transform 0.28s ease, visibility 0s linear 0.28s;
}

.rp-catmenu__panel::-webkit-scrollbar {
	display: none;
}

/* The panel ships with `hidden` so it stays shut without JavaScript, and the script strips the
   attribute on init. But `display: flex` above is an author rule and `[hidden] {display:none}`
   is only a user-agent one, so the attribute loses — with JS off the drawer would sit open over
   the page. Same trap that kept the load-more button on screen after it was hidden. */
.rp-catmenu__panel[hidden] {
	display: none;
}

.rp-catmenu__panel.is-open {
	transform: translateX(0);
	visibility: visible;
	transition: transform 0.28s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
	.rp-catmenu__panel {
		transition: none;
	}
}

/* ================================================
   PHONES — THE STRIP IS GONE ENTIRELY
   ================================================
   "Everything should be here" — the client, pointing at the MOBILE HEADER's hamburger. On a
   phone the categories are listed inside that menu (see class-mobile-header-widget.php, which
   renders redpoint_menu_items() after the עלינו link), so a second category control in the hero
   is a duplicate of a menu already one tap away in the bar above it.

   This replaces two earlier rounds of phone rules — pills two-per-row, then pills hidden with
   the button stretched full width across the bottom. Both are gone rather than left inert:
   dead rules that contradict the current behaviour are how the three strips drifted apart in
   the first place.

   THE WHOLE ROW GOES, NOT ITS CONTENTS. Emptying a row leaves its padding behind — the hero's
   pill row carries 20px top and bottom, which would show as a 40px band of nothing where the
   strip used to be.

   THE ELEMENT NAME IS IN THE SELECTOR ON PURPOSE — `nav.rp-hero__pills`, not `.rp-hero__pills`.
   This file is enqueued BEFORE the widget stylesheets on some pages and after them on others,
   and the widget rules match at the same weight (0,2,0). Where hero.css happened to load last
   it won, which is exactly why the home page looked right and /sale/ did not, on identical
   markup and identical CSS. The tag name takes these to (0,2,1) so load order stops mattering.

   The product page's strip is the one exception worth knowing about: .rp-ctabs (the SECTION) is
   what clears the 132px mobile bar on that template, so only its list is hidden here and the
   section keeps its top padding. See redpoint-category-tabs.css.
   ================================================ */
@media (max-width: 767px) {

	/* `:not(.rp-blogx__filter)` again — see the note above. The blog's post filter has no
	   hamburger behind it, so hiding it here removed the only way to filter posts on a phone. */
	.rp-hero nav.rp-hero__pills,
	.rp-ctabs:not(.rp-blogx__filter) div.rp-ctabs__list,
	.rp-cathero nav.rp-cathero__chips {
		display: none;
	}
}

/* The category's own colour as a leading rule, so the list reads as the coloured set the pills
   are. (A dot was tried instead and reverted — the rule is the right treatment.) */
.rp-catmenu__link {
	display: block;
	padding: 12px 14px;
	border-radius: 10px;
	border-inline-start: 3px solid var(--rp-pill, #FF3B3B);
	font-family: 'Google Sans', sans-serif;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.2;
	color: #FFFFFF;
	text-decoration: none;
	white-space: nowrap;
}

/* DESKTOP IS UNCHANGED, deliberately.
   Above 767px the design's eight are the visible buttons in the strip, so listing them in the
   drawer as well would show the same eight twice. The drawer keeps only the categories the
   pills do not reach — exactly what it held before the phone work. Below 767px the pills are
   hidden and these become the drawer's first entries. */
@media (min-width: 768px) {
	.rp-catmenu__link--pill {
		display: none;
	}
}

.rp-catmenu__link:hover,
.rp-catmenu__link:focus-visible {
	background-color: #252525;
}

.rp-catmenu__link.is-active {
	background-color: var(--rp-pill, #FF3B3B);
	color: #0C0C0C;
	font-weight: 700;
}
