/* ==========================================================================
   Zarna Jewels — site search (Oct 2026)
   1. The full-screen search overlay on every page (front/common/search-modal.blade.php, opened from the header's
      .zh-search and the phone tab bar; script in includes/front/script.blade.php).
   2. The results page /search?q=… (front/search/index.blade.php; its product cards come from listing-lux.css).
   Prefix zs-. Colours and fonts are the --zh-* tokens of header-lux.css. Mobile first, pixel sizes (the old theme
   changes the root font size below 1200px). Logical properties (inline-start/end) so the Arabic pages (dir="rtl")
   mirror themselves.
   ========================================================================== */

/* ---------- Overlay shell ---------- */
html.zs-open, html.zs-open body { overflow: hidden; }
.zs { position: fixed; inset: 0; z-index: 1080; font-family: var(--zh-sans); color: var(--zh-text); font-size: 15px; line-height: 1.5; }
.zs[hidden] { display: none; }
.zs *, .zs *::before, .zs *::after { box-sizing: border-box; }
.zs a { text-decoration: none; }
.zs :focus-visible { outline: 2px solid var(--zh-sage); outline-offset: 2px; }
.zs__scrim { position: absolute; inset: 0; background: rgba(18, 24, 21, 0.5); opacity: 0; transition: opacity 0.25s; }
.zs__panel {
    position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--zh-ivory);
    opacity: 0; transform: translateY(-12px); transition: opacity 0.25s, transform 0.32s var(--zh-ease);
}
.zs.is-open .zs__scrim { opacity: 1; }
.zs.is-open .zs__panel { opacity: 1; transform: none; }
.zs-wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .zs-wrap { padding: 0 28px; } }

/* ---------- Search field row ---------- */
.zs__head { flex: none; background: var(--zh-ivory); border-bottom: 1px solid var(--zh-line-2); padding-top: env(safe-area-inset-top, 0px); }
.zs__head-in { display: flex; align-items: center; gap: 10px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
@media (min-width: 768px) { .zs__head-in { min-height: 88px; gap: 18px; } }
@media (min-width: 1200px) { .zs__head-in { min-height: 104px; } }
.zs__form { position: relative; flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; padding: 6px 0; border-bottom: 1.5px solid var(--zh-ink); }
@media (min-width: 768px) { .zs__form { gap: 16px; padding: 10px 0; } }
.zs__icon { flex: none; color: var(--zh-emerald); }
.zs__input {
    flex: 1 1 auto; min-width: 0; width: 100%; margin: 0; padding: 6px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
    font: 400 21px/1.3 var(--zh-serif); color: var(--zh-ink); letter-spacing: -0.005em; outline: none; -webkit-appearance: none; appearance: none;
}
.zs__input::placeholder { color: var(--zh-muted); opacity: 0.85; }
/* phones: the placeholder ("Search rings, earrings, necklaces…") fits the narrow field */
@media (max-width: 767.98px) { .zs__input::placeholder { font-size: 17px; } }
.zs__input::-webkit-search-cancel-button, .zs__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.zs__input:focus { outline: none; box-shadow: none; }
@media (min-width: 768px) { .zs__input { font-size: 32px; } }
@media (min-width: 1200px) { .zs__input { font-size: 38px; } }
.zs__clear {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
    background: var(--zh-sage-soft); color: var(--zh-emerald); cursor: pointer; transition: background 0.2s, color 0.2s;
}
.zs__clear[hidden] { display: none; }
.zs__clear:hover { background: var(--zh-emerald); color: #fff; }
.zs__close {
    flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; min-width: 44px; padding: 0; border: 0; border-radius: 999px;
    background: transparent; color: var(--zh-ink); font: 600 13.5px var(--zh-sans); cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.zs__close:hover { background: rgba(31, 61, 51, 0.07); color: var(--zh-emerald); }
.zs__close-txt, .zs__kbd { display: none; }
@media (min-width: 768px) {
    .zs__close { padding: 0 16px 0 18px; border: 1px solid var(--zh-line); background: #fff; }
    .zs__close:hover { border-color: var(--zh-emerald); background: #fff; }
    .zs__close-txt { display: inline; }
    .zs__kbd { display: inline-block; padding: 2px 6px; border: 1px solid var(--zh-line); border-radius: 6px; background: var(--zh-ivory); font: 600 10.5px/1.2 var(--zh-sans); letter-spacing: 0.06em; color: var(--zh-muted); }
    .zs__close-x { width: 18px; height: 18px; }
}

/* ---------- Body ---------- */
.zs__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 22px 0 calc(40px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 768px) { .zs__body { padding-top: 32px; } }
.zs__results[hidden], .zs__idle[hidden], .zs__none[hidden], .zs__foot[hidden] { display: none; }
.zs__results + .zs__idle:not([hidden]) { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--zh-line-2); }
.zs__results[hidden] + .zs__idle { margin-top: 0; padding-top: 0; border-top: 0; }
.zs__status { margin: 0 0 14px; font-size: 13px; letter-spacing: 0.02em; color: var(--zh-muted); min-height: 1.2em; }
.zs__status:empty { display: none; }

/* result cards: photograph, name, collection, price */
.zs__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
@media (min-width: 640px) { .zs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 16px; } }
@media (min-width: 992px) { .zs__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .zs__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 26px 20px; } }
.zs-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: var(--zh-ink) !important; }
.zs-card__media { position: relative; display: block; aspect-ratio: 1 / 1; margin-bottom: 7px; border-radius: 14px; overflow: hidden; background: #f6f1e8; }
.zs-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6%; mix-blend-mode: multiply; transition: transform 0.7s var(--zh-ease); }
@media (hover: hover) { .zs-card:hover .zs-card__media img { transform: scale(1.04); } }
.zs-card__name { margin: 0; font: 600 13.5px/1.35 var(--zh-sans); color: var(--zh-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zs-card:hover .zs-card__name { color: var(--zh-emerald); }
.zs-card__meta { margin: 0; font-size: 12px; color: var(--zh-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zs-card__price { margin: 1px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.zs-card__price strong { font-size: 14px; font-weight: 700; color: var(--zh-ink); }
.zs-card__price s { font-size: 12px; color: var(--zh-muted); }
@media (min-width: 768px) { .zs-card__name { font-size: 14.5px; } .zs-card__price strong { font-size: 15px; } }

.zs__none { padding: 26px 0 6px; text-align: center; }
.zs__none-title { margin: 0 0 6px; font: 400 24px/1.25 var(--zh-serif); color: var(--zh-ink); text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.zs__none p { max-width: 460px; margin: 0 auto; color: var(--zh-muted); }
@media (min-width: 768px) { .zs__none { padding-top: 40px; } .zs__none-title { font-size: 30px; } }

.zs__foot { display: flex; justify-content: center; margin-top: 26px; }
.zs__all {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 28px; border-radius: 999px;
    background: var(--zh-emerald); color: #fff !important; font: 600 14.5px var(--zh-sans); transition: background 0.25s;
}
.zs__all:hover { background: var(--zh-emerald-2); }

/* ---------- Popular searches / Shop by (overlay and results page) ---------- */
.zs-suggest { display: grid; gap: 30px; }
@media (min-width: 992px) { .zs-suggest { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; } }
.zs-eyebrow { margin: 0 0 12px; font: 700 11px/1.3 var(--zh-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--zh-gold); }
.zs-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.zs-chip {
    display: inline-flex; align-items: center; min-height: 40px; padding: 7px 16px; border: 1px solid var(--zh-line); border-radius: 999px; background: #fff;
    color: var(--zh-ink) !important; font-size: 14px; line-height: 1.3; transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.zs-chip:hover { border-color: var(--zh-emerald); color: var(--zh-emerald) !important; background: var(--zh-sage-soft); }
.zs-cats { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; }
@media (min-width: 768px) { .zs-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; } }
@media (min-width: 992px) { .zs-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .zs-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.zs-cat {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 12px 14px; border: 1px solid var(--zh-line-2); border-radius: 14px;
    background: #fff; color: var(--zh-ink) !important; font: 400 17px/1.2 var(--zh-serif); transition: border-color 0.2s, box-shadow 0.2s;
}
.zs-cat svg { flex: none; color: var(--zh-gold); transition: transform 0.25s var(--zh-ease); }
.zs-cat:hover { border-color: var(--zh-emerald); box-shadow: 0 10px 24px -18px rgba(31, 61, 51, 0.5); }
.zs-cat:hover svg { transform: translateX(3px); }
html[dir="rtl"] .zs-cat svg { transform: scaleX(-1); }
html[dir="rtl"] .zs-cat:hover svg { transform: scaleX(-1) translateX(3px); }

/* ---------- Results page (/search?q=…) ---------- */
.zs-page__hero { background: linear-gradient(180deg, #f5ecda 0%, var(--zh-ivory) 100%); border-bottom: 1px solid var(--zh-line-2); padding: 22px 0 26px; }
@media (min-width: 768px) { .zs-page__hero { padding: 34px 0 38px; } }
.zs-page__title { margin: 0 0 18px; font: 400 clamp(28px, 4.4vw, 46px)/1.1 var(--zh-serif); color: var(--zh-ink); letter-spacing: -0.01em; text-transform: none; overflow-wrap: anywhere; }
.zs-page__form {
    display: flex; align-items: center; gap: 10px; width: 100%; max-width: 720px; margin: 0; padding: 0 6px 0 16px; border: 1px solid var(--zh-line); border-radius: 999px;
    background: #fff; color: var(--zh-emerald); transition: border-color 0.2s, box-shadow 0.2s;
}
.zs-page__form:focus-within { border-color: var(--zh-emerald); box-shadow: 0 0 0 3px rgba(72, 119, 99, 0.18); }
.zs-page__form svg { flex: none; }
.zs-page__input { flex: 1 1 auto; min-width: 0; height: 52px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; font: 400 16px var(--zh-sans); color: var(--zh-ink); outline: none; -webkit-appearance: none; appearance: none; }
.zs-page__input::-webkit-search-cancel-button, .zs-page__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.zs-page__input:focus { outline: none; box-shadow: none; }
.zs-page__go { flex: none; height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--zh-emerald); color: #fff; font: 600 13.5px var(--zh-sans); cursor: pointer; transition: background 0.25s; }
.zs-page__go:hover { background: var(--zh-emerald-2); }
@media (min-width: 768px) { .zs-page__input { height: 56px; font-size: 17px; } .zs-page__go { height: 44px; padding: 0 22px; } }
.zs-page__count { margin: 14px 0 0; font-size: 14px; color: var(--zh-muted); }
.zs-page__count strong { color: var(--zh-ink); }

.zs-page__body { padding-top: 6px; padding-bottom: 64px; }
@media (min-width: 768px) { .zs-page__body { padding-bottom: 88px; } }
.zs-page__paging { display: grid; justify-items: center; gap: 14px; margin-top: 34px; text-align: center; }
.zs-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.zs-pager__page, .zs-pager__arrow {
    display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--zh-line); border-radius: 999px;
    background: #fff; color: var(--zh-ink) !important; font: 600 14px var(--zh-sans); transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.zs-pager__page:hover, .zs-pager__arrow:hover { border-color: var(--zh-emerald); color: var(--zh-emerald) !important; }
.zs-pager__page.is-on { background: var(--zh-emerald); border-color: var(--zh-emerald); color: #fff !important; }
.zs-pager__arrow.is-off { opacity: 0.35; pointer-events: none; }
html[dir="rtl"] .zs-pager__arrow svg { transform: scaleX(-1); }

.zs-page__none { margin-top: 20px; padding: 44px 16px 48px; text-align: center; background: #fff; border: 1px solid var(--zh-line-2); border-radius: 18px; }
.zs-page__none h2 { margin: 0 0 8px; font: 400 26px/1.2 var(--zh-serif); color: var(--zh-ink); text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.zs-page__none p { max-width: 480px; margin: 0 auto; color: var(--zh-muted); }
.zs-page__help { margin-top: 18px !important; font-size: 14px; }
.zs-page__help a { color: var(--zh-sage) !important; text-decoration: underline; text-underline-offset: 3px; }
.zs-page__suggest { margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--zh-line-2); }
@media (min-width: 768px) { .zs-page__suggest { margin-top: 60px; padding-top: 44px; } }

@media (prefers-reduced-motion: reduce) {
    .zs *, .zs-page * { transition: none !important; animation: none !important; }
    .zs__panel { transform: none; }
}
