/* Store search (inc/search.php, js/search.js): the header's glass pill with a gold submit, and a
 * white suggestion panel. Colours follow the header tokens in css/header.css. */
.zph-search {
 --zs-gold: #d8a51d; --zs-gold-pale: #f0d68c; --zs-ivory: #fbf5e9; --zs-ink: #29251f; --zs-muted: #7a6f60;
 --zs-line: #ece3d3; --zs-hover: #f8f2e6; --zs-glass: #17110a73; --zs-glass-strong: #17110ae6; --zs-glass-line: #f0d68c47;
 position: relative; display: block; inline-size: 100%; min-inline-size: 0; font-family: "ZPH Persian", Tahoma, sans-serif;
}
.zph-search-widget > .elementor-widget-container { inline-size: 100%; }

/* ---------- form ---------- */
.zph-search .zph-search__form {
 position: relative; display: flex; align-items: center; gap: 2px; min-block-size: 48px; margin: 0; padding: 4px;
 border: 1px solid var(--zs-glass-line); border-radius: 999px; background: var(--zs-glass);
 -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
 box-shadow: inset 0 1px 0 #fbf5e914, 0 10px 30px -14px #000a;
 transition: border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}
.zph-search .zph-search__form:hover { border-color: #f0d68c80; }
.zph-search:focus-within .zph-search__form, .zph-search[data-open] .zph-search__form {
 border-color: var(--zs-gold); background: var(--zs-glass-strong); box-shadow: 0 0 0 4px #d8a51d2e, 0 16px 36px -14px #000c;
}
.zph-search .zph-search__input {
 flex: 1; inline-size: 100%; min-inline-size: 0; block-size: 38px; min-block-size: 0; margin: 0; padding: 0 14px 0 4px;
 border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; color: var(--zs-ivory);
 text-align: start; font: 400 15px/38px "ZPH Persian", Tahoma, sans-serif; -webkit-appearance: none; appearance: none;
}
.zph-search .zph-search__input::placeholder { color: #fbf5e9a6; opacity: 1; transition: color 200ms ease; }
.zph-search:focus-within .zph-search__input::placeholder { color: #fbf5e966; }
.zph-search .zph-search__input::-webkit-search-cancel-button, .zph-search .zph-search__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.zph-search .zph-search__input:focus, .zph-search .zph-search__input:focus-visible { outline: 0; box-shadow: none; background: transparent; color: var(--zs-ivory); }
.zph-search button { font: inherit; }
.zph-search .zph-search__clear, .zph-search .zph-search__submit {
 flex: none; display: inline-flex; align-items: center; justify-content: center; inline-size: 38px; block-size: 38px;
 min-inline-size: 0; min-block-size: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer; line-height: 1;
}
.zph-search .zph-search__clear { inline-size: 30px; block-size: 30px; background: transparent; color: #fbf5e9b3; transition: color 160ms ease, background-color 160ms ease; }
.zph-search .zph-search__clear:hover { background: #fbf5e91a; color: var(--zs-ivory); }
.zph-search .zph-search__clear[hidden] { display: none; }
.zph-search .zph-search__submit {
 background: linear-gradient(180deg, #e6b73c, var(--zs-gold) 55%, #c4921a); color: #1d1407;
 box-shadow: 0 6px 16px -6px #d8a51daa, inset 0 1px 0 #fff6d466; transition: transform 200ms ease, filter 200ms ease;
}
.zph-search .zph-search__submit:hover { filter: brightness(1.08); transform: scale(1.06); }
.zph-search .zph-search__clear:focus-visible, .zph-search .zph-search__submit:focus-visible { outline: 2px solid var(--zs-gold-pale); outline-offset: 2px; }
.zph-search svg { inline-size: 16px; block-size: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.zph-search .zph-search__clear svg { inline-size: 14px; block-size: 14px; }
.zph-search .zph-search__spinner {
 flex: none; inline-size: 16px; block-size: 16px; margin-inline: 4px; border: 2px solid #f0d68c40; border-block-start-color: var(--zs-gold-pale);
 border-radius: 50%; opacity: 0; transition: opacity 160ms ease;
}
.zph-search[data-loading] .zph-search__spinner { opacity: 1; animation: zph-search-spin 700ms linear infinite; }
@keyframes zph-search-spin { to { transform: rotate(360deg); } }

/* ---------- panel ---------- */
.zph-search .zph-search__panel {
 position: absolute; z-index: 60; inset-block-start: calc(100% + 10px); inset-inline-end: 0;
 inline-size: max(100%, min(520px, calc(100vw - 32px))); max-block-size: min(72vh, 620px); overflow: auto; overscroll-behavior: contain;
 padding: 8px; border: 1px solid #f0d68c66; border-radius: 18px; background: #fff; color: var(--zs-ink);
 box-shadow: 0 28px 60px -24px #17110ab3, 0 2px 8px -2px #17110a26; text-align: start;
 transform-origin: top; animation: zph-search-in 180ms cubic-bezier(.2, .7, .2, 1);
}
.zph-search .zph-search__panel[hidden] { display: none; }
.zph-search .zph-search__panel[aria-busy="true"] .zph-search__body { opacity: .55; transition: opacity 120ms ease 120ms; }
@keyframes zph-search-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }

.zph-search .zph-search__group + .zph-search__group { margin-block-start: 6px; padding-block-start: 6px; border-block-start: 1px solid var(--zs-line); }
.zph-search .zph-search__heading { padding: 8px 10px 6px; color: var(--zs-muted); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.zph-search .zph-search__items { display: flex; flex-direction: column; gap: 2px; }
.zph-search .zph-search__group--categories .zph-search__items { flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 0 8px 6px; }
.zph-search [role="option"] { display: flex; align-items: center; gap: 12px; border-radius: 12px; color: var(--zs-ink); text-decoration: none; cursor: pointer; transition: background-color 120ms ease; }
.zph-search [role="option"][aria-selected="true"], .zph-search [role="option"]:hover { background: var(--zs-hover); color: var(--zs-ink); }
.zph-search [role="option"][aria-selected="true"] { box-shadow: inset 0 0 0 1px #d8a51d66; }
.zph-search mark { padding: 0; background: transparent; color: #9a6c00; font-weight: 700; }

.zph-search .zph-search__chip { gap: 6px; padding: 6px 12px; border: 1px solid var(--zs-line); border-radius: 999px; font-size: 13px; line-height: 1.6; }
.zph-search .zph-search__chip[aria-selected="true"], .zph-search .zph-search__chip:hover { border-color: #d8a51d99; box-shadow: none; }
.zph-search .zph-search__count { color: var(--zs-muted); font-size: 11px; }

.zph-search .zph-search__product { padding: 8px 10px; }
.zph-search .zph-search__thumb { flex: none; inline-size: 56px; block-size: 56px; overflow: hidden; border-radius: 10px; background: #f3ecdf; }
.zph-search .zph-search__thumb img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
.zph-search .zph-search__text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-inline-size: 0; }
.zph-search .zph-search__title { overflow: hidden; font-size: 14px; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }
.zph-search .zph-search__meta { color: var(--zs-muted); font-size: 12px; }
.zph-search .zph-search__price { color: var(--zs-ink); font-size: 13px; font-weight: 700; }
.zph-search .zph-search__price del { color: var(--zs-muted); font-weight: 400; }
.zph-search .zph-search__price ins { text-decoration: none; }
.zph-search .zph-search__badges { display: flex; flex: none; flex-direction: column; gap: 4px; }
.zph-search .zph-search__badge { padding: 2px 8px; border-radius: 999px; background: #fdf1cf; color: #7a5600; font-size: 11px; font-weight: 700; }
.zph-search .zph-search__badge--out { background: #f1ede6; color: var(--zs-muted); }

.zph-search .zph-search__post, .zph-search .zph-search__recent { padding: 9px 10px; font-size: 14px; }
.zph-search .zph-search__icon { flex: none; inline-size: 18px; block-size: 18px; border-radius: 4px; background: #f3ecdf; }
.zph-search .zph-search__icon--clock { border: 2px solid #c9bda9; border-radius: 50%; background: transparent; }
.zph-search .zph-search__recent--clear { justify-content: center; color: var(--zs-muted); font-size: 12px; }
.zph-search .zph-search__all { justify-content: center; padding: 11px 10px; background: #fbf7ef; color: #6b4b00; font-size: 14px; font-weight: 700; }
.zph-search .zph-search__group--all .zph-search__heading { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.zph-search .zph-search__note { margin: 4px 6px 6px; padding: 8px 12px; border-radius: 10px; background: #fdf6e3; color: #6b4b00; font-size: 13px; line-height: 1.7; }
.zph-search .zph-search__empty { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px 8px; font-size: 13px; line-height: 1.8; }
.zph-search .zph-search__empty strong { color: var(--zs-ink); font-size: 14px; }
.zph-search .zph-search__empty span { color: var(--zs-muted); }
.zph-search .zph-search__skeleton { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.zph-search .zph-search__bone { display: block; block-size: 56px; border-radius: 12px; background: linear-gradient(90deg, #f3ecdf 0%, #faf6ee 50%, #f3ecdf 100%) 0 0 / 200% 100%; animation: zph-search-shimmer 1.1s ease-in-out infinite; }
@keyframes zph-search-shimmer { to { background-position: -200% 0; } }

/* Results page note when only partial matches were found. */
.zph-search-note { margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; background: #fdf6e3; color: #6b4b00; font-size: 14px; line-height: 1.8; }

@media (max-width: 1024px) {
 .zph-search .zph-search__panel { inset-inline: 0; inline-size: auto; max-block-size: min(66svh, 560px); }
}
@media (max-width: 480px) {
 .zph-search .zph-search__product { gap: 10px; padding: 8px 6px; }
 .zph-search .zph-search__thumb { inline-size: 48px; block-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
 .zph-search .zph-search__panel, .zph-search .zph-search__bone, .zph-search[data-loading] .zph-search__spinner { animation: none; }
 .zph-search .zph-search__submit:hover { transform: none; }
}
