/* =====================================================================
   LFSport — Search & YMM
   Custom styles. Sem dependências externas.
   ===================================================================== */

:root {
	--lfs-orange:        #FF6600;
	--lfs-orange-hover:  #E65A00;
	--lfs-orange-soft:   #FFE8D6;
	--lfs-orange-text:   #993C1D;
	--lfs-bg:            #FFFFFF;
	--lfs-bg-soft:       #F7F7F5;
	--lfs-bg-tertiary:   #EFEFED;
	--lfs-text:          #1A1A1A;
	--lfs-text-muted:    #6B6B6B;
	--lfs-text-faint:    #A0A0A0;
	--lfs-border:        rgba(0, 0, 0, 0.10);
	--lfs-border-strong: rgba(0, 0, 0, 0.20);
	--lfs-radius:        12px;
	--lfs-radius-sm:     8px;
	--lfs-shadow:        0 8px 32px rgba(0, 0, 0, 0.08);
	--lfs-shadow-sm:     0 4px 16px rgba(0, 0, 0, 0.06);
}


/* =====================================================================
   SEARCH BAR
   ===================================================================== */

.lfsport-search {
	position: relative;
	width: 100%;
	max-width: 480px;
	font-family: inherit;
}

.lfsport-search__field {
	position: relative;
	display: flex;
	align-items: center;
}

.lfsport-search__icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--lfs-orange);
	display: flex;
	pointer-events: none;
}

.lfsport-search__input {
	width: 100%;
	height: 42px;
	padding: 0 40px 0 42px;
	background: #FFF;
	border: 1px solid var(--lfs-border);
	border-radius: 999px;
	font-size: 14px;
	color: var(--lfs-text);
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	-webkit-appearance: none;
	appearance: none;
}

.lfsport-search__input:focus {
	border-color: var(--lfs-orange);
	box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.15);
}

.lfsport-search__input::placeholder {
	color: var(--lfs-text-muted);
}

.lfsport-search__input::-webkit-search-cancel-button {
	display: none;
}

.lfsport-search__clear {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: var(--lfs-text-muted);
	cursor: pointer;
	padding: 6px;
	display: flex;
	border-radius: 50%;
	transition: background 0.1s, color 0.1s;
}

.lfsport-search__clear:hover {
	background: rgba(0, 0, 0, 0.06);
	color: var(--lfs-text);
}


/* Dropdown ----------------------------------------------------------- */

.lfsport-search__dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: var(--lfs-bg);
	border: 1px solid var(--lfs-border);
	border-radius: var(--lfs-radius);
	box-shadow: var(--lfs-shadow);
	padding: 12px;
	max-height: 70vh;
	overflow-y: auto;
	z-index: 9999;
}

.lfsport-search__section {
	font-size: 11px;
	color: var(--lfs-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin: 8px 0 6px 4px;
	font-weight: 500;
}

.lfsport-search__section:first-child { margin-top: 4px; }

.lfsport-search__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: var(--lfs-radius-sm);
	text-decoration: none;
	color: inherit;
	transition: background 0.1s;
}

.lfsport-search__item + .lfsport-search__item {
	margin-top: 2px;
}

.lfsport-search__item:hover,
.lfsport-search__item:focus-visible {
	background: var(--lfs-bg-soft);
	outline: none;
}

.lfsport-search__item img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 6px;
	background: var(--lfs-bg-soft);
	flex-shrink: 0;
}

.lfsport-search__item-info {
	flex: 1;
	min-width: 0;
}

.lfsport-search__item-name {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--lfs-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.3;
}

.lfsport-search__item-sub {
	margin: 2px 0 0;
	font-size: 12px;
	color: var(--lfs-text-muted);
	line-height: 1.3;
}

.lfsport-search__item-price {
	font-size: 14px;
	font-weight: 500;
	color: var(--lfs-text);
	white-space: nowrap;
	flex-shrink: 0;
}

.lfsport-search__item-price del,
.lfsport-search__item-price .woocommerce-Price-amount {
	font-size: 13px;
}

.lfsport-search__item-price del {
	color: var(--lfs-text-faint);
	font-weight: 400;
	margin-right: 4px;
}

.lfsport-search__item-price ins {
	color: var(--lfs-orange);
	text-decoration: none;
}

.lfsport-search__more {
	display: block;
	text-align: center;
	padding: 12px;
	margin-top: 8px;
	border-top: 1px solid var(--lfs-border);
	font-size: 13px;
	color: var(--lfs-orange);
	font-weight: 500;
	text-decoration: none;
	transition: color 0.1s;
}

.lfsport-search__more:hover {
	color: var(--lfs-orange-hover);
	text-decoration: underline;
}

.lfsport-search__empty,
.lfsport-search__loading {
	padding: 20px 16px;
	text-align: center;
	font-size: 13px;
	color: var(--lfs-text-muted);
}


/* =====================================================================
   YMM WIDGET
   ===================================================================== */

.lfsport-ymm {
	background: var(--lfs-bg);
	border: 1px solid var(--lfs-border);
	border-radius: var(--lfs-radius);
	padding: 20px 24px;
	font-family: inherit;
	color: var(--lfs-text);
}

.lfsport-ymm__header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
}

.lfsport-ymm__icon {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: var(--lfs-orange);
	color: #FFF;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.lfsport-ymm__title {
	margin: 0;
	font-weight: 500;
	font-size: 16px;
	line-height: 1.3;
}

.lfsport-ymm__subtitle {
	margin: 2px 0 0;
	font-size: 13px;
	color: var(--lfs-text-muted);
	line-height: 1.3;
}


/* Grid + selects ----------------------------------------------------- */

.lfsport-ymm__grid {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr auto;
	gap: 12px;
	align-items: end;
}

.lfsport-ymm__field {
	min-width: 0;
}

.lfsport-ymm__field > label {
	display: block;
	font-size: 11px;
	color: var(--lfs-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
	font-weight: 500;
}

.lfsport-ymm__select {
	position: relative;
	background: var(--lfs-bg-soft);
	border: 1px solid var(--lfs-border);
	border-radius: var(--lfs-radius-sm);
	padding: 10px 36px 10px 14px;
	font-size: 13px;
	color: var(--lfs-text);
	cursor: pointer;
	user-select: none;
	transition: border-color 0.1s, background 0.1s;
	height: 40px;
	display: flex;
	align-items: center;
}

.lfsport-ymm__select:hover {
	border-color: var(--lfs-border-strong);
}

.lfsport-ymm__select[data-disabled="true"] {
	opacity: 0.55;
	cursor: not-allowed;
}

.lfsport-ymm__select[data-disabled="true"]:hover {
	border-color: var(--lfs-border);
}

.lfsport-ymm__select--selected {
	background: #FFF;
	border-color: var(--lfs-orange);
	font-weight: 500;
}

.lfsport-ymm__value {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lfsport-ymm__chevron {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--lfs-text-muted);
	pointer-events: none;
	transition: transform 0.15s;
}

.lfsport-ymm__select:has(.lfsport-ymm__options:not([hidden])) .lfsport-ymm__chevron {
	transform: translateY(-50%) rotate(180deg);
}


/* Options dropdown --------------------------------------------------- */

.lfsport-ymm__options {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	list-style: none;
	margin: 0;
	padding: 4px;
	background: #FFF;
	border: 1px solid var(--lfs-border);
	border-radius: var(--lfs-radius-sm);
	box-shadow: var(--lfs-shadow-sm);
	max-height: 240px;
	overflow-y: auto;
	z-index: 100;
}

.lfsport-ymm__options li {
	padding: 8px 12px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	transition: background 0.1s, color 0.1s;
	line-height: 1.3;
}

.lfsport-ymm__options li:hover {
	background: var(--lfs-orange-soft);
	color: var(--lfs-orange-text);
}

.lfsport-ymm__loading,
.lfsport-ymm__empty {
	padding: 12px !important;
	text-align: center;
	color: var(--lfs-text-muted);
	cursor: default !important;
}

.lfsport-ymm__loading:hover,
.lfsport-ymm__empty:hover {
	background: transparent !important;
	color: var(--lfs-text-muted) !important;
}


/* Submit button ------------------------------------------------------ */

.lfsport-ymm__submit {
	background: var(--lfs-orange);
	color: #FFF;
	border: none;
	padding: 0 20px;
	border-radius: var(--lfs-radius-sm);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	height: 40px;
	white-space: nowrap;
	transition: background 0.15s, opacity 0.15s;
	font-family: inherit;
}

.lfsport-ymm__submit:hover:not(:disabled) {
	background: var(--lfs-orange-hover);
}

.lfsport-ymm__submit:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}


/* Saved bike pill ---------------------------------------------------- */

.lfsport-ymm__saved {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--lfs-border);
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.lfsport-ymm__saved-label {
	font-size: 11px;
	color: var(--lfs-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 500;
}

.lfsport-ymm__saved-pill {
	background: var(--lfs-orange-soft);
	color: var(--lfs-orange-text);
	padding: 4px 4px 4px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.lfsport-ymm__saved-clear {
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	padding: 4px;
	display: flex;
	border-radius: 50%;
	opacity: 0.7;
	transition: opacity 0.1s, background 0.1s;
}

.lfsport-ymm__saved-clear:hover {
	opacity: 1;
	background: rgba(153, 60, 29, 0.15);
}

.lfsport-ymm__saved-hint {
	font-size: 12px;
	color: var(--lfs-text-muted);
}


/* =====================================================================
   RESPONSIVE — mobile
   ===================================================================== */

@media (max-width: 640px) {
	.lfsport-ymm {
		padding: 16px;
	}
	.lfsport-ymm__grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	.lfsport-ymm__submit {
		width: 100%;
		margin-top: 4px;
	}
	.lfsport-search {
		max-width: 100%;
	}
	.lfsport-search__dropdown {
		max-height: 60vh;
	}
	.lfsport-ymm__saved-hint {
		display: none;
	}
}
