/* ==========================================================================
   Search overlay (header search icon) — inc/search-overlay.php + assets/js/header.js
   Smallest text 16px.
   ========================================================================== */

html.vd-so-open { overflow: hidden; }
html.vd-so-open .vd-contact-badge { display: none; }

.vd-so {
	position: fixed; inset: 0; z-index: 9000;
	display: flex; align-items: flex-start; justify-content: center;
	padding: 16vh 16px 40px; overflow-y: auto;
	background: rgba(30, 8, 20, .42);
	-webkit-backdrop-filter: blur(18px) saturate(120%); backdrop-filter: blur(18px) saturate(120%);
	opacity: 0; visibility: hidden;
	transition: opacity .25s ease, visibility 0s linear .25s;
	font-family: var(--vd-font-sans);
}
.vd-so.is-open { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.admin-bar .vd-so { top: 32px; }
@media (max-width: 782px) { .admin-bar .vd-so { top: 46px; } }

.vd-so__logo { position: absolute; top: 24px; left: 40px; display: block; }
.vd-so__logo img { height: 48px; width: auto; display: block; }
.vd-so__logotext { color: #fff; font-family: var(--vd-font-serif); font-size: 1.75rem; letter-spacing: 4px; text-transform: uppercase; }
.vd-so__close {
	position: absolute; top: 24px; right: 40px; width: 48px; height: 48px; border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .12); color: #fff;
	display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .15s ease;
}
.vd-so__close:hover { background: rgba(255, 255, 255, .25); }

.vd-so__inner { width: 100%; max-width: 760px; transform: translateY(16px); transition: transform .3s ease; }
.vd-so.is-open .vd-so__inner { transform: none; }
.vd-so__title {
	font-family: var(--vd-font-serif); font-style: italic; font-weight: 300; color: #fff; text-align: center;
	font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; margin: 0 0 28px;
}

/* Bar */
.vd-so__bar {
	display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 20px;
	padding: 10px 10px 10px 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.vd-so__ic { flex: 0 0 auto; color: var(--vd-muted); }
.vd-so__input {
	flex: 1; min-width: 0; border: 0; outline: 0; background: none; box-shadow: none;
	font: inherit; font-size: 1.375rem; font-weight: 500; padding: 10px 0; color: var(--vd-ink);
}
.vd-so__input::placeholder { color: #9c948f; }
.vd-so__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.vd-so__go {
	flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; border: 0; padding: 0;
	background: var(--vd-accent); color: var(--vd-ink); display: grid; place-items: center; cursor: pointer;
	transition: transform .15s ease;
}
.vd-so__go:hover { transform: scale(1.05); }

/* Chips */
.vd-so__chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.vd-so__chip {
	display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--vd-ink);
	border: 1.5px solid transparent; border-radius: 14px; padding: 10px 16px;
	font-family: var(--vd-font-sans); font-size: 1.0625rem; font-weight: 600; line-height: 1.2;
	cursor: pointer; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
	transition: background .15s, color .15s, border-color .15s;
}
.vd-so__chip svg { width: 18px; height: 18px; flex: 0 0 auto; }
.vd-so__chip:hover { border-color: var(--vd-wine); }
.vd-so__chip.is-on { background: var(--vd-wine); color: #fff; }

/* Popular */
.vd-so__popular { margin-top: 36px; color: #fff; }
.vd-so__phead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.vd-so__plabel { margin: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.vd-so__all { color: #fff; font-size: 1rem; font-weight: 700; text-transform: uppercase; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.vd-so__all:hover { text-decoration: underline; text-underline-offset: 4px; }
.vd-so__all[hidden] { display: none; }

.vd-so__terms { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.vd-so__terms a { color: #fff; text-decoration: none; font-size: 1.125rem; border-bottom: 1px solid rgba(255, 255, 255, .4); }
.vd-so__terms a:hover { border-color: #fff; }

/* Mini cards */
.vd-so__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.vd-so__card {
	min-width: 0;
	display: flex; align-items: center; gap: 14px; background: #fff; color: var(--vd-ink);
	border-radius: 16px; padding: 10px 16px 10px 10px; text-decoration: none;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
	transition: transform .15s ease, box-shadow .15s ease;
	animation: vd-so-in .25s ease both;
}
.vd-so__card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, .2); }
.vd-so__thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--vd-cream, #f6f1ec); }
.vd-so__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; }
.vd-so__thumb--bottle img { object-fit: contain; padding: 4px 0; }
.vd-so__ctext { min-width: 0; flex: 1; }
.vd-so__cname { display: block; font-size: 1.125rem; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-so__cmeta { display: block; font-size: 1rem; color: var(--vd-muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-so__cmeta b { color: var(--vd-coral); font-weight: 700; }
.vd-so__arrow { flex: 0 0 auto; color: var(--vd-muted); transition: transform .15s ease; }
.vd-so__card:hover .vd-so__arrow { transform: translateX(3px); color: var(--vd-ink); }
@keyframes vd-so-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Never wider than the screen (Firefox otherwise stretched it to fit the chips). */
.vd-so__inner { min-width: 0; }

@media (max-width: 620px) {
	.vd-so { padding: 84px 16px 32px; }
	.vd-so__logo { top: 20px; left: 16px; }
	.vd-so__logo img { height: 36px; }
	.vd-so__close { top: 16px; right: 16px; }
	.vd-so__title { font-size: 2rem; margin-bottom: 18px; }
	.vd-so__bar { padding: 6px 6px 6px 16px; border-radius: 16px; }
	.vd-so__input { font-size: 1.125rem; }
	.vd-so__go { width: 46px; height: 46px; border-radius: 12px; }

	/* Type chips wrap onto a second line instead of running off the side. */
	.vd-so__chips { flex-wrap: wrap; gap: 8px; margin-top: 12px; }
	.vd-so__chip { padding: 8px 12px; border-radius: 12px; }

	/* Shorter results: 3 compact rows so the list fits on the screen. */
	.vd-so__popular { margin-top: 22px; }
	.vd-so__cards { grid-template-columns: minmax(0, 1fr); gap: 8px; } /* minmax(0…) lets long names shorten with "…" instead of pushing out */
	.vd-so__cards > .vd-so__card:nth-child(n+4) { display: none; }
	.vd-so__card { padding: 8px 12px 8px 8px; gap: 12px; border-radius: 14px; }
	.vd-so__thumb { flex-basis: 52px; width: 52px; height: 52px; border-radius: 10px; }
	.vd-so__cname { font-size: 1.0625rem; }
	.vd-so__terms { gap: 6px 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.vd-so, .vd-so__inner { transition: none; }
	.vd-so__card { animation: none; }
}

/* Live results while typing */
.vd-so__popular { transition: opacity .2s ease; }
.vd-so__popular.is-loading { opacity: .6; }
.vd-so__group + .vd-so__group { margin-top: 22px; }
.vd-so__glabel { margin: 0 0 10px; font-size: 1rem; font-weight: 700; color: #fff; opacity: .9; }
.vd-so__cname mark { background: var(--vd-accent); color: var(--vd-ink); border-radius: 3px; padding: 0 1px; }
.vd-so__none { margin: 0; color: #fff; font-size: 1.125rem; opacity: .9; }