/* IJ Books — book shelf (cart) */
:root {
	--c-gold: var(--ij-gold, #e2b660);
	--c-gold2: var(--ij-gold-2, #f4d58f);
	--c-grad: linear-gradient(135deg, #f4d58f 0%, #e2b660 45%, #c9953f 100%);
	--c-card: #141b31;
	--c-bg: #0f1528;
	--c-line: rgba(255,255,255,.08);
	--c-line2: rgba(255,255,255,.14);
	--c-text: var(--ij-text, #eef0f6);
	--c-soft: #c9cedb;
	--c-muted: #8f97ad;
}

/* Header button */
.mainmenu-area .center-item:last-child { display: flex; align-items: center; gap: 10px; }
.ijc-btn {
	position: relative; flex: 0 0 auto; width: 46px; height: 46px; margin-inline-start: 12px; padding: 0; border-radius: 50%;
	display: grid; place-items: center; cursor: pointer; color: var(--c-gold2);
	background: rgba(255,255,255,.04); border: 1px solid rgba(226,182,96,.35); transition: background .25s, border-color .25s, transform .25s;
}
.ijc-btn:hover, .ijc-btn[aria-expanded="true"] { background: rgba(226,182,96,.12); border-color: var(--c-gold); }
.ijc-btn svg { display: block; }
.ijc-badge {
	position: absolute; top: -5px; left: -5px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; box-sizing: border-box;
	display: flex; align-items: center; justify-content: center; font-family: inherit; font-weight: 700; font-size: 12px; line-height: 22px; color: #1a1305; background: var(--c-grad);
	box-shadow: 0 0 0 3px var(--c-bg, #0f1528); transform: scale(0); transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.ijc-btn.has-items .ijc-badge { transform: scale(1); }
.ijc-btn.is-bump { animation: ijcBump .55s cubic-bezier(.34,1.56,.64,1); }
.ijc-btn.is-bump .ijc-badge { animation: ijcPop .55s cubic-bezier(.34,1.56,.64,1); }
@keyframes ijcBump { 0% { transform: scale(1); } 30% { transform: scale(1.18) rotate(-6deg); } 60% { transform: scale(.94) rotate(3deg); } 100% { transform: scale(1); } }
@keyframes ijcPop { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* Flying book + "+1" */
.ijc-flyer { position: fixed; z-index: 100000; width: auto; pointer-events: none; filter: drop-shadow(-8px 14px 16px rgba(0,0,0,.55)); will-change: transform, opacity; }
.ijc-plus {
	position: fixed; z-index: 100001; pointer-events: none; transform: translate(-50%, 0); font-family: inherit; font-weight: 700; font-size: 16px; line-height: 1; color: var(--c-gold2);
	text-shadow: 0 2px 10px rgba(0,0,0,.6); animation: ijcPlus .9s ease-out forwards;
}
@keyframes ijcPlus { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); } 25% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -42px) scale(1); } }

/* Panel */
.ijc-panel {
	position: fixed; z-index: 99990; top: 90px; left: 24px; width: 380px; max-width: calc(100vw - 24px); max-height: min(78vh, 640px);
	display: flex; flex-direction: column; direction: rtl; text-align: right;
	background: rgba(17,23,43,.97); border: 1px solid rgba(226,182,96,.28); border-radius: 22px;
	box-shadow: 0 30px 70px -20px rgba(0,0,0,.85); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
	opacity: 0; visibility: hidden; transform: translateY(-10px) scale(.98); transform-origin: top left;
	transition: opacity .28s ease, transform .35s cubic-bezier(.22,1,.36,1), visibility 0s linear .35s;
}
.ijc-panel.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.ijc-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--c-line); }
.ijc-head strong { color: var(--c-text); font-size: 17px; font-weight: 700; }
.ijc-sub { color: var(--c-gold); font-size: 13px; font-weight: 600; flex: 1; }
.ijc-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.06); color: var(--c-soft); font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.ijc-x:hover { background: rgba(255,255,255,.12); }
.ijc-note { margin: 12px 16px 0; padding: 10px 14px; border-radius: 14px; background: rgba(226,182,96,.1); border: 1px solid rgba(226,182,96,.3); color: var(--c-soft); font-size: 14px; line-height: 1.7; animation: ijcIn .4s cubic-bezier(.22,1,.36,1); }
.ijc-note b { color: var(--c-text); font-weight: 600; }
.ijc-ok { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 50%; background: var(--c-grad); color: #1a1305; font-size: 12px; font-weight: 700; vertical-align: -3px; }
@keyframes ijcIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.ijc-list { list-style: none; margin: 0; padding: 10px 12px; overflow-y: auto; display: grid; gap: 8px; }
.ijc-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid var(--c-line); transition: opacity .25s, transform .25s, background .4s; }
.ijc-item.is-flash { animation: ijcFlash 1.2s ease; }
.ijc-item.is-leaving { opacity: 0; transform: translateX(30px); }
@keyframes ijcFlash { 0% { background: rgba(226,182,96,.22); border-color: rgba(226,182,96,.6); } 100% { background: rgba(255,255,255,.03); } }
.ijc-cover { flex: 0 0 44px; height: 58px; display: grid; place-items: center; }
.ijc-cover img { max-height: 58px; max-width: 44px; width: auto; filter: drop-shadow(-3px 5px 6px rgba(0,0,0,.45)); }
.ijc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ijc-info a { color: var(--c-text) !important; font-size: 14px; font-weight: 600; line-height: 1.55; text-decoration: none; }
.ijc-info a:hover { color: var(--c-gold2) !important; }
.ijc-info small { color: var(--c-gold); font-size: 12.5px; }
.ijc-step { flex: 0 0 auto; display: inline-flex; align-items: center; border: 1px solid var(--c-line2); border-radius: 11px; overflow: hidden; }
.ijc-step button { width: 28px; height: 30px; border: 0; padding: 0; background: transparent; color: var(--c-soft); font-size: 16px; cursor: pointer; line-height: 1; }
.ijc-step button:hover { background: rgba(226,182,96,.14); color: var(--c-gold2); }
.ijc-step b { min-width: 24px; text-align: center; color: var(--c-gold2); font-size: 15px; font-weight: 700; }
.ijc-rm { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; background: transparent; color: var(--c-muted); font-size: 18px; cursor: pointer; }
.ijc-rm:hover { background: rgba(255,90,90,.12); color: #ff8a8a; }
.ijc-empty { text-align: center; padding: 26px 10px; color: var(--c-muted); }
.ijc-empty svg { width: 42px; height: 42px; color: var(--c-gold); opacity: .7; }
.ijc-empty p { margin: 8px 0 4px !important; color: var(--c-text); font-weight: 600; }
.ijc-empty small { font-size: 13px; }

.ijc-foot { padding: 14px 16px 16px; border-top: 1px solid var(--c-line); display: grid; gap: 8px; }
.ijc-total { display: flex; justify-content: space-between; color: var(--c-soft); font-size: 14.5px; margin-bottom: 4px; }
.ijc-total b { color: var(--c-gold2); }
.ijc-hint { margin: 0 0 4px !important; color: var(--c-muted); font-size: 13px; line-height: 1.7; }
.ijc-cta {
	display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 14px; border: 0; cursor: pointer;
	background: var(--c-grad); color: #1a1305 !important; font: inherit; font-weight: 700; font-size: 15px; text-decoration: none !important;
	box-shadow: 0 12px 26px -14px rgba(226,182,96,.9); transition: transform .25s;
}
.ijc-cta:hover { transform: translateY(-2px); }
.ijc-cta.ijc-ghost { background: transparent; color: var(--c-soft) !important; border: 1px solid var(--c-line2); box-shadow: none; min-height: 44px; font-weight: 600; }

/* "اقتنِ الكتاب" buttons injected by JS */
.ijc-add {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 20px; border-radius: 13px; border: 0; cursor: pointer;
	background: var(--c-grad); color: #1a1305 !important; font: inherit; font-weight: 700; font-size: 14.5px; text-decoration: none !important;
	box-shadow: 0 12px 24px -14px rgba(226,182,96,.9); transition: transform .25s, box-shadow .25s;
}
.ijc-add svg { width: 19px; height: 19px; }
.ijc-add:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(226,182,96,1); }
.ijc-add.ijc-add-amz { background: transparent; color: var(--c-gold2) !important; border: 1px solid rgba(226,182,96,.45); box-shadow: none; }
.ijc-add-lg { min-height: 50px; padding: 10px 28px; font-size: 16px; }
.ijc-added, .ijc-added:hover { animation: ijcPress .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes ijcPress { 0% { transform: scale(1); } 30% { transform: scale(.92); } 65% { transform: scale(1.06); } 100% { transform: scale(1); } }
.ijc-card-cta { margin-top: 14px; display: flex; justify-content: center; }
.ijc-banner-cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Mobile: panel becomes a bottom sheet */
@media (max-width: 767px) {
	.ijc-btn { width: 42px; height: 42px; margin-inline-start: 0; }
	.ijc-panel {
		top: auto !important; left: 0 !important; right: 0; bottom: 0; width: 100%; max-width: none; max-height: 82vh; border-radius: 24px 24px 0 0;
		transform: translateY(100%); transform-origin: bottom center; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom);
	}
	.ijc-panel.is-open { transform: none; }
	.ijc-panel::before { content: ""; display: block; width: 44px; height: 5px; margin: 10px auto 0; border-radius: 3px; background: rgba(255,255,255,.18); }
	.ijc-banner-cta { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
	.ijc-btn.is-bump, .ijc-btn.is-bump .ijc-badge, .ijc-added { animation: none; }
}
.ijc-card-cta { gap: 10px; flex-wrap: wrap; align-items: center; }
.ijc-card-cta .readmore-btn { margin: 0 !important; min-height: 44px; display: inline-flex !important; align-items: center; padding: 8px 18px !important; }
.ijc-card-cta > * { min-width: 136px; }
.header-area .ijc-banner-cta { flex: 0 0 100%; width: 100%; }
body:has(.ijc-panel.is-open) #scrollUp, body:has(.ijc-panel.is-open) .wa__btn_popup, body:has(.ijc-panel.is-open) .grecaptcha-badge { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }

/* Price note under the banner CTA (single book pages) */
.ijc-price-note { display: inline-flex; flex-direction: column; justify-content: center; gap: 0; padding: 0 6px; line-height: 1.5; color: var(--c-soft); font-size: 13px; }
.ijc-price-note b { color: var(--c-gold2); font-size: 18px; font-weight: 700; }
.ijc-price-note small { color: var(--c-muted); font-size: 12px; }
.ijc-banner-cta { align-items: center; }

/* Unavailable print edition */
.ijc-unavail { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px dashed rgba(226,182,96,.45); color: var(--c-gold2); font-size: 13px; font-weight: 600; line-height: 1.5; }
.portfolio-details .ijc-unavail { margin-top: 10px; }

/* Hook line on book cards (books page) */
.portfolio-details .ijc-hook { margin: 8px 0 0 !important; color: var(--c-soft); font-size: 14px; line-height: 1.8; }
