/* =========================================================================
   ElektraNu — listing + product detail
   Loaded only by categorie.html and product.html, so the home page does not
   pay for CSS it never uses.
   ========================================================================= */

/* ---------- Breadcrumb + page head ---------- */

.breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding-block: var(--s2);
	font-size: var(--fs-xs);
	color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--orange-600); }
.breadcrumb svg { width: 13px; height: 13px; opacity: .55; flex: none; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

.page-head { max-width: 70ch; margin-bottom: var(--s3); }
.page-head h1 { margin-bottom: var(--s1); }
.page-head p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }

/* ---------- Listing layout ---------- */

.listing { display: grid; gap: var(--s3); align-items: start; }

.filters { display: none; }
.filters__card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	padding: var(--s2);
}
.filter-group + .filter-group {
	margin-top: var(--s2);
	padding-top: var(--s2);
	border-top: 1px solid var(--line);
}
.filter-group h3 { font-size: var(--fs-sm); margin-bottom: var(--s1); }
.filter-group__list { display: grid; gap: 2px; max-height: 280px; overflow-y: auto; }

.check {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 2px 4px;
	border-radius: var(--r-sm);
	font-size: var(--fs-sm);
	color: var(--text);
	cursor: pointer;
	transition: background-color var(--t);
}
.check:hover { background: var(--soft); }
.check input {
	appearance: none;
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	flex: none;
	margin: 0;
	border: 2px solid #C3CCDA;
	border-radius: 5px;
	background: #fff;
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: border-color var(--t), background-color var(--t);
}
.check input::after {
	content: '';
	width: 10px;
	height: 6px;
	border-left: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(-45deg) scale(0);
	transition: transform var(--t);
}
.check input:checked { background: var(--orange); border-color: var(--orange); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }
.check__count { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); }

.range { display: flex; align-items: center; gap: var(--s1); }
.range input {
	width: 100%;
	min-width: 0;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	padding: 11px 10px;
	font-size: 16px;
	font-family: var(--font-body);
	color: var(--text);
}
.range span { color: var(--muted); }

/* ---------- Sort bar + active filter chips ---------- */

.sortbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s1);
	margin-bottom: var(--s2);
}
.sortbar__count { font-size: var(--fs-sm); color: var(--muted); margin-right: auto; }
.sortbar select,
.filterbtn {
	min-height: 44px;
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	background: #fff;
	color: var(--ink);
	font-family: var(--font-head);
	font-weight: 600;
	font-size: var(--fs-sm);
	padding: 0 var(--s2);
}
.filterbtn { display: inline-flex; align-items: center; gap: 8px; }
.filterbtn svg { width: 18px; height: 18px; }
.filterbtn__badge {
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: var(--r-pill);
	background: var(--orange);
	color: #fff;
	font-size: 11px;
	line-height: 20px;
	text-align: center;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s2); }
.chips:empty { display: none; }
.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 34px;
	padding: 0 6px 0 12px;
	border-radius: var(--r-pill);
	background: var(--soft);
	border: 1px solid var(--line);
	font-size: var(--fs-xs);
	font-weight: 600;
	color: var(--ink);
}
.chip button {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: var(--r-pill);
	background: transparent;
	color: var(--muted);
}
.chip button:hover { background: #DFE5EE; color: var(--ink); }
.chip button svg { width: 13px; height: 13px; }

.empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: var(--s6) var(--s2);
	color: var(--muted);
}
.empty svg { width: 44px; height: 44px; color: #C3CCDA; margin: 0 auto var(--s2); }

/* ---------- Mobile filter bottom sheet ---------- */

.sheet {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 90;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: var(--r-xl) var(--r-xl) 0 0;
	transform: translateY(100%);
	visibility: hidden;
	transition: transform 300ms var(--ease);
	box-shadow: var(--shadow-lg);
}
.sheet.is-open { transform: none; visibility: visible; }
.sheet__grab { width: 40px; height: 4px; border-radius: var(--r-pill); background: #D5DCE6; margin: 10px auto 0; }
.sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--s1) var(--s2);
	border-bottom: 1px solid var(--line);
}
.sheet__head h3 { margin: 0; }
.sheet__body { flex: 1; overflow-y: auto; padding: var(--s2); }
.sheet__foot {
	border-top: 1px solid var(--line);
	padding: var(--s2);
	padding-bottom: max(var(--s2), env(safe-area-inset-bottom));
	display: flex;
	gap: var(--s1);
}
.sheet__foot .btn { flex: 1; }

/* ---------- Product detail ---------- */

.pdp { display: grid; gap: var(--s3); align-items: start; }

.gallery__main {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	overflow: hidden;
}
.gallery__main img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.gallery__main > svg { width: 42%; height: 42%; color: var(--ink); opacity: .8; }

.thumbs { display: flex; gap: var(--s1); margin-top: var(--s1); }
.thumb {
	width: 72px;
	height: 72px;
	flex: none;
	display: grid;
	place-items: center;
	background: var(--soft);
	border: 2px solid var(--line);
	border-radius: var(--r-md);
	padding: 0;
	transition: border-color var(--t);
}
.thumb svg { width: 44%; height: 44%; color: var(--ink); opacity: .75; }
.thumb[aria-selected="true"] { border-color: var(--ink); }

.buybox h1 { font-size: var(--fs-xl); margin-bottom: var(--s1); }
.buybox__brand {
	font-family: var(--font-head);
	font-size: var(--fs-sm);
	font-weight: 700;
	color: var(--muted);
	margin-bottom: 4px;
}
.buybox__price { display: flex; align-items: baseline; gap: var(--s1); flex-wrap: wrap; margin-top: var(--s2); }
.buybox__price .price { font-size: var(--fs-2xl); }
.buybox__meta { font-size: var(--fs-xs); color: var(--muted); margin: 2px 0 var(--s2); }

.qtyrow { display: flex; gap: var(--s1); margin: var(--s2) 0; }
.qty {
	display: flex;
	align-items: center;
	border: 2px solid var(--line);
	border-radius: var(--r-md);
	overflow: hidden;
	flex: none;
}
.qty button {
	width: 46px;
	height: 48px;
	border: 0;
	background: #fff;
	color: var(--ink);
	font-family: var(--font-head);
	font-size: var(--fs-lg);
	transition: background-color var(--t);
}
.qty button:hover { background: var(--soft); }
.qty input {
	width: 54px;
	height: 48px;
	border: 0;
	border-inline: 2px solid var(--line);
	text-align: center;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 16px;
	color: var(--ink);
	-moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qtyrow .btn { flex: 1; }

.trustgrid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	margin-top: var(--s3);
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	overflow: hidden;
}
.trustgrid > div { display: flex; gap: 10px; padding: var(--s2); background: #fff; }
.trustgrid svg { width: 22px; height: 22px; color: var(--ink); flex: none; }
.trustgrid strong { display: block; font-family: var(--font-head); font-size: var(--fs-xs); color: var(--ink); }
.trustgrid span { font-size: 11px; color: var(--muted); line-height: 1.35; }

.keyfeatures { margin-top: var(--s3); }
.keyfeatures h2 { font-size: var(--fs-md); margin-bottom: var(--s1); }
.keyfeatures li { display: flex; gap: 10px; padding: 5px 0; font-size: var(--fs-sm); color: var(--text); }
.keyfeatures svg { width: 18px; height: 18px; color: var(--ok); flex: none; margin-top: 3px; }

/* ---------- Tabs ---------- */

.tabs { margin-top: var(--s5); }
.tabs__nav {
	display: flex;
	gap: var(--s1);
	border-bottom: 1px solid var(--line);
	overflow-x: auto;
	scrollbar-width: none;
}
.tabs__nav::-webkit-scrollbar { display: none; }
.tabs__btn {
	flex: none;
	min-height: 48px;
	padding: 0 var(--s2);
	border: 0;
	border-bottom: 3px solid transparent;
	background: transparent;
	font-family: var(--font-head);
	font-weight: 600;
	font-size: var(--fs-sm);
	color: var(--muted);
	white-space: nowrap;
	transition: color var(--t), border-color var(--t);
}
.tabs__btn[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.tabs__panel { padding-top: var(--s3); }
.tabs__panel[hidden] { display: none; }
.tabs__panel p { font-size: var(--fs-sm); color: var(--text); max-width: 72ch; }

.spec { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.spec th, .spec td { padding: 12px var(--s2); border: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec th { background: var(--soft); font-family: var(--font-head); font-weight: 600; color: var(--ink); width: 42%; }
.table-scroll { overflow-x: auto; }

.downloads li { border-bottom: 1px solid var(--line); }
.downloads a { display: flex; align-items: center; gap: var(--s2); min-height: 56px; font-family: var(--font-head); font-weight: 600; font-size: var(--fs-sm); }
.downloads svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.downloads span { margin-left: auto; font-family: var(--font-body); font-weight: 400; font-size: var(--fs-xs); color: var(--muted); }

/* ---------- Sticky mobile add-to-cart ---------- */

.stickybar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 65;
	display: flex;
	align-items: center;
	gap: var(--s2);
	padding: 10px var(--s2);
	padding-bottom: max(10px, env(safe-area-inset-bottom));
	background: rgba(255, 255, 255, .97);
	backdrop-filter: blur(8px);
	border-top: 1px solid var(--line);
	transform: translateY(110%);
	transition: transform 260ms var(--ease);
}
.stickybar.is-visible { transform: none; }
.stickybar__price { line-height: 1.15; }
.stickybar__price b { display: block; font-family: var(--font-head); font-size: var(--fs-md); color: var(--ink); }
.stickybar__price span { font-size: 11px; color: var(--muted); }
.stickybar .btn { flex: 1; }

/* Keep the floating WhatsApp button clear of the sticky bar */
body.has-stickybar .wa { bottom: 84px; }

/* ---------- Breakpoints ---------- */

@media (min-width: 900px) {
	.listing { grid-template-columns: 280px minmax(0, 1fr); gap: var(--s4); }
	.filters { display: block; position: sticky; top: 132px; }
	.filterbtn { display: none; }

	.pdp { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: var(--s5); }
	.gallery { position: sticky; top: 132px; }
	.buybox h1 { font-size: var(--fs-2xl); }
	.trustgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.stickybar { display: none; }
	body.has-stickybar .wa { bottom: 24px; }
}
