:root {
	--afs-primary: #0B2545;
	--afs-highlight: #EAF0FC;
}

/* ===================================================================
   Defensive resets
   Many themes / Elementor global kits apply broad selectors like
   `button { border: ...; color: ... }` to every <button> on the page.
   Because those rules can carry higher specificity (or !important) than
   a plain class selector, every interactive element below is reset
   explicitly so the widget always renders the same regardless of theme.
   =================================================================== */
.afs-widget,
.afs-widget *,
.afs-widget *::before,
.afs-widget *::after {
	box-sizing: border-box !important;
}
.afs-widget button,
.afs-widget input,
.afs-widget a {
	font-family: inherit !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-decoration: none !important;
	box-shadow: none !important;
	outline: none !important;
	border-radius: 0;
	margin: 0;
}
/* The HTML `hidden` attribute relies on the browser default `[hidden]{display:none}`
   rule, which themes that set `button{display:...}` globally can silently override. */
.afs-widget [hidden] {
	display: none !important;
}

.afs-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding: 4vh 16px;
	box-sizing: border-box;
}
.afs-overlay.afs-open { display: flex; }

.afs-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 16, 30, 0.55);
	backdrop-filter: blur(3px);
}

.afs-panel {
	position: relative;
	width: 100%;
	max-width: 1140px;
	max-height: 88vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.35);
	padding: 24px;
	font-family: inherit;
}

/* Inline (shortcode-embedded, no popup) variant */
.afs-inline {
	background: #fff;
	border-radius: 16px;
	padding: 20px;
	max-width: 1140px;
}

/* Top bar */
.afs-topbar {
	display: flex !important;
	align-items: center;
	gap: 14px;
	border: 2px solid var(--afs-primary) !important;
	border-radius: 999px !important;
	padding: 6px 8px 6px 18px;
	margin-bottom: 28px;
	background: #fff !important;
}
.afs-close {
	background: none !important;
	border: none !important;
	color: var(--afs-primary) !important;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	padding: 4px;
	flex-shrink: 0;
}
.afs-input {
	flex: 1;
	border: none !important;
	background: transparent !important;
	font-size: 17px;
	color: #1a1a1a !important;
	min-width: 0;
	padding: 6px 0 !important;
	height: auto !important;
}
.afs-input::placeholder { color: #9aa3b2 !important; opacity: 1; }
.afs-search-btn {
	background: var(--afs-primary) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	padding: 12px 28px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	flex-shrink: 0;
	transition: opacity .15s ease;
}
.afs-search-btn:hover { opacity: .88; }

/* Body layout */
.afs-body {
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 32px;
}
.afs-col-heading {
	font-size: 13px;
	color: #9aa3b2;
	margin-bottom: 12px;
}

/* Suggestions */
.afs-suggestions-list { display: flex; flex-direction: column; gap: 2px; }
.afs-suggestion-item {
	display: flex !important;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 8px !important;
	cursor: pointer;
	font-size: 14px;
	color: #2a2f3a !important;
	background: none !important;
	border: none !important;
	width: 100%;
	text-align: left;
}
.afs-suggestion-item:hover,
.afs-suggestion-item.is-active {
	background: var(--afs-highlight) !important;
}
.afs-suggestion-item .afs-icon {
	flex-shrink: 0;
	display: flex;
	color: #6b7280 !important;
}
.afs-suggestion-item .afs-label {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: inherit !important;
}
.afs-suggestion-item .afs-arrow {
	flex-shrink: 0;
	opacity: 0;
	color: #6b7280 !important;
}
.afs-suggestion-item:hover .afs-arrow { opacity: 1; }
.afs-suggestion-group-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #b3b9c4;
	margin: 14px 0 4px;
	padding: 0 10px;
}
.afs-suggestion-group-label:first-child { margin-top: 0; }

/* Products grid */
.afs-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 18px;
}
.afs-product-card {
	display: block !important;
	text-decoration: none !important;
	color: inherit !important;
}
.afs-product-thumb {
	background: #e3e5e8;
	border-radius: 6px;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin-bottom: 10px;
}
.afs-product-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.afs-product-thumb svg { color: #9aa0aa; }
.afs-product-sku {
	font-size: 10px;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: #9aa3b2;
	margin-bottom: 6px;
	min-height: 12px;
}
.afs-product-title {
	font-size: 13px;
	font-weight: 600;
	color: #1a1f29;
	line-height: 1.35;
	margin-bottom: 8px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.afs-product-price {
	font-size: 14px;
	font-weight: 700;
	color: #1a1f29;
}
.afs-product-price.afs-loading { color: #b3b9c4 !important; font-weight: 500; }

.afs-see-all {
	margin-top: 22px;
	background: var(--afs-primary) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	padding: 13px 26px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}
.afs-see-all:hover { opacity: .88; }

.afs-empty {
	color: #9aa3b2;
	font-size: 14px;
	padding: 20px 0;
}

/* Trigger button (modal-opening shortcode) */
.afs-trigger-btn {
	background: none !important;
	border: none !important;
	cursor: pointer;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	padding: 6px;
	color: inherit !important;
}

/* Mobile */
@media (max-width: 720px) {
	.afs-overlay { padding: 0; }
	.afs-panel { max-width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; padding: 16px; }
	.afs-inline { padding: 16px; }
	.afs-body { grid-template-columns: 1fr; }
	.afs-products-grid { grid-template-columns: repeat(2, 1fr); }
	.afs-topbar { padding: 4px 6px 4px 12px; }
	.afs-search-btn { padding: 10px 18px; }
}
