/* DMP Search overlay — styled to sit naturally on top of the Glozin theme.
   Uses Glozin CSS variables where available, with safe fallbacks.
   Layout: fixed flex header (bar + tabs + status) + a single scrolling results
   area + fixed footer. No position:sticky (which caused the tabs to overlap the
   products on scroll); the scroll area is constrained with min-height:0. */

.dmp-search-lock { overflow: hidden; }

.dmp-search { position: fixed; inset: 0; z-index: 100000; display: none; }
.dmp-search.is-open { display: block; }

.dmp-search__backdrop { position: absolute; inset: 0; background: rgba(17,17,26,.55); backdrop-filter: saturate(120%) blur(2px); }

.dmp-search__panel {
	position: absolute; left: 50%; top: 0; transform: translateX(-50%);
	width: min(1180px, 100%); max-width: 100%; height: 100%; max-height: 100vh;
	display: flex; flex-direction: column; min-height: 0;
	background: var(--gz-body-background, #fff); color: var(--gz-body-color, #1a1a1a);
	box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden;
	animation: dmp-slide .18s ease-out;
}
@keyframes dmp-slide { from { transform: translate(-50%, -8px); opacity: .6; } to { transform: translate(-50%, 0); opacity: 1; } }

.dmp-search__bar { flex: 0 0 auto; position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid rgba(0,0,0,.08); background: inherit; }
.dmp-search__icon { display: inline-flex; color: var(--gz-color-primary, #6a4bff); flex: 0 0 auto; }
.dmp-search__input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; font-size: 18px; line-height: 1.4; background: transparent; color: inherit; padding: 8px 4px; font-family: var(--gz-body-font, inherit); }
.dmp-search__clear, .dmp-search__close { border: 0; background: transparent; cursor: pointer; font-size: 26px; line-height: 1; color: var(--gz-body-color, #444); padding: 4px 8px; border-radius: 8px; flex: 0 0 auto; }
.dmp-search__clear:hover, .dmp-search__close:hover { background: rgba(0,0,0,.06); }

/* tabs — fixed header row, horizontal scroll, never compress or overlap */
.dmp-search__tabs { flex: 0 0 auto; position: relative; z-index: 2; display: flex; gap: 6px; padding: 12px 20px 0; overflow-x: auto; border-bottom: 1px solid rgba(0,0,0,.08); background: inherit; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.dmp-search__tabs::-webkit-scrollbar { display: none; }
.dmp-search__tab { flex: 0 0 auto; border: 0; background: transparent; cursor: pointer; white-space: nowrap; padding: 10px 14px; font-size: 15px; font-weight: 600; color: var(--gz-body-color, #555); border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; }
.dmp-search__tab:hover { color: var(--gz-color-primary, #6a4bff); }
.dmp-search__tab.is-active { color: var(--gz-color-primary, #6a4bff); border-bottom-color: var(--gz-color-primary, #6a4bff); }
.dmp-search__count { display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 4px; font-size: 12px; font-weight: 700; border-radius: 999px; background: rgba(0,0,0,.06); color: inherit; }
.dmp-search__tab.is-active .dmp-search__count { background: var(--gz-color-primary, #6a4bff); color: #fff; }

.dmp-search__status { flex: 0 0 auto; padding: 10px 20px 0; font-size: 13px; color: rgba(0,0,0,.55); }

/* results — the ONLY scroll area; min-height:0 lets it size correctly in the flex column */
.dmp-search__results { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 20px; -webkit-overflow-scrolling: touch; }

/* Responsive grid: columns adapt with available width; never horizontal scroll. */
.dmp-search__grid.products, .dmp-search__skels { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; width: 100%; }
.dmp-search__grid.products li.product { width: auto !important; min-width: 0 !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; float: none !important; clear: none !important; }
.dmp-search__results img { opacity: 1 !important; }
.dmp-search__grid.products li.product img { max-width: 100%; height: auto; }

.dmp-search__empty { text-align: center; padding: 60px 20px; color: rgba(0,0,0,.5); font-size: 16px; grid-column: 1 / -1; }

.dmp-search__skel { height: 240px; border-radius: 10px; background: linear-gradient(90deg,#eee 25%,#f5f5f5 37%,#eee 63%); background-size: 400% 100%; animation: dmp-shimmer 1.2s infinite; }
@keyframes dmp-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.dmp-search__footer { flex: 0 0 auto; padding: 8px 20px 22px; text-align: center; }
.dmp-search__more { appearance: none; cursor: pointer; border: 1px solid var(--gz-color-primary, #6a4bff); background: var(--gz-color-primary, #6a4bff); color: #fff; font-weight: 700; padding: 12px 28px; border-radius: 999px; font-size: 15px; }
.dmp-search__more:hover { filter: brightness(1.05); }

/* tablet */
@media (max-width: 1024px) {
	.dmp-search__grid.products, .dmp-search__skels { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* mobile: exactly 2 per row, compact header */
@media (max-width: 680px) {
	.dmp-search__panel { width: 100%; }
	.dmp-search__grid.products, .dmp-search__skels { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
	.dmp-search__bar { padding: 14px 16px; }
	.dmp-search__tabs { padding: 10px 16px 0; }
	.dmp-search__tab { padding: 8px 11px; font-size: 14px; }
	.dmp-search__count { font-size: 11px; padding: 1px 6px; }
	.dmp-search__status { padding: 8px 16px 0; }
	.dmp-search__results { padding: 12px 16px; }
	.dmp-search__input { font-size: 16px; } /* avoid iOS zoom */
}
