/* ==========================================================================
   GlobeSync Technologies AI Search - Header Integrated Search Bar Styles
   ========================================================================== */

:root {
	--gs-ai-primary: #1D447D;
	--gs-ai-accent: #89be4b;
	--gs-ai-white: #ffffff;
	--gs-ai-text: #1e293b;
	--gs-ai-glass-bg: #ffffff;
	--gs-ai-border-green: #89be4b;
	--gs-ai-shadow: 0 4px 18px rgba(137, 190, 75, 0.2), 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Square Scrollbar Design (Corner Round to Square)
   ========================================================================== */
*::-webkit-scrollbar,
.gs-ai-results-drawer *::-webkit-scrollbar,
.gs-ai-drawer-content::-webkit-scrollbar {
	width: 6px !important;
	height: 6px !important;
	border-radius: 0 !important;
}

*::-webkit-scrollbar-track,
.gs-ai-results-drawer *::-webkit-scrollbar-track,
.gs-ai-drawer-content::-webkit-scrollbar-track {
	background: #f1f5f9 !important;
	border-radius: 0 !important;
}

*::-webkit-scrollbar-thumb,
.gs-ai-results-drawer *::-webkit-scrollbar-thumb,
.gs-ai-drawer-content::-webkit-scrollbar-thumb {
	background: #cbd5e1 !important;
	border-radius: 0 !important;
}

*::-webkit-scrollbar-thumb:hover,
.gs-ai-results-drawer *::-webkit-scrollbar-thumb:hover,
.gs-ai-drawer-content::-webkit-scrollbar-thumb:hover {
	background: #94a3b8 !important;
	border-radius: 0 !important;
}

.gs-ai-drawer-content {
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 #f1f5f9;
}

/* ==========================================================================
   Zero Horizontal Overflow & Anti-Zoom Guard
   ========================================================================== */
html, body {
	max-width: 100% !important;
	overflow-x: hidden !important;
	-webkit-text-size-adjust: 100% !important;
}

@media screen and (max-width: 1024px) {
	html, body {
		touch-action: manipulation;
	}
}

/* ==========================================================================
   Header Search Wrapper & Layout
   ========================================================================== */
#gs-ai-search-container {
	position: static;
	display: block;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	z-index: 1001;
	box-sizing: border-box;
}

/* Desktop and Tablet (> 900px): Between Logo & WhatsApp, Maximum Space */
@media screen and (min-width: 901px) {
	.top-header .header-inner {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: space-between !important;
	}

	.top-header .header-inner .header-logo-global {
		flex: 0 0 auto !important;
	}

	#gs-ai-search-container {
		flex: 1 1 auto !important;
		min-width: 0 !important;
		margin: 0 20px !important;
		max-width: 100% !important;
	}

	.top-header .header-inner .language-row {
		flex: 0 0 auto !important;
	}
}

/* Mobile Devices & iPad Mini / Smaller Tablets (<= 900px): Bottom of Header, Full Width */
@media screen and (max-width: 900px) {
	html body .site-header .top-header .header-inner,
	html body .top-header .header-inner,
	body .header-inner {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: wrap !important;
		align-items: center !important;
		justify-content: space-between !important;
		row-gap: 8px !important;
		padding-top: 8px !important;
		padding-bottom: 12px !important;
	}

	html body .top-header .header-inner .header-logo-global,
	body .header-logo-global {
		order: 1 !important;
		flex: 0 0 auto !important;
	}

	html body .top-header .header-inner .language-row,
	body .language-row {
		order: 2 !important;
		flex: 0 0 auto !important;
	}

	html body #gs-ai-search-container,
	body #gs-ai-search-container {
		order: 3 !important;
		flex: 0 0 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 8px 0 0 0 !important;
	}

	/* Frozen Search Bar Always on Top When Scrolled */
	html body #gs-ai-search-container.is-frozen,
	body #gs-ai-search-container.is-frozen {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		z-index: 999999 !important;
		background: #ffffff !important;
		padding: 8px 14px !important;
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.09) !important;
		box-sizing: border-box !important;
		margin: 0 !important;
		transition: box-shadow 0.2s ease;
	}


	.gs-ai-search-placeholder {
		display: none;
	}

	.gs-ai-search-placeholder.is-active {
		display: block !important;
		width: 100% !important;
		height: 56px !important;
		flex: 0 0 100% !important;
		order: 3 !important;
	}
}

/* ==========================================================================
   Header Search Bar
   ========================================================================== */
.gs-ai-search-bar {
	display: flex;
	align-items: center;
	background: #ffffff;
	border: 2px solid #89be4b !important;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(137, 190, 75, 0.15);
	padding: 0 8px 0 12px;
	height: 44px;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	overflow: hidden !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	position: relative;
}

.gs-ai-search-bar:hover {
	border-color: #78a83d !important;
	box-shadow: 0 3px 12px rgba(137, 190, 75, 0.25);
}

.gs-ai-search-bar:focus-within {
	border-color: #89be4b !important;
	box-shadow: 0 0 0 3px rgba(137, 190, 75, 0.25), 0 4px 14px rgba(137, 190, 75, 0.3);
}

/* Input Area */
.gs-ai-input-wrap {
	display: flex;
	align-items: center;
	flex: 1 1 0% !important;
	min-width: 0 !important;
	max-width: 100% !important;
	margin-right: 6px;
	overflow: hidden !important;
}

.gs-ai-search-submit-btn {
	background: transparent;
	border: none;
	color: var(--gs-ai-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	cursor: pointer;
	margin-right: 6px;
	flex-shrink: 0;
	transition: color 0.15s ease, transform 0.15s ease;
}

.gs-ai-search-submit-btn:hover {
	color: var(--gs-ai-accent);
	transform: scale(1.08);
}

.gs-ai-text-input,
.gs-ai-text-input:focus,
.gs-ai-text-input:focus-visible,
.gs-ai-text-input:active {
	border: none !important;
	outline: none !important;
	background: transparent !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	color: var(--gs-ai-primary) !important;
	font-size: 16px !important; /* Strict 16px font-size prevents iOS Safari / WebKit auto-zoom & zoom-out */
	font-weight: 500 !important;
	line-height: 1.4 !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: 100% !important;
	padding: 4px 0 !important;
	margin: 0 !important;
	box-sizing: border-box !important;
	-webkit-text-size-adjust: 100% !important;
	touch-action: manipulation;
}

.gs-ai-text-input::placeholder {
	color: #94a3b8;
	font-size: 13.5px;
	font-weight: 400;
}

/* Action Buttons (Voice & Camera) */
.gs-ai-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.gs-ai-mic-btn,
.gs-ai-cam-btn {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: var(--gs-ai-primary);
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	padding: 0;
}

.gs-ai-mic-btn:hover,
.gs-ai-cam-btn:hover {
	background: var(--gs-ai-primary);
	color: #ffffff;
	border-color: var(--gs-ai-primary);
	transform: scale(1.06);
}

.gs-ai-mic-btn.is-recording {
	background: #ef4444 !important;
	color: #ffffff !important;
	border-color: #ef4444 !important;
	animation: gsMicPulse 1s infinite alternate;
}

@keyframes gsMicPulse {
	from { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
	to { transform: scale(1.12); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

/* Voice Recording Panel */
.gs-ai-voice-panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 6px;
	background: rgba(29, 68, 125, 0.96);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-radius: 8px;
	color: #ffffff;
	padding: 10px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-shadow: 0 10px 25px rgba(29, 68, 125, 0.3);
	animation: gsSlideDown 0.2s ease-out;
	z-index: 1002;
}

.gs-ai-voice-status {
	font-size: 13.5px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-right: 8px;
}

.gs-ai-voice-timer {
	font-size: 13px;
	font-weight: 700;
	color: var(--gs-ai-accent);
	margin-right: 12px;
	font-variant-numeric: tabular-nums;
}

.gs-ai-voice-stop-btn {
	background: var(--gs-ai-accent);
	color: #ffffff;
	border: none;
	padding: 5px 14px;
	border-radius: 6px;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease;
}

.gs-ai-voice-stop-btn:hover {
	background: #7bb040;
}

/* ==========================================================================
   Full Screen Width Results Dropdown (Touching Bottom of Header)
   ========================================================================== */
.gs-ai-results-drawer {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	width: 100%;
	max-width: 100%;
	margin: 0;
	background: #ffffff;
	border-top: 1px solid #e2e8f0;
	border-bottom: 3px solid #89be4b;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
	display: flex;
	flex-direction: column;
	max-height: calc(85vh - 70px);
	overflow: hidden;
	z-index: 999999;
	animation: gsSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	box-sizing: border-box;
}

@keyframes gsSlideDown {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Constrained Responsive Container inside 100% Width Dropdown */
.gs-ai-drawer-container {
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	box-sizing: border-box;
}

.gs-ai-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	border-bottom: 1px solid #f1f5f9;
	background: #fafcf7;
	flex-shrink: 0;
}

.gs-ai-drawer-branding {
	display: flex;
	align-items: center;
	gap: 10px;
}

.gs-ai-brand-logo {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	display: block;
}

.gs-ai-tagline {
	font-size: 14px;
	font-weight: 700;
	color: var(--gs-ai-primary);
	text-transform: none !important;
	letter-spacing: 0.2px;
}

.gs-ai-drawer-close {
	background: transparent;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
	padding: 0 4px;
	transition: color 0.15s ease;
}

.gs-ai-drawer-close:hover {
	color: #0f172a;
}

.gs-ai-drawer-status {
	display: none !important;
}

.gs-ai-drawer-content {
	overflow-y: auto;
	padding: 16px 20px 24px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
	gap: 12px;
	box-sizing: border-box;
}

@media screen and (max-width: 767px) {
	.gs-ai-drawer-content {
		grid-template-columns: 1fr;
		gap: 10px;
		padding: 12px 14px 20px;
	}
}

/* ==========================================================================
   AI Knowledge / Company FAQ Direct Answer Card
   ========================================================================== */
.gs-ai-answer-card {
	grid-column: 1 / -1;
	background: #ffffff;
	border: 1.5px solid #1D447D;
	border-left: 5px solid #89be4b;
	border-radius: 10px;
	padding: 18px 22px;
	margin-bottom: 8px;
	box-shadow: 0 4px 14px rgba(29, 68, 125, 0.08);
	box-sizing: border-box;
}

.gs-ai-answer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.gs-ai-answer-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #1D447D;
	color: #ffffff;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: none !important;
	padding: 4px 12px;
	border-radius: 6px;
}

.gs-ai-answer-badge svg {
	stroke: #89be4b;
}

.gs-ai-answer-title {
	font-size: 18px;
	font-weight: 700;
	color: #1D447D;
	margin: 6px 0 8px 0;
	line-height: 1.35;
}

.gs-ai-answer-summary {
	font-size: 14px;
	line-height: 1.65;
	color: #334155;
	margin-bottom: 12px;
}

.gs-ai-answer-block {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid #e2e8f0;
}

.gs-ai-answer-subhead {
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #0f172a;
	margin: 0 0 8px 0;
}

.gs-ai-answer-checklist {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.gs-ai-answer-checklist li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 13.5px;
	line-height: 1.5;
	color: #334155;
}

.gs-ai-answer-checklist li strong {
	color: #0f172a;
	font-weight: 600;
}

.gs-ai-check-icon {
	flex-shrink: 0;
	margin-top: 2px;
	stroke: #16a34a;
}

.gs-ai-answer-steps {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.gs-ai-answer-steps li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13.5px;
	line-height: 1.5;
	color: #334155;
}

.gs-ai-step-idx {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #1D447D;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	flex-shrink: 0;
	margin-top: 2px;
}

.gs-ai-cta-wrap {
	margin-top: 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.gs-ai-cta-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #1D447D;
	color: #ffffff !important;
	font-size: 13.5px;
	font-weight: 700;
	padding: 9px 20px;
	border-radius: 6px;
	text-decoration: none !important;
	box-shadow: 0 2px 6px rgba(29, 68, 125, 0.25);
	transition: all 0.2s ease;
	cursor: pointer;
}

.gs-ai-cta-btn:hover {
	background: #14325c;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(29, 68, 125, 0.35);
}

.gs-ai-related-wrap {
	margin-top: 12px;
	font-size: 12.5px;
	color: #64748b;
}

.gs-ai-related-label {
	font-weight: 700;
	color: #475569;
}

.gs-ai-related-link {
	color: #1D447D;
	font-weight: 600;
	text-decoration: underline !important;
	margin: 0 4px;
	transition: color 0.15s ease;
}

.gs-ai-related-link:hover {
	color: #89be4b;
}

.gs-ai-bullet {
	color: #cbd5e1;
	margin: 0 4px;
}

.gs-ai-answer-source {
	font-size: 12px;
	color: #64748b;
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px dashed #cbd5e1;
}

.gs-ai-source-link {
	color: #1D447D;
	font-weight: 600;
	text-decoration: underline !important;
	transition: color 0.15s ease;
}

.gs-ai-source-link:hover {
	color: #89be4b;
}

/* ==========================================================================
   Tiered Product Sections (Primary vs Respective)
   ========================================================================== */
.gs-ai-tier-heading {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 4px 8px 4px;
	margin-top: 8px;
	border-bottom: 2px solid #e2e8f0;
	box-sizing: border-box;
}

.gs-ai-tier-heading.is-respective {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 2px dashed #cbd5e1;
	border-bottom: 2px solid #e2e8f0;
}

.gs-ai-tier-badge {
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 3px 8px;
	border-radius: 4px;
	white-space: nowrap;
}

.gs-ai-tier-heading.is-primary .gs-ai-tier-badge {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
}

.gs-ai-tier-heading.is-respective .gs-ai-tier-badge {
	background: #eff6ff;
	color: #1d4ed8;
	border: 1px solid #bfdbfe;
}

.gs-ai-tier-heading.is-general .gs-ai-tier-badge {
	background: #f1f5f9;
	color: #475569;
	border: 1px solid #cbd5e1;
}

.gs-ai-tier-title {
	font-size: 14.5px;
	font-weight: 700;
	color: #1D447D;
	margin: 0;
	line-height: 1.2;
}

.gs-ai-section-heading {
	grid-column: 1 / -1;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #64748b;
	margin: 12px 0 2px 2px;
}

/* Product Result Card */
.gs-ai-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	text-decoration: none !important;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	color: inherit;
	cursor: pointer;
	position: relative;
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
	.gs-ai-card:hover {
		border-color: var(--gs-ai-accent);
		background: #fafcf7;
		box-shadow: 0 4px 16px rgba(137, 190, 75, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
		transform: translateY(-1px);
	}
}

.gs-ai-card:active,
.gs-ai-card.is-navigating {
	background: #f1f8eb !important;
	border-color: #89be4b !important;
	opacity: 0.75;
}

.gs-ai-card-img {
	width: 58px;
	height: 58px;
	object-fit: cover;
	border-radius: 6px;
	background: #f8fafc;
	border: 1px solid #f1f5f9;
	flex-shrink: 0;
	align-self: flex-start; /* Image always on top left align */
	margin-top: 2px;
}

.gs-ai-card-icon {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f1f5f9;
	color: var(--gs-ai-primary);
	border-radius: 6px;
	flex-shrink: 0;
	align-self: flex-start;
	margin-top: 2px;
}

.gs-ai-card-body {
	flex: 1 1 auto;
	min-width: 0;
	align-self: center;
	padding: 2px 0;
}

.gs-ai-card-title {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--gs-ai-primary);
	margin: 0;
	line-height: 1.45;
	display: block;
	overflow: visible;
	word-break: break-word;
	hyphens: auto;
}

.gs-ai-card:hover .gs-ai-card-title {
	color: #0f172a;
}

/* Centered Navigation Arrow > */
.gs-ai-card-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: center; /* “>” must always in center of row */
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: var(--gs-ai-accent);
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	transition: all 0.2s ease;
	margin-left: 4px;
}

.gs-ai-card:hover .gs-ai-card-arrow {
	background: var(--gs-ai-accent);
	color: #ffffff;
	border-color: var(--gs-ai-accent);
	transform: translateX(3px);
	box-shadow: 0 2px 8px rgba(137, 190, 75, 0.35);
}

/* Message & Empty / Error States */
.gs-ai-message {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 18px;
	text-align: center;
	color: #64748b;
	font-size: 14px;
	line-height: 1.5;
	gap: 12px;
}

.gs-ai-message-icon {
	color: var(--gs-ai-accent);
	flex-shrink: 0;
}

.gs-ai-message.is-error {
	color: #dc2626;
}

.gs-ai-message.is-error .gs-ai-message-icon {
	color: #dc2626;
}

/* Spinner */
.gs-ai-loading {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 10px;
	gap: 14px;
	color: var(--gs-ai-primary);
	font-size: 14px;
	font-weight: 500;
}

.gs-ai-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(29, 68, 125, 0.15);
	border-top-color: var(--gs-ai-accent);
	border-radius: 50%;
	animation: gsSpin 0.8s linear infinite;
}

@keyframes gsSpin {
	to { transform: rotate(360deg); }
}

/* ==========================================================================
   Dimming Backdrop
   ========================================================================== */
.gs-ai-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.38);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	z-index: 999998;
}
