/* core/styles/overlays.css: البحث (من الفوق) + السلة فـ tiroir (من اليمين). tokens فقط. */

/* ---------- البحث ---------- */
.srch { position: fixed; inset: 0; z-index: var(--z-modal); }
.srch[hidden] { display: none; }
.srch-overlay { position: absolute; inset: 0; background: var(--c-overlay); opacity: 0; transition: opacity var(--t); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.srch.open .srch-overlay { opacity: 1; }
.srch-panel { position: absolute; left: 0; right: 0; top: 0; max-height: 86vh; overflow-y: auto; background: var(--c-bg); padding-bottom: 24px;
  transform: translateY(-100%); transition: transform var(--t) var(--ease); }
.srch.open .srch-panel { transform: none; }
.srch-bar { display: flex; align-items: center; gap: 12px; height: 68px; border-bottom: 1px solid var(--c-line); }
.srch-input { flex: 1; min-width: 0; border: 0; background: none; font: 400 1.2rem var(--f-body); color: var(--c-ink); padding: 10px 0; outline: none; }
.srch-input::-webkit-search-cancel-button { display: none; }
.srch-close { background: none; border: 0; font-size: var(--fs-sm); color: var(--c-muted); padding: 10px 0 10px 8px; }
.srch-close:hover { color: var(--c-ink); }
.srch-res { padding-top: 14px; }
.srch-hint { margin: 6px 0 12px; color: var(--c-muted); font-size: var(--fs-sm); }
.srch-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.srch-hit { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 8px 0; }
.srch-hit[aria-selected="true"] .srch-name, .srch-hit:hover .srch-name { text-decoration: underline; text-underline-offset: 3px; }
.srch-img { width: 48px; aspect-ratio: 3 / 4; background: var(--c-soft); overflow: hidden; }
.srch-img img { width: 100%; height: 100%; object-fit: cover; }
.srch-name { font-size: var(--fs-sm); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-price { font-size: var(--fs-sm); color: var(--c-ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- السلة فـ tiroir ---------- */
.cd { position: fixed; inset: 0; z-index: var(--z-drawer); }
.cd[hidden] { display: none; }
.cd-overlay { position: absolute; inset: 0; background: var(--c-overlay); opacity: 0; transition: opacity var(--t); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.cd.open .cd-overlay { opacity: 1; }
.cd-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(100vw, 420px); display: flex; flex-direction: column; background: var(--c-bg);
  transform: translateX(102%); transition: transform var(--t) var(--ease); padding-bottom: env(safe-area-inset-bottom, 0px); }
.cd.open .cd-panel { transform: none; }
.cd-head { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding: 0 20px; border-bottom: 1px solid var(--c-line); flex: none; }
.cd-head h2 { font-family: var(--f-body); font-size: var(--fs-md); font-weight: 500; }
.cd-close { width: 44px; height: 44px; margin-right: -12px; background: none; border: 0; font-size: 1.8rem; line-height: 1; font-weight: 300; }
.cd-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cd-empty { margin: auto; text-align: center; padding: 24px; }
.cd-empty p { color: var(--c-muted); margin: 0 0 18px; }
.cd-fs { padding: 14px 20px; background: var(--c-soft); font-size: var(--fs-sm); flex: none; }
.cd-fs p { margin: 0 0 8px; }
.cd-list { list-style: none; margin: 0; padding: 0 20px; overflow-y: auto; flex: 1; }
.cd-item { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--c-line); }
.cd-media { display: block; aspect-ratio: 3 / 4; background: var(--c-soft); overflow: hidden; }
.cd-media img { width: 100%; height: 100%; object-fit: cover; }
.cd-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cd-name { font-size: var(--fs-sm); line-height: 1.35; }
.cd-opts { font-size: var(--fs-xs); color: var(--c-muted); }
.cd-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.cd-price { font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; }
.cd-del { align-self: flex-start; margin-top: 6px; background: none; border: 0; padding: 0; font-size: var(--fs-xs); color: var(--c-muted); text-decoration: underline; text-underline-offset: 3px; }
.cd-del:hover { color: var(--c-ink); }
.cd-foot { flex: none; padding: 16px 20px 20px; border-top: 1px solid var(--c-line); background: var(--c-bg); }
.cd-sub { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fs-md); }
.cd-sub b { font-weight: 500; font-variant-numeric: tabular-nums; }
.cd-note { margin: 4px 0 14px; font-size: var(--fs-xs); color: var(--c-muted); }
.cd-go { display: block; width: 100%; text-align: center; }
.cd-link { display: block; text-align: center; margin-top: 12px; font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 4px; }

/* كمية صغيرة (السلة) */
.qty-sm { border-radius: 999px; }
.qty-sm button { width: 34px; height: 34px; }
.qty-sm .qty-val { width: 28px; line-height: 34px; font-size: var(--fs-sm); }
