/**
 * Vyonika — Shop / Category Browser page
 * (glozin-child/page-shop-categories.php)
 *
 * v3 — fixes from review:
 *
 *   - THE BLACK BACKGROUND BUG, actually fixed this time. Root cause
 *     was more specific than "the theme overrides us": `all: unset`
 *     resets a property's VALUE, but not its !important flag — it has
 *     none. If the parent theme's own button rule (background-color:
 *     var(--gz-button-bg-color) on `button`) carries !important, that
 *     !important rule beats our plain unset regardless of specificity
 *     or load order, because !important always wins over a non-
 *     !important declaration, full stop. That's why the earlier
 *     `all: unset` pass didn't actually hold. Fixed by declaring
 *     `background-color`, `border`, `box-shadow`, `color` explicitly
 *     WITH !important on our own selectors (prefixed with #gzm-cb-page
 *     for extra specificity insurance), instead of relying on unset to
 *     do that work. We now fully own these properties — nothing here
 *     depends on Glozin's global button styling at all.
 *
 *   - Subcategory tiles: removed the up-right arrow entirely (moved to
 *     the "View all X" banner instead — see gzm_render_view_all_banner()
 *     in inc/gzm-delivery-date.php).
 *   - Subcategory tiles are no longer literally edge-to-edge: added
 *     breathing room via a larger grid gap + a small inset so the tile
 *     doesn't feel like a full-bleed poster.
 *   - Corner radius on subcategory tiles reduced (14px -> 10px) to
 *     match the smaller radius used elsewhere on the site instead of
 *     standing out.
 */

.gzm-cb-topbar {
	display: none;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid #EFEFEF;
	background: #fff;
	position: sticky;
	top: 0;
	z-index: 5;
}
.gzm-cb-topbar-title {
	font-size: 20px;
	font-weight: 700;
	color: #15171A;
	flex-shrink: 0;
	letter-spacing: -0.01em;
}

@media (max-width: 1024px) {
	.gzm-cb-topbar {
		display: flex;
	}
	#site-header {
		display: none !important;
	}
}

.gzm-cb-wrap {
	display: flex;
	min-height: 70vh;
}

/* ==========================================================
   LEFT RAIL — white background, hairline divider per item,
   active item = light red tint + wide left accent bar.

   Every selector below is prefixed with #gzm-cb-page and every
   color/background/border declaration carries !important — this
   is deliberate (see note at top of file), not defensive
   over-styling. We are fully overriding Glozin's global button
   styling on purpose, not resetting and hoping it sticks.
   ========================================================== */
#gzm-cb-page .gzm-cb-rail {
	width: 96px;
	flex-shrink: 0;
	background-color: #ffffff !important;
	border-right: 1px solid #EFEFEF;
	overflow-y: auto;
}
#gzm-cb-page .gzm-cb-rail-item {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	cursor: pointer;
	text-align: center;
	font-family: var(--gz-body-font, 'Instrument Sans', Arial, sans-serif);
	font-size: inherit;
	position: relative;
	padding: 12px 8px;
	background-color: transparent !important;
	background-image: none !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
	color: inherit !important;
	-webkit-appearance: none;
	appearance: none;
}
#gzm-cb-page .gzm-cb-rail-item:not(:last-child)::after {
	content: '';
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 0;
	height: 1px;
	background-color: #EFEFEF !important;
}
#gzm-cb-page .gzm-cb-rail-item::before {
	content: '';
	position: absolute;
	left: 0;
	top: 8px;
	bottom: 8px;
	width: 6px;
	border-radius: 0 4px 4px 0;
	background-color: transparent !important;
}
#gzm-cb-page .gzm-cb-rail-item.gzm-cb-active::before {
	background-color: var(--gz-color-primary, #d0473e) !important;
}
#gzm-cb-page .gzm-cb-rail-item-inner {
	border-radius: 10px;
	padding: 6px 4px 8px;
	background-color: transparent !important;
}
#gzm-cb-page .gzm-cb-rail-item.gzm-cb-active .gzm-cb-rail-item-inner {
	background-color: #FBEBEA !important; /* light tint of --gz-color-primary, NOT the theme's button color */
}
#gzm-cb-page .gzm-cb-rail-item img {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center;
	margin: 0 auto 6px;
	display: block;
}
#gzm-cb-page .gzm-cb-rail-item span {
	font-size: 11px;
	color: #6B6F76 !important;
	display: block;
	font-weight: 500;
	font-family: inherit;
}
#gzm-cb-page .gzm-cb-rail-item.gzm-cb-active span {
	color: #15171A !important;
	font-weight: 700;
}

/* ==========================================================
   RIGHT PANE
   ========================================================== */
.gzm-cb-grid-pane {
	flex: 1;
	padding: 14px 12px 24px;
	opacity: 1;
	transition: opacity 0.2s ease;
}
.gzm-cb-grid-pane.gzm-cb-loading {
	opacity: 0.4;
}

/* "View all X" banner — now carries the up-right arrow that used to
   sit on every subcategory tile. One clear call-to-action per screen
   instead of one on every tile. */
.gzm-cb-view-all-banner {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	aspect-ratio: 3 / 1.1;
	display: flex;
	align-items: flex-end;
	text-decoration: none;
	background-size: cover;
	background-position: center;
	background-color: #F1F2F4;
	margin-bottom: 18px;
	border: 1px solid #EFEFEF;
}
.gzm-cb-view-all-banner::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(17,17,17,0) 35%, rgba(17,17,17,0.68) 100%);
}
.gzm-cb-view-all-banner-content {
	position: relative;
	z-index: 1;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
}
.gzm-cb-view-all-banner-content span.gzm-cb-banner-title {
	color: #fff;
	font-size: 15px;
	font-weight: 700;
}
.gzm-cb-view-all-banner-content .gzm-cb-banner-arrow {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.gzm-cb-section-label {
	font-size: 12px;
	font-weight: 600;
	color: #6B6F76;
	text-transform: uppercase;
	letter-spacing: .04em;
	margin: 4px 0 10px;
}

/* ==========================================================
   SUBCATEGORY GRID — flat tiles, no arrow, no shadow, but no
   longer literally edge-to-edge either. Larger gap + smaller
   radius gives it breathing room without adding a card frame.
   ========================================================== */
.gzm-cb-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	align-content: start;
}
.gzm-cb-subcat {
	position: relative;
	display: block;
	text-decoration: none;
	aspect-ratio: 1 / 1;
	border-radius: 10px;
	overflow: hidden;
	background: #f1efe8;
}
.gzm-cb-subcat img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.gzm-cb-subcat::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 42%;
	background: linear-gradient(180deg, rgba(17,17,17,0) 0%, rgba(17,17,17,0.5) 100%);
	z-index: 1;
	pointer-events: none;
}
.gzm-cb-subcat-name {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 10px;
	z-index: 2;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
}
.gzm-cb-subcat-tag {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	padding: 3px 7px;
	border-radius: 5px;
	color: #fff;
}
.gzm-cb-subcat-tag.gzm-tag-new {
	background: #1E7B45;
}
.gzm-cb-subcat-tag.gzm-tag-sale {
	background: var(--gz-color-primary, #d0473e);
}

.gzm-cb-empty {
	grid-column: span 2;
	font-size: 13px;
	color: #6B6F76;
	text-align: center;
	margin-top: 4px;
}
