/**
 * Estilos da Busca Instantanea & Shortcodes - Afiliado Central
 * Versao 2.9.0
 */

/* Contêiner da Busca Simples */
.ac-busca-simples-wrap {
	position: relative;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ac-busca-input-box {
	position: relative;
	display: flex;
	align-items: center;
	background: #ffffff;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	padding: 4px 16px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
	transition: all 0.2s ease;
}

.ac-busca-input-box:focus-within {
	border-color: #2563eb;
	box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

.ac-busca-icon {
	font-size: 18px;
	margin-right: 10px;
	color: #64748b;
	user-select: none;
}

.ac-busca-input-field {
	flex: 1;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	padding: 10px 0 !important;
	font-size: 15px !important;
	color: #0f172a !important;
}

.ac-busca-btn-limpar {
	background: none;
	border: none;
	font-size: 20px;
	color: #94a3b8;
	cursor: pointer;
	padding: 0 4px;
	line-height: 1;
}

.ac-busca-btn-limpar:hover {
	color: #ef4444;
}

/* Dropdown Flutuante de Autocomplete */
.ac-busca-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
	z-index: 99999;
	max-height: 420px;
	overflow-y: auto;
	padding: 8px 0;
}

.ac-busca-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	text-decoration: none !important;
	color: #0f172a !important;
	border-bottom: 1px solid #f1f5f9;
	transition: background 0.15s ease;
}

.ac-busca-item:last-child {
	border-bottom: none;
}

.ac-busca-item:hover, .ac-busca-item.ac-item-focus {
	background: #f0fdf4;
}

.ac-busca-item-img {
	width: 50px;
	height: 50px;
	object-fit: contain;
	border-radius: 6px;
	background: #fff;
	border: 1px solid #e2e8f0;
	padding: 2px;
	flex-shrink: 0;
}

.ac-busca-item-info {
	flex: 1;
	min-width: 0;
}

.ac-busca-item-nome {
	font-size: 14px;
	font-weight: 700;
	color: #1e293b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 2px;
}

.ac-busca-item-loja {
	font-size: 11px;
	color: #64748b;
	display: flex;
	align-items: center;
	gap: 4px;
}

.ac-busca-item-preco-box {
	text-align: right;
	flex-shrink: 0;
}

.ac-busca-item-preco {
	font-size: 15px;
	font-weight: 800;
	color: #16a34a;
}

.ac-busca-item-ant {
	font-size: 11px;
	color: #94a3b8;
	text-decoration: line-through;
}

.ac-busca-item-badge {
	display: inline-block;
	background: #ef4444;
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
	padding: 1px 6px;
	border-radius: 10px;
	margin-left: 4px;
}

.ac-busca-empty, .ac-busca-loading-text {
	padding: 16px;
	text-align: center;
	font-size: 13px;
	color: #64748b;
}

/* Shortcode 2: Cards Horizontais de Categorias */
.ac-busca-categorias-container {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	margin-bottom: 30px;
}

.ac-busca-cats-row {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 8px;
	scrollbar-width: thin;
}

.ac-cat-card {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 30px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.2s ease;
}

.ac-cat-card:hover, .ac-cat-card.active {
	background: #16a34a;
	color: #ffffff;
	border-color: #15803d;
	box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.ac-cat-card-count {
	background: rgba(0, 0, 0, 0.08);
	padding: 2px 7px;
	border-radius: 10px;
	font-size: 11px;
}

.ac-cat-card.active .ac-cat-card-count {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
}

/* Shortcode 3: Vitrine Completa */
.ac-busca-vitrine-wrapper {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 24px;
	margin-bottom: 30px;
}

.ac-vitrine-header {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

@media (min-width: 768px) {
	.ac-vitrine-header {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

.ac-vitrine-search-bar {
	position: relative;
	display: flex;
	align-items: center;
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	padding: 4px 14px;
	flex: 1;
}

.ac-vitrine-input {
	border: none !important;
	outline: none !important;
	width: 100% !important;
	padding: 8px 0 !important;
	font-size: 14px !important;
}

.ac-vitrine-filters-row {
	display: flex;
	gap: 10px;
}

.ac-vitrine-select-cat, .ac-vitrine-select-ordem {
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 13px;
	background: #fff;
	color: #334155;
}

.ac-vitrine-grid {
	display: grid;
	gap: 16px;
}

.ac-grid-cols-2 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ac-grid-cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ac-grid-cols-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.ac-vitrine-card-item {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.2s, box-shadow 0.2s;
}

.ac-vitrine-card-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.ac-vitrine-card-img-box {
	position: relative;
	height: 180px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	border-bottom: 1px solid #f1f5f9;
}

.ac-vitrine-card-img-box img {
	max-height: 100%;
	max-width: 100%;
	object-fit: contain;
}

.ac-vitrine-card-body {
	padding: 14px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.ac-vitrine-card-title {
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 8px;
	line-height: 1.3;
	height: 38px;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ac-vitrine-card-price-row {
	margin-top: auto;
	margin-bottom: 12px;
}

.ac-vitrine-card-btn {
	display: block;
	text-align: center;
	background: #2563eb;
	color: #fff !important;
	font-weight: 700;
	font-size: 13px;
	padding: 8px 12px;
	border-radius: 8px;
	text-decoration: none !important;
	transition: background 0.2s;
}

.ac-vitrine-card-btn:hover {
	background: #1d4ed8;
}
