/* ===== المتجر: كتالوج + سلة ===== */
.shop { position: fixed; inset: 0; z-index: 2000; display: flex; justify-content: center; background: #fff; animation: shfade .2s ease both; }
.shop[hidden] { display: none; }
body.shop-open { overflow: hidden; }
.shop-panel { position: relative; width: 100%; max-width: 640px; display: flex; flex-direction: column; background: #fff; min-height: 0; }
@media (min-width: 840px) {
  .shop { background: rgba(15, 23, 35, .5); align-items: center; padding: 24px; }
  .shop-panel { height: min(860px, 100%); border-radius: 24px; overflow: hidden; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
}
.sh-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 8px; }
.sh-title { flex: 1; margin: 0; font-size: 1.15rem; font-weight: 700; }
.sh-icon { position: relative; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--bg-soft, #F4F6F9); display: grid; place-items: center; cursor: pointer; color: var(--text, #17212F); transition: background .15s; }
.sh-icon:hover { background: #e6ebf1; }
.sh-icon svg, .sh-search svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.cartbtn b { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; background: var(--primary, #1A8F83); color: #fff; font-size: .78rem; display: grid; place-items: center; border: 2px solid #fff; }
.cartbtn b[hidden] { display: none; }

.sh-search { position: relative; margin: 0 14px 8px; }
.sh-search svg { position: absolute; top: 50%; inset-inline-start: 14px; transform: translateY(-50%); color: var(--muted, #667689); pointer-events: none; }
.sh-search-in { width: 100%; min-height: 46px; padding: 0 14px 0 14px; padding-inline-start: 44px; border: 1.5px solid var(--line, #E8ECF1); border-radius: 14px; background: #fff; font: inherit; font-size: 1rem; }
.sh-search-in:focus { outline: none; border-color: var(--primary, #1A8F83); box-shadow: 0 0 0 4px rgba(26, 143, 131, .14); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 14px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips[hidden] { display: none; }
.sh-chip { flex: none; min-height: 40px; padding: 0 16px; border: 1.5px solid var(--line, #E8ECF1); border-radius: 99px; background: #fff; font: inherit; font-size: .92rem; font-weight: 700; color: var(--muted, #667689); cursor: pointer; transition: all .15s; white-space: nowrap; }
.sh-chip.on { background: var(--primary, #1A8F83); border-color: var(--primary, #1A8F83); color: #fff; }
.chips.sub .sh-chip { min-height: 34px; padding: 0 13px; font-size: .86rem; }
.chips.sub .sh-chip.on { background: var(--primary-soft, #E8F5F3); color: var(--primary-ink, #0F6B62); border-color: var(--primary, #1A8F83); }

.sh-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 100px; }
.sh-h { margin: 14px 2px 8px; font-size: 1.02rem; font-weight: 700; }
.sh-empty { padding: 48px 12px; text-align: center; color: var(--muted, #667689); font-weight: 600; }
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 520px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
.hscroll { display: flex; gap: 12px; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .pcard { flex: none; width: 150px; scroll-snap-align: start; }

.pcard { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line, #E8ECF1); border-radius: 18px; overflow: hidden; }
.pcard.off .pimg img { filter: grayscale(1); opacity: .55; }
.pimg { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: var(--bg-soft, #F4F6F9); cursor: pointer; }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: #b4bfcc; }
.noimg svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.pstar { position: absolute; top: 8px; inset-inline-start: 8px; width: 28px; height: 28px; border-radius: 50%; background: #FFD255; color: #7A4F00; display: grid; place-items: center; font-size: .95rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.pstar.inline { position: static; display: inline-grid; width: 24px; height: 24px; margin-inline-start: 8px; vertical-align: middle; font-size: .85rem; box-shadow: none; }
.pdisc { position: absolute; top: 8px; inset-inline-end: 8px; padding: 2px 9px; border-radius: 99px; background: #D93F2B; color: #fff; font-size: .78rem; font-weight: 800; }
.pinfo { display: flex; flex-direction: column; gap: 6px; padding: 10px 11px 11px; flex: 1; }
.pname { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.4; text-align: start; color: var(--text, #17212F); cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.pbottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.pprice { display: flex; flex-direction: column; line-height: 1.3; }
.pprice b { font-size: .95rem; color: var(--primary-ink, #0F6B62); }
.pprice s, .pd-price s { font-size: .8rem; color: var(--muted, #667689); }
.padd { flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--primary, #1A8F83); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 10px rgba(26, 143, 131, .3); transition: transform .1s; }
.padd:active { transform: scale(.92); }
.padd svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.poff { font-size: .8rem; font-weight: 700; color: #B4452F; }
.poff.big { font-size: 1rem; padding: 12px 0; }

/* شريط السلة */
.cartbar { position: absolute; z-index: 5; inset-inline: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 16px 0 12px; border: 0; border-radius: 16px; background: linear-gradient(120deg, #17A08F, #1A8F83 45%, #1F5FBF 130%); color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 10px 24px rgba(26, 143, 131, .4); }
.cartbar[hidden] { display: none; }
.cb-n { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 99px; background: rgba(255, 255, 255, .25); display: grid; place-items: center; font-size: .9rem; }
.cb-t { flex: 1; text-align: start; }

/* نافذة سفلية (منتج / سلة) */
.sh-sheet-bg { position: absolute; inset: 0; z-index: 10; background: rgba(15, 23, 35, .5); display: flex; align-items: flex-end; justify-content: center; animation: shfade .15s ease both; }
.sh-sheet-bg[hidden] { display: none; }
.sh-sheet { position: relative; width: 100%; max-width: 640px; max-height: 92%; overflow-y: auto; overscroll-behavior: contain; background: #fff; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: shrise .28s cubic-bezier(.2, .8, .2, 1) both; }
.sheet-x { position: absolute; z-index: 3; top: 12px; inset-inline-end: 12px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: var(--bg-soft, #F4F6F9); scrollbar-width: none; aspect-ratio: 1 / .85; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.gallery.none { display: grid; place-items: center; }
.pd-body { padding: 16px 18px 20px; }
.pd-body h3 { margin: 0 0 6px; font-size: 1.25rem; line-height: 1.4; }
.pd-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.pd-price b { font-size: 1.4rem; color: var(--primary-ink, #0F6B62); }
.pd-desc { margin: 0 0 14px; color: #44566a; line-height: 1.8; font-size: .98rem; white-space: pre-line; }
.pd-row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }

.stepper { direction: ltr; display: inline-flex; align-items: center; background: var(--bg-soft, #F4F6F9); border-radius: 14px; flex: none; }
.stepper button { width: 42px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text, #17212F); border-radius: 14px; }
.stepper button:active { background: #e6ebf1; }
.stepper svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.qv { min-width: 30px; text-align: center; font-weight: 800; font-size: 1.05rem; }
.btn-go { flex: 1; min-height: 52px; padding: 0 16px; border: 0; border-radius: 14px; background: linear-gradient(120deg, #17A08F, #1A8F83 45%, #1F5FBF 130%); color: #fff; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 8px 20px rgba(26, 143, 131, .28); }
.btn-go.wa { width: 100%; background: #1FA855; box-shadow: 0 8px 20px rgba(31, 168, 85, .3); }
.btn-go svg { width: 22px; height: 22px; }

.cart { padding: 14px 16px 18px; }
.cart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cart-head h3 { margin: 0; font-size: 1.2rem; }
.cart-list { display: flex; flex-direction: column; }
.ci { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line, #E8ECF1); }
.ci > img, .ci > .noimg { flex: none; width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--bg-soft, #F4F6F9); }
.ci-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ci-n { font-weight: 700; line-height: 1.35; }
.ci-p { font-weight: 800; color: var(--primary-ink, #0F6B62); font-size: .92rem; }
.ci .stepper button { height: 36px; width: 36px; }
.cart-note { width: 100%; margin-top: 12px; padding: 10px 14px; border: 1.5px solid var(--line, #E8ECF1); border-radius: 14px; font: inherit; resize: vertical; }
.cart-note:focus { outline: none; border-color: var(--primary, #1A8F83); }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin: 14px 2px; font-weight: 700; font-size: 1.05rem; }
.cart-total b { font-size: 1.35rem; color: var(--primary-ink, #0F6B62); }
.cart-warn { padding: 12px 14px; border-radius: 12px; background: #FFF1EE; color: #B4452F; font-weight: 600; }
.btn-link { display: block; margin: 10px auto 0; padding: 8px 14px; border: 0; background: none; font: inherit; font-weight: 700; color: #B4452F; cursor: pointer; }

@keyframes shfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shrise { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 840px) { .sh-sheet { border-radius: 24px; margin-bottom: 24px; max-height: 88%; } .sh-sheet-bg { align-items: center; } }
@media (prefers-reduced-motion: reduce) { .shop, .sh-sheet, .sh-sheet-bg { animation: none; } }
