/* Homepage-specific tweaks layered on top of fang.css */

.home-products { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
@media (max-width: 1100px) { .home-products { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .home-products { grid-template-columns: repeat(2, 1fr); } }

.home-products-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1100px) { .home-products-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .home-products-4 { grid-template-columns: 1fr; } }

/* ============================================================
 * Choose Your Arsenal — 2x2 diagonal-cut category grid.
 * ============================================================ */

.sec-categories .cat-grid {
	position: relative;
	width: 100%;
	/* Padding-top establishes the grid height as a fixed % of its width. This
	   is more reliable than `aspect-ratio` for propagating a real pixel height
	   into absolutely-positioned children (the children then correctly size to
	   the grid via inset:0 + percent clip-paths). 52.5% = 1.05 / 2 * 100. */
	padding-top: 52.5%;
	margin-top: 36px;
	background: var(--bone, #f4f1ea);
	overflow: hidden;
}

.sec-categories .cat-tile {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	/* fang.css has a legacy .cat-tile rule with aspect-ratio:4/5 from an old
	   product-card component. Force it OFF here or the tiles size to 4:5 and
	   the bottom row falls outside the grid. */
	aspect-ratio: auto !important;
	height: auto !important;
	display: block;
	text-decoration: none;
	color: #f4f1ea;
	background-color: #0a0a0a;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: filter 0.35s ease, transform 0.35s ease;
	overflow: hidden;
}

.sec-categories .cat-tile::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(0,0,0,0) 0%,
		rgba(0,0,0,0.15) 50%,
		rgba(0,0,0,0.78) 100%
	);
	pointer-events: none;
	z-index: 1;
}

.sec-categories .cat-tile:hover { filter: brightness(1.18) contrast(1.05); }
.sec-categories .cat-tile:focus-visible { outline: 2px solid var(--red, #B22234); outline-offset: -8px; }

/* Quadrilateral clip-paths. Small offset around the shared seams so a thin
   bone gap shows through, matching the reference layout. Top row diagonals
   slope right-down, bottom row diagonals slope left-down; both give a
   consistent 2% gap between adjacent tiles. */
.sec-categories .cat-tile-tl { clip-path: polygon(0 0, 46% 0, 52% 49%, 0 49%); }
.sec-categories .cat-tile-tr { clip-path: polygon(48% 0, 100% 0, 100% 49%, 54% 49%); }
.sec-categories .cat-tile-bl { clip-path: polygon(0 51%, 54% 51%, 48% 100%, 0 100%); }
.sec-categories .cat-tile-br { clip-path: polygon(56% 51%, 100% 51%, 100% 100%, 50% 100%); }

/* Per-tile background-position so each photo's focal point lands inside the
   visible clip quadrant instead of being cropped to a corner. Tiles are
   inset:0 across the whole grid; without this offset, "background-position:
   center" puts the focal point at the grid center where NO tile can show it. */
.sec-categories .cat-tile-tl { background-position: 25% 25%; }
.sec-categories .cat-tile-tr { background-position: 75% 25%; }
.sec-categories .cat-tile-bl { background-position: 25% 75%; }
.sec-categories .cat-tile-br { background-position: 75% 75%; }

/* Index number — small mono in the upper corner away from the diagonal. */
.sec-categories .cat-num {
	position: absolute;
	top: 18px;
	font-family: 'Space Mono', ui-monospace, monospace;
	font-size: 12px;
	letter-spacing: 0.18em;
	color: rgba(244, 241, 234, 0.55);
	z-index: 2;
}
.sec-categories .cat-tile-tl .cat-num,
.sec-categories .cat-tile-bl .cat-num { left: 24px; }
.sec-categories .cat-tile-tr .cat-num,
.sec-categories .cat-tile-br .cat-num { right: 24px; }

/* Label tab — light bone box, dark uppercase heading, mono subline.
   CRITICAL: each tile is clip-path'd to its own quadrant of the grid, so the
   label MUST live inside that quadrant. That means per-tile positioning, not
   one centered rule for all four (which was getting clipped away).
   Each label is placed near the BOTTOM of its tile's visible quadrant. */
.sec-categories .cat-label {
	position: absolute;
	padding: 12px 24px 10px;
	background: rgba(235, 231, 221, 0.95);
	border: 1px solid rgba(20, 20, 20, 0.45);
	box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.55);
	text-align: center;
	z-index: 5;
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	white-space: nowrap;
}

/* Top-left tile visible area: x 0..~50%, y 0..49%. Anchor label to lower-left. */
.sec-categories .cat-tile-tl .cat-label { top: 34%; left: 6%; }
/* Top-right tile visible area: x ~50..100%, y 0..49%. Anchor to lower-right. */
.sec-categories .cat-tile-tr .cat-label { top: 34%; right: 6%; }
/* Bottom-left tile visible area: x 0..~54%, y 51..100%. Anchor to bottom-left. */
.sec-categories .cat-tile-bl .cat-label { bottom: 8%;  left: 6%; }
/* Bottom-right tile visible area: x ~46..100%, y 51..100%. Anchor to bottom-right. */
.sec-categories .cat-tile-br .cat-label { bottom: 8%;  right: 6%; }

.sec-categories .cat-label h3 {
	margin: 0 0 4px;
	font-family: 'Oswald', 'Barlow Condensed', sans-serif;
	font-weight: 700;
	font-size: clamp(18px, 2.1vw, 26px);
	line-height: 1;
	letter-spacing: 0.06em;
	color: #141414;
	text-transform: uppercase;
	white-space: nowrap;
}

.sec-categories .cat-label .cat-sub {
	display: block;
	font-family: 'Space Mono', ui-monospace, monospace;
	font-size: clamp(9px, 0.75vw, 11px);
	letter-spacing: 0.14em;
	color: #141414;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Tablet — shrink type, keep diagonals. */
@media (max-width: 900px) {
	.sec-categories .cat-grid { aspect-ratio: 2 / 1.2; }
	.sec-categories .cat-label { padding: 12px 20px 14px 16px; bottom: 12%; }
}

/* Mobile — collapse to a stacked column of rectangles. Drop the diagonals. */
@media (max-width: 720px) {
	.sec-categories .cat-grid {
		display: grid;
		grid-template-columns: 1fr;
		gap: 10px;
		aspect-ratio: auto;
		background: transparent;
	}
	.sec-categories .cat-tile {
		position: relative;
		inset: auto;
		clip-path: none !important;
		aspect-ratio: 16 / 9;
		min-height: 180px;
	}
	.sec-categories .cat-tile-tl .cat-num,
	.sec-categories .cat-tile-tr .cat-num,
	.sec-categories .cat-tile-bl .cat-num,
	.sec-categories .cat-tile-br .cat-num { left: 18px; right: auto; top: 14px; }
	.sec-categories .cat-label { bottom: 14px; left: 14px; padding: 10px 18px 12px 14px; }
}

/* Featured product tabs (front-page filter pills) */
.pd-tabs-strip { display: flex; gap: 0; border-bottom: 2px solid var(--gun); margin-bottom: 32px; flex-wrap: wrap; }
.pd-tab {
	padding: 14px 22px;
	font-family: var(--f-display); font-weight: 700; font-size: 13px;
	letter-spacing: 0.14em; text-transform: uppercase;
	border-bottom: 4px solid transparent; margin-bottom: -2px;
	cursor: pointer; color: var(--gun);
	background: transparent;
}
.pd-tab.active, .pd-tab:hover { border-color: var(--red); color: var(--red); }

/* Empty states */
.fang-empty { padding: 48px; text-align: center; font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fog); border: 1px dashed rgba(0,0,0,.15); }
.dark .fang-empty { color: #b8b3a6; border-color: rgba(255,255,255,.15); }

@media (max-width: 768px) {
	.pd-tabs-strip { gap: 0; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
	.pd-tab { padding: 12px 16px; font-size: 12px; letter-spacing: 0.10em; white-space: nowrap; }
	.fang-empty { padding: 32px 18px; font-size: 12px; }
}
@media (max-width: 560px) {
	.home-products { gap: 14px; }
	.home-products-4 { gap: 14px; }
}
