/* DM Search - styles for the DM Print Modern theme */

.dm-search-wrapper {
	position: relative;
	width: 100%;
	max-width: 620px;
	margin-left: auto;
	margin-right: auto;
	font-family: inherit;
	z-index: 9999;
}
.dm-header .dm-search-wrapper { margin-left: 0; margin-right: 0; }
.dm-search-form { position: relative; width: 100%; margin: 0 !important; }

/* Bar */
.dm-search-input-wrap {
	display: flex;
	align-items: center !important;
	position: relative;
	background: #fff;
	border: 2px solid transparent;
	border-radius: 50px;
	box-shadow: 0 2px 12px rgba(0,0,0,.08), 0 0 0 1.5px #e2e8f0;
	transition: box-shadow .22s ease;
	overflow: hidden;
	height: 46px !important;
	padding: 0 5px 0 0 !important;
	box-sizing: border-box !important;
}
.dm-search-input-wrap:focus-within {
	box-shadow: 0 4px 20px rgba(26,115,232,.18), 0 0 0 2px #1a73e8;
}
.dm-search-icon {
	display: flex;
	align-items: center;
	padding: 0 6px 0 16px;
	color: #1a73e8;
	flex-shrink: 0;
	pointer-events: none;
}
.dm-search-icon svg { width: 18px; height: 18px; stroke-width: 2.5; }

.dm-search-input {
	flex: 1;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	padding: 0 8px !important;
	margin: 0 !important;
	font-size: 15px !important;
	font-weight: 400 !important;
	color: #1a202c !important;
	min-width: 0;
	height: 100% !important;
	min-height: 0 !important;
	line-height: normal !important;
	-webkit-appearance: none;
}
.dm-search-input::placeholder { color: #94a3b8 !important; }
.dm-search-input::-webkit-search-cancel-button { display: none; }

.dm-search-clear {
	display: none;
	align-items: center;
	justify-content: center;
	width: 22px; height: 22px;
	border-radius: 50%;
	background: #e2e8f0;
	color: #64748b;
	font-size: 13px;
	line-height: 1 !important;
	cursor: pointer;
	flex-shrink: 0;
	margin: 0 8px 0 0 !important;
	align-self: center !important;
}
.dm-search-clear.visible { display: flex; }
.dm-search-clear:hover { background: #cbd5e1; color: #1e293b; }

.dm-search-spinner {
	display: none;
	width: 18px; height: 18px;
	border: 2px solid #e2e8f0;
	border-top-color: #1a73e8;
	border-radius: 50%;
	animation: dm-spin .7s linear infinite;
	margin: 0 10px 0 0 !important;
	flex-shrink: 0;
	align-self: center !important;
}
.dm-search-spinner.visible { display: block; }
@keyframes dm-spin { to { transform: rotate(360deg); } }

.dm-search-input-wrap .dm-search-submit {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	align-self: center !important;
	background: #1a73e8;
	color: #fff;
	border: none;
	height: 36px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 18px !important;
	font-size: 13px !important;
	font-weight: 600;
	line-height: 1 !important;
	letter-spacing: .03em;
	text-transform: uppercase;
	cursor: pointer;
	border-radius: 40px !important;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background .18s;
}
.dm-search-input-wrap .dm-search-submit:hover { background: #1557b0; }

/* Dropdown */
.dm-search-dropdown {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	width: max(100%, 460px);
	max-width: calc(100vw - 24px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 40px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.06);
	z-index: 99999;
	overflow: hidden;
	display: flex;
	flex-direction: row;
	align-items: stretch;
	max-height: 70vh;
}
.dm-search-dropdown[hidden] { display: none !important; }

.dm-dropdown-inner {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	max-height: 70vh;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #e2e8f0 transparent;
}
.dm-dropdown-inner .dm-search-item { width: 100%; box-sizing: border-box; }

.dm-section-label {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: #94a3b8;
	padding: 12px 16px 4px;
}

/* Categories */
.dm-search-cat-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 16px;
	text-decoration: none !important;
	color: #374151 !important;
	font-size: 13px;
	border-bottom: 1px solid #f1f5f9;
}
.dm-search-cat-item:hover, .dm-search-cat-item.dm-active { background: #eff6ff; color: #1a73e8 !important; }
.dm-cat-icon { font-size: 15px; }
.dm-cat-name { flex: 1; font-weight: 500; }
.dm-cat-count { color: #94a3b8; font-size: 11px; }

/* Products */
.dm-product-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none !important;
	color: #1a202c !important;
	border-bottom: 1px solid #f8fafc;
	cursor: pointer;
}
.dm-product-item:last-of-type { border-bottom: none; }
.dm-product-item:hover, .dm-product-item.dm-active { background: #f8faff; }
.dm-product-item[aria-selected="true"] { background: #eff6ff; }

.dm-product-thumb {
	flex-shrink: 0;
	width: 54px; height: 54px;
	border-radius: 10px;
	overflow: hidden;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.dm-product-thumb img { width: 54px !important; height: 54px !important; object-fit: cover; display: block; }

.dm-product-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dm-product-title {
	font-size: 13.5px;
	font-weight: 500;
	color: #0f172a;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.dm-product-title mark, .dm-cat-name mark { background: #fef9c3; color: inherit; padding: 0 1px; border-radius: 2px; }
.dm-product-cat { font-size: 11px; color: #1a73e8; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.dm-product-sku { font-size: 11px; color: #94a3b8; }

.dm-product-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; min-width: 64px; }
.dm-product-price { font-size: 14px; font-weight: 700; color: #0f172a; white-space: nowrap; }
.dm-product-price del { color: #94a3b8; font-weight: 400; font-size: 12px; margin-right: 3px; }
.dm-product-price ins { text-decoration: none; color: #e53935; }

.dm-sale-badge { background: #e53935; color: #fff; font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 20px; letter-spacing: .06em; }
.dm-oos-badge { background: #f1f5f9; color: #94a3b8; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 20px; }

/* See all */
.dm-search-see-all {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 13px 16px;
	background: #f8faff;
	border-top: 1px solid #e8eef8;
	color: #1a73e8 !important;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none !important;
	cursor: pointer;
}
.dm-search-see-all:hover { background: #eff6ff; }
.dm-total { color: #94a3b8; font-weight: 400; font-size: 13px; margin-left: 2px; }

/* No results + correction notice */
.dm-no-results { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; color: #64748b; font-size: 14px; width: 100%; }
.dm-no-results-icon { font-size: 30px; opacity: .5; }
.dm-corrected { padding: 10px 16px; font-size: 13px; color: #475569; background: #fffbeb; border-bottom: 1px solid #fde68a; }
.dm-corrected strong { color: #0f172a; }
.dm-corrected span { color: #64748b; font-size: 12px; }

/* Hover preview panel (off by default) */
.dm-details-box { flex: 0 0 220px; width: 220px; max-height: 70vh; overflow-y: auto; border-left: 1px solid #f1f5f9; background: #fafbff; display: flex; flex-direction: column; }
.dm-details-img { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #f1f5f9; }
.dm-details-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dm-details-body { padding: 14px 12px; display: flex; flex-direction: column; gap: 5px; }
.dm-details-title { font-size: 12.5px; font-weight: 600; color: #0f172a; line-height: 1.4; }
.dm-details-cat { font-size: 10.5px; color: #1a73e8; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.dm-details-sku { font-size: 11px; color: #94a3b8; }
.dm-details-price { font-size: 17px; font-weight: 700; color: #0f172a; margin-top: 4px; }
.dm-details-btn { display: block; margin-top: 10px; padding: 8px 12px; background: #1a73e8; color: #fff !important; text-align: center; border-radius: 8px; font-size: 12px; font-weight: 600; text-decoration: none !important; }

/* Mobile overlay */
.dm-search-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 9998; backdrop-filter: blur(3px); }
body.dm-search-open .dm-search-overlay { display: block; }

@media (max-width: 992px) {
	.dm-search-wrapper.dm-overlay-open {
		position: fixed;
		top: 0; left: 0; right: 0;
		z-index: 99999;
		max-width: 100%;
		padding: 12px 14px;
		background: #fff;
		box-shadow: 0 4px 24px rgba(0,0,0,.12);
	}
	.dm-search-wrapper.dm-overlay-open .dm-search-dropdown {
		position: static;
		width: auto;
		max-width: none;
		max-height: calc(100vh - 100px);
		border-radius: 12px;
		margin-top: 10px;
		flex-direction: column;
	}
	.dm-search-wrapper.dm-overlay-open .dm-dropdown-inner { max-height: calc(100vh - 100px); }
}
@media (max-width: 900px) {
	.dm-details-box { display: none !important; }
	.dm-search-dropdown { width: 100%; }
}
