/**
 * Autocomplete Search Mobile Styles
 * Compact version for sticky hero context
 * All classes prefixed with acs-m- to avoid conflicts with desktop version
 *
 * @package Astra_Child_Main
 * @since 1.0.0
 */

/* ============================================
   Section Container (inside sticky hero)
   ============================================ */

.acs-m-section {
	width: 100%;
	padding: 6px 0 2px;
	position: relative;
}

.acs-m-container {
	padding: 0;
	position: relative;
}

/* ============================================
   Search Input Wrapper
   ============================================ */

.acs-m-search-wrapper {
	display: flex;
	align-items: stretch;
	background: rgb(255 255 255 / 15%);
	border: 2px solid rgb(255 255 255 / 50%);
	border-radius: 8px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	overflow: hidden;
}

.acs-m-search-wrapper:focus-within {
	border-color: rgb(255 255 255 / 90%);
	box-shadow: 0 0 0 3px rgb(255 255 255 / 15%);
	background: rgb(255 255 255 / 25%);
}

/* ============================================
   Search Input
   ============================================ */

.acs-m-search-input {
	flex: 1;
	padding: 10px 12px;
	font-size: 0.9rem;
	border: none !important;
	background: transparent;
	outline: none;
	color: #fff;
	line-height: 1.3;
	min-width: 0;
}

.acs-m-search-input::placeholder {
	color: #0274be !important;
	font-weight: 400 !important;
	opacity: 1 !important;
}

/* ============================================
   Dropdown Toggle Button
   ============================================ */

.acs-m-dropdown-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	color: rgb(255 255 255 / 80%);
	transition: color 0.2s ease, background-color 0.2s ease;
	flex-shrink: 0;
	border-left: 1px solid rgb(255 255 255 / 30%);
}

.acs-m-dropdown-toggle:hover {
	background: rgb(255 255 255 / 10%);
	color: #fff;
}

.acs-m-dropdown-toggle[aria-expanded="true"] {
	background: rgb(255 255 255 / 15%);
	color: #fff;
}

.acs-m-chevron-icon {
	transition: transform 0.2s ease;
}

.acs-m-dropdown-toggle[aria-expanded="true"] .acs-m-chevron-icon {
	transform: rotate(180deg);
}

/* ============================================
   Tree Dropdown
   ============================================ */

.acs-m-tree-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 2px solid #667eea;
	border-top: none;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
	z-index: 10000;
	max-height: 280px;
	overflow-y: auto;
	overflow-x: hidden;
	animation: acs-m-slide-down 0.2s ease;
}

.acs-m-tree-content {
	padding: 4px 0;
}

/* ============================================
   Tree Items
   ============================================ */

.acs-m-tree-item {
	display: flex;
	align-items: center;
	padding: 10px 12px;
	cursor: pointer;
	transition: background-color 0.15s ease;
	text-decoration: none;
	color: #0274be;
	font-size: 0.88rem;
	line-height: 1.3;
	border-bottom: 1px solid #f5f5f5;
}

.acs-m-tree-item:last-child {
	border-bottom: none;
}

.acs-m-tree-item:hover,
.acs-m-tree-item.acs-m-active-item {
	background: #f0f4ff;
}

/* Indent levels */
.acs-m-tree-item[data-level="0"] {
	padding-left: 12px;
}

.acs-m-tree-item[data-level="1"] {
	padding-left: 26px;
}

.acs-m-tree-item[data-level="2"] {
	padding-left: 40px;
}

.acs-m-tree-item[data-level="3"] {
	padding-left: 54px;
}

/* ============================================
   Tree Item Icons & Text
   ============================================ */

.acs-m-item-icon {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	margin-right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	font-size: 0.85rem;
}

.acs-m-tree-item.acs-m-condo .acs-m-item-icon {
	color: #0274be;
}

.acs-m-item-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ============================================
   Branch Toggle
   ============================================ */

.acs-m-branch-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-right: 4px;
	flex-shrink: 0;
	cursor: pointer;
	color: #999;
	transition: transform 0.2s ease, color 0.15s ease;
	border: none;
	background: none;
	padding: 0;
}

.acs-m-branch-toggle:hover {
	color: #667eea;
}

.acs-m-branch-toggle.acs-m-expanded {
	transform: rotate(90deg);
}

/* ============================================
   Highlights & States
   ============================================ */

.acs-m-current-term {
	background: #e8f4fd;
	border-left: 3px solid #4a90d9;
	font-weight: 600;
}

.acs-m-highlight {
	background: #fff3cd;
	font-weight: 700;
	border-radius: 2px;
	padding: 0 1px;
}

.acs-m-no-results {
	padding: 16px 12px;
	text-align: center;
	color: #999;
	font-size: 0.85rem;
	font-style: italic;
}

/* ============================================
   Scrollbar
   ============================================ */

.acs-m-tree-dropdown::-webkit-scrollbar {
	width: 5px;
}

.acs-m-tree-dropdown::-webkit-scrollbar-track {
	background: #f8f9fa;
}

.acs-m-tree-dropdown::-webkit-scrollbar-thumb {
	background: #ced4da;
	border-radius: 3px;
}

/* ============================================
   Animation
   ============================================ */

@keyframes acs-m-slide-down {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}
