/* ==========================================================================
   Sagiant Interactive Layer
   Progressive, theme-matched interactions for category, sub-category and
   product pages. Purely additive â€” no existing markup is required to change.
   Tokens reused from custom.css: --color-primary #303036, --color-secondary
   / --sagiant-green #98A7A0, --color-accent #EDE300.
   ========================================================================== */

:root {
	--sg-header-offset: 96px;        /* overwritten at runtime by JS */
	--sg-ease: cubic-bezier(0.16, 0.84, 0.44, 1);
	--sg-green: var(--color-secondary, #98A7A0);
	--sg-ink: var(--color-primary, #303036);
	--sg-accent: var(--color-accent, #EDE300);
	--sg-line: rgba(95, 116, 107, 0.18);
	--sg-soft: rgba(95, 116, 107, 0.08);
}

/* --------------------------------------------------------------------------
   1. Scroll reveal
   -------------------------------------------------------------------------- */
.sg-reveal {
	opacity: 0;
	transform: translate3d(0, 22px, 0);
	transition: opacity 0.66s var(--sg-ease), transform 0.66s var(--sg-ease);
	transition-delay: var(--sg-delay, 0ms);
	will-change: opacity, transform;
}
.sg-reveal.is-in {
	opacity: 1;
	transform: none;
}

/* --------------------------------------------------------------------------
   2. Sticky in-page navigation (category jump-nav + product data-nav)
   -------------------------------------------------------------------------- */
.sg-jumpnav {
	position: sticky;
	top: var(--sg-header-offset);
	z-index: 60;
	margin: 0 0 26px;
	padding: 10px;
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	background: rgba(255, 255, 255, 0.86);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	backdrop-filter: saturate(180%) blur(12px);
	border: 1px solid var(--sg-line);
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(23, 33, 31, 0.06);
}
.sg-jumpnav::-webkit-scrollbar { display: none; }
.sg-jumpnav a {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: 999px;
	border: 1px solid transparent;
	color: var(--sg-ink);
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.2s var(--sg-ease), color 0.2s var(--sg-ease), border-color 0.2s var(--sg-ease);
}
.sg-jumpnav a:hover {
	background: var(--sg-soft);
	color: var(--sg-ink);
	text-decoration: none;
}
.sg-jumpnav a .sg-count {
	font-size: 0.7rem;
	font-weight: 700;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--sg-soft);
	color: var(--sg-green);
}
.sg-jumpnav a.is-active {
	background: var(--sg-ink);
	color: #fff;
	border-color: var(--sg-ink);
}
.sg-jumpnav a.is-active .sg-count {
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
}

/* --------------------------------------------------------------------------
   3. Live filter bar (category + sub-category listings)
   -------------------------------------------------------------------------- */
.sg-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin: 0 0 26px;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid var(--sg-line);
	border-radius: 12px;
	box-shadow: 0 14px 34px rgba(23, 33, 31, 0.05);
}
.sg-filter__field {
	position: relative;
	flex: 1 1 280px;
	min-width: 0;
}
.sg-filter__field i {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--sg-green);
	font-size: 0.9rem;
	pointer-events: none;
}
.sg-filter input[type="search"] {
	width: 100%;
	height: 48px;
	padding: 0 44px 0 42px;
	border: 1px solid var(--sg-line);
	border-radius: 999px;
	background: #fbfcfb;
	color: var(--sg-ink);
	font-size: 0.95rem;
	outline: none;
	transition: border-color 0.2s var(--sg-ease), box-shadow 0.2s var(--sg-ease), background 0.2s var(--sg-ease);
	-webkit-appearance: none;
	appearance: none;
}
.sg-filter input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.sg-filter input[type="search"]:focus {
	border-color: var(--sg-green);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(152, 167, 160, 0.18);
}
.sg-filter__clear {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 30px;
	height: 30px;
	display: none;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: var(--sg-soft);
	color: var(--sg-ink);
	cursor: pointer;
	transition: background 0.2s var(--sg-ease);
}
.sg-filter__clear:hover { background: rgba(95, 116, 107, 0.2); }
.sg-filter.has-value .sg-filter__clear { display: inline-flex; }
.sg-filter__count {
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--sg-green);
	white-space: nowrap;
}
.sg-filter__count strong { color: var(--sg-ink); }

/* hidden / empty states used by the filter */
.sg-hidden { display: none !important; }
.sg-empty {
	margin: 8px 0 0;
	padding: 30px;
	text-align: center;
	color: #6a746f;
	border: 1px dashed var(--sg-line);
	border-radius: 12px;
	background: #fbfcfb;
}
.sg-empty i { color: var(--sg-green); font-size: 1.4rem; margin-bottom: 8px; display: block; }

/* gentle highlight of matched text */
.sg-mark {
	background: rgba(237, 227, 0, 0.42);
	border-radius: 3px;
	padding: 0 1px;
	color: inherit;
}

/* --------------------------------------------------------------------------
   4. Product page data-section side nav
   -------------------------------------------------------------------------- */
.sg-datanav-wrap { position: relative; }
.sg-datanav {
	list-style: none;
	margin: 0 0 18px;
	padding: 8px;
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	background: rgba(255, 255, 255, 0.9);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 1px solid var(--sg-line);
	border-radius: 10px;
	position: sticky;
	top: var(--sg-header-offset);
	z-index: 55;
}
.sg-datanav::-webkit-scrollbar { display: none; }
.sg-datanav li { flex: 0 0 auto; }
.sg-datanav a {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
	color: #555b58;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.2s var(--sg-ease), color 0.2s var(--sg-ease);
}
.sg-datanav a:hover { background: var(--sg-soft); color: var(--sg-ink); text-decoration: none; }
.sg-datanav a.is-active { background: var(--sg-ink); color: #fff; }

/* offset for anchored sections so the sticky header never overlaps them */
.sagiant-data-card[id],
.sagiant-product-category-block[id] { scroll-margin-top: calc(var(--sg-header-offset) + 64px); }

/* --------------------------------------------------------------------------
   5. Table tools (search + sortable + row hover) on large data tables
   -------------------------------------------------------------------------- */
.sg-table-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}
.sg-table-search {
	position: relative;
	flex: 1 1 220px;
	max-width: 320px;
}
.sg-table-search i {
	position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
	color: var(--sg-green); font-size: 0.82rem; pointer-events: none;
}
.sg-table-search input {
	width: 100%; height: 40px; padding: 0 14px 0 36px;
	border: 1px solid var(--sg-line); border-radius: 999px;
	background: #fbfcfb; color: var(--sg-ink); font-size: 0.86rem; outline: none;
	transition: border-color 0.2s var(--sg-ease), box-shadow 0.2s var(--sg-ease);
}
.sg-table-search input:focus { border-color: var(--sg-green); box-shadow: 0 0 0 3px rgba(152,167,160,0.18); }
.sg-table-meta { font-size: 0.8rem; color: #6a746f; }

th.sg-sortable {
	cursor: pointer;
	user-select: none;
	position: relative;
	padding-right: 26px !important;
	transition: color 0.2s var(--sg-ease);
}
th.sg-sortable:hover { color: var(--sg-green); }
th.sg-sortable::after {
	content: "\f0dc";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.66rem;
	opacity: 0.4;
	transition: opacity 0.2s var(--sg-ease);
}
th.sg-sortable.sg-asc::after { content: "\f0de"; opacity: 1; color: var(--sg-green); }
th.sg-sortable.sg-desc::after { content: "\f0dd"; opacity: 1; color: var(--sg-green); }

.sagiant-data-card tbody tr,
.sagiant-data-panel tbody tr { transition: background 0.16s var(--sg-ease); }
.sagiant-data-card tbody tr:hover,
.sagiant-data-panel tbody tr:hover { background: var(--sg-soft); }

/* --------------------------------------------------------------------------
   6. Card micro-interaction polish (adds to existing hover behaviour)
   -------------------------------------------------------------------------- */
.sagiant-card .read-more {
	display: inline-flex;
	align-items: center;
	transition: gap 0.2s var(--sg-ease), color 0.2s var(--sg-ease);
	gap: 4px;
}
a:hover .sagiant-card .read-more { gap: 10px; }
.sagiant-card .sagiant-card-img { transition: transform 0.5s var(--sg-ease); }
a:hover .sagiant-card .sagiant-card-img { transform: scale(1.05); }
.sagiant-card { will-change: transform; }

/* keyboard focus ring for the enhanced interactive cards */
.sagiant-product-link-card:focus-visible,
.sagiant-card:focus-visible,
a:focus-visible .sagiant-card {
	outline: 3px solid rgba(152, 167, 160, 0.55);
	outline-offset: 3px;
	border-radius: var(--border-radius2x, 10px);
}

/* --------------------------------------------------------------------------
   7. Image lightbox (content imagery on product pages)
   -------------------------------------------------------------------------- */
.sagiant-image.sg-zoomable { cursor: zoom-in; }
.sg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 4000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 5vmin;
	background: rgba(18, 24, 22, 0.82);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s var(--sg-ease), visibility 0.28s var(--sg-ease);
}
.sg-lightbox.is-open { opacity: 1; visibility: visible; }
.sg-lightbox img {
	max-width: 100%;
	max-height: 100%;
	border-radius: 12px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
	transform: scale(0.94);
	transition: transform 0.32s var(--sg-ease);
}
.sg-lightbox.is-open img { transform: scale(1); }
.sg-lightbox__close {
	position: absolute;
	top: 22px;
	right: 26px;
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 1.2rem;
	cursor: pointer;
	transition: background 0.2s var(--sg-ease);
}
.sg-lightbox__close:hover { background: rgba(255, 255, 255, 0.28); }

/* --------------------------------------------------------------------------
   8. Back to top
   -------------------------------------------------------------------------- */
.sg-top {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 1200;
	width: 48px;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: var(--sg-ink);
	color: #fff;
	font-size: 1rem;
	cursor: pointer;
	opacity: 0;
	transform: translate3d(0, 16px, 0) scale(0.9);
	pointer-events: none;
	box-shadow: 0 14px 30px rgba(23, 33, 31, 0.28);
	transition: opacity 0.28s var(--sg-ease), transform 0.28s var(--sg-ease), background 0.2s var(--sg-ease);
}
.sg-top.is-visible {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}
.sg-top:hover { background: var(--sg-green); }

/* keep clear of the mobile bottom CTA bar */
@media (max-width: 991.98px) {
	.sg-top { bottom: 86px; }
}

/* --------------------------------------------------------------------------
   9. Reduced motion & small screens
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
	.sg-filter { padding: 12px; }
	.sg-jumpnav, .sg-datanav { border-radius: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.sg-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
	.sagiant-card .sagiant-card-img,
	a:hover .sagiant-card .sagiant-card-img { transition: none; transform: none; }
	.sg-lightbox, .sg-lightbox img, .sg-top { transition: none; }
	* { scroll-behavior: auto !important; }
}

/* REMOVE DUPLICATE BACK-TO-TOP (keep one) */
.sg-top{display:none!important;visibility:hidden!important}
