/* ShareBooks v2 core - tokens + shared chrome (nav, footer, cart drawer, buttons, glass).
   Every rule is scoped with :where(.sb2) (zero specificity) so it can also sit on top of
   the older Bootstrap pages without restyling their content. */
:root {
  --bg: #eef3ff;
  --ink: #14213d;
  --ink-2: #3c4866;
  --muted: #66718d;
  --blue: #3f6fd1;
  --blue-2: #6492d8;
  --blue-soft: #dfe8fb;
  --orange: #ff7a2f;
  --orange-2: #ffa25f;
  --teal: #0a9bb5;
  --pink: #f25f8a;
  --violet: #7b61ff;
  --green: #16a06b;
  --glass: rgba(255, 255, 255, .58);
  --glass-hi: rgba(255, 255, 255, .8);
  --stroke: rgba(255, 255, 255, .8);
  --line: rgba(20, 33, 61, .09);
  --shadow: 0 18px 44px -18px rgba(28, 52, 118, .35);
  --shadow-lg: 0 30px 70px -24px rgba(28, 52, 118, .45);
  --r: 22px;
  --r-sm: 14px;
  --nav-h: 68px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:where(.sb2 .nav, .sb2 .foot, .sb2 .drawer, .sb2 .sb-toast) { font-family: var(--font); line-height: 1.6; color: var(--ink); }
:where(.sb2 .nav a, .sb2 .foot a, .sb2 .drawer a) { color: inherit; text-decoration: none; }
:where(.sb2 .nav, .sb2 .foot, .sb2 .drawer) :where(h3, h4) { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-family: var(--font); }
:where(.sb2 .nav, .sb2 .foot, .sb2 .drawer) :where(p) { margin: 0; }
:where(.sb2 .nav, .sb2 .foot, .sb2 .drawer) :where(img) { display: block; max-width: 100%; }
:where(.sb2 .nav, .sb2 .foot, .sb2 .drawer) :where(button) { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:where(.sb2) :focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 8px; }

:where(.sb2) .i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
:where(.sb2) .wrap { width: 100%; max-width: 1220px; margin-inline: auto; padding-inline: 20px; }
:where(.sb2) .muted { color: var(--muted); }

/* ---------- ambient background (cheap: transforms on soft gradients, no filters) */
:where(.sb2) .orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(160deg, #f5f8ff 0%, #eaf0ff 45%, #fff3ea 100%); }
:where(.sb2) .orbs span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; opacity: .55; will-change: transform;
  animation: drift 28s ease-in-out infinite alternate; }
:where(.sb2) .orbs span:nth-child(1) { background: radial-gradient(circle, #9fbaf5 0, transparent 62%); top: -25vmax; left: -15vmax; }
:where(.sb2) .orbs span:nth-child(2) { background: radial-gradient(circle, #ffc59a 0, transparent 62%); top: 20vh; right: -25vmax; animation-duration: 34s; animation-delay: -8s; }
:where(.sb2) .orbs span:nth-child(3) { background: radial-gradient(circle, #b7a8ff 0, transparent 62%); bottom: -30vmax; left: 10vw; animation-duration: 40s; opacity: .4; }
:where(.sb2) .orbs span:nth-child(4) { background: radial-gradient(circle, #8fe0ec 0, transparent 60%); top: 45vh; left: -20vmax; animation-duration: 36s; animation-delay: -14s; opacity: .35; }
@keyframes drift { to { transform: translate3d(8vw, 6vh, 0) scale(1.12); } }

/* ---------- glass */
:where(.sb2) .glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :where(.sb2) .glass { background: rgba(255, 255, 255, .9); }
}

/* ---------- buttons */
:where(.sb2) .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .72em 1.3em; border: 0; border-radius: 999px; font-family: var(--font); font-weight: 700; font-size: .95rem; line-height: 1.4; white-space: nowrap;
  color: #fff; background: linear-gradient(135deg, var(--blue-2), var(--blue)); text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 22px -10px rgba(63, 111, 209, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
:where(.sb2) .btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 28px -12px rgba(63, 111, 209, .95), inset 0 1px 0 rgba(255, 255, 255, .35); }
:where(.sb2) .btn:active { transform: translateY(0) scale(.98); }
:where(.sb2) .btn:disabled { opacity: .6; cursor: default; transform: none; }
:where(.sb2) .btn--warm { background: linear-gradient(135deg, var(--orange-2), var(--orange)); box-shadow: 0 10px 22px -10px rgba(255, 122, 47, .95), inset 0 1px 0 rgba(255, 255, 255, .35); }
:where(.sb2) .btn--warm:hover { box-shadow: 0 16px 28px -12px rgba(255, 122, 47, .95); }
:where(.sb2) .btn--ghost, :where(.sb2) .btn--ghost:hover { color: var(--ink); background: var(--glass-hi); border: 1px solid var(--stroke); box-shadow: var(--shadow); }
:where(.sb2) .btn--sm { padding: .5em .95em; font-size: .85rem; }
:where(.sb2) .btn--lg { padding: .9em 1.6em; font-size: 1rem; }
:where(.sb2) .btn--block { width: 100%; }
:where(.sb2) .btn.is-done { background: linear-gradient(135deg, #37c28a, var(--green)); }

:where(.sb2) .icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; transition: background .2s, transform .2s; }
:where(.sb2) .icon-btn:hover { background: rgba(255, 255, 255, .7); }
:where(.sb2) .icon-btn .i { width: 22px; height: 22px; }
:where(.sb2) .badge { position: absolute; top: 2px; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  font-size: .7rem; font-weight: 800; line-height: 19px; text-align: center; color: #fff; background: var(--orange); transition: transform .2s; }
:where(.sb2) .badge.bump { transform: scale(1.35); }
:where(.sb2) .link { display: inline-flex; align-items: center; gap: .35em; font-weight: 700; color: var(--blue); text-decoration: none; }
:where(.sb2) .link .i { transition: transform .2s; }
:where(.sb2) .link:hover .i { transform: translateX(3px); }
:where(.sb2) .pill { display: inline-flex; align-items: center; gap: .45em; padding: .5em .9em; border-radius: 99px; font-weight: 700; background: rgba(255, 255, 255, .7); border: 1px solid var(--stroke); }

/* ---------- nav */
:where(.sb2) .nav { position: sticky; top: 0; z-index: 50; display: block; height: var(--nav-h); margin: 0; padding: 0; border-width: 0 0 1px; border-radius: 0; box-shadow: 0 6px 24px -18px rgba(28, 52, 118, .5); }
:where(.sb2) .nav__in { height: 100%; display: flex; align-items: center; gap: 20px; }
:where(.sb2) .brand { display: flex; align-items: center; gap: 4px; flex: none; }
:where(.sb2) .brand img:first-child { border-radius: 50%; }
:where(.sb2) .brand__word { height: 31px; width: auto; }
:where(.sb2) .nav__links { display: flex; gap: 4px; margin-inline: auto; }
:where(.sb2) .nav__links a { padding: .45em .8em; border-radius: 99px; font-weight: 600; font-size: .93rem; color: var(--ink-2); transition: background .2s, color .2s; }
:where(.sb2) .nav__links a:hover, :where(.sb2) .nav__links a[aria-current] { background: rgba(255, 255, 255, .75); color: var(--blue); }
:where(.sb2) .nav__act { display: flex; align-items: center; gap: 10px; }
:where(.sb2) .menu { position: relative; }
:where(.sb2) .menu__list { position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; padding: 8px; border-radius: var(--r-sm); background: var(--glass-hi); display: grid; }
:where(.sb2) .menu__list[hidden] { display: none; }
:where(.sb2) .menu__list a { display: flex; align-items: center; gap: .6em; padding: .6em .8em; border-radius: 10px; font-weight: 600; font-size: .93rem; }
:where(.sb2) .menu__list a:hover { background: var(--blue-soft); color: var(--blue); }
:where(.sb2) .only-sm { display: none !important; }

/* ---------- footer */
:where(.sb2) .foot { margin-top: 40px; color: #c9d3ea; background: linear-gradient(160deg, #182848, #0f1a33); position: relative; overflow: hidden; }
:where(.sb2) .foot::before { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; top: -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 146, 216, .35), transparent 65%); }
:where(.sb2) .foot__in { position: relative; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 30px; padding-top: 60px; padding-bottom: 40px; }
:where(.sb2) .foot__brand img { height: 42px; width: auto; margin-bottom: 12px; }
:where(.sb2) .foot h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
:where(.sb2) .foot__col { display: grid; align-content: start; gap: 10px; }
:where(.sb2) .foot__col a { display: inline-flex; align-items: center; gap: .5em; color: #c9d3ea; transition: color .2s; word-break: break-word; }
:where(.sb2) .foot__col a:hover { color: #fff; }
:where(.sb2) .invite { margin-top: 22px; }
:where(.sb2) .invite label { display: block; font-weight: 700; color: #fff; margin-bottom: 8px; font-size: .9rem; }
:where(.sb2) .invite div { display: flex; gap: 6px; padding: 5px 5px 5px 16px; border-radius: 99px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15); max-width: 380px; }
:where(.sb2) .invite input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: #fff; font: inherit; font-size: .92rem; }
:where(.sb2) .invite input::placeholder { color: #8e9bbb; }
:where(.sb2) .foot__copy { position: relative; margin: 0 auto; padding-top: 20px; padding-bottom: 24px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; color: #8e9bbb; }

/* ---------- cart drawer + toast */
:where(.sb2) .drawer { position: fixed; inset: 0; z-index: 1090; }
:where(.sb2) .drawer[hidden] { display: none; }
:where(.sb2) .drawer__scrim { position: absolute; inset: 0; background: rgba(15, 26, 51, .35); animation: fade .25s; }
:where(.sb2) .drawer__panel { position: absolute; right: 12px; top: 12px; bottom: 12px; width: min(400px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 16px;
  padding: 22px; border-radius: 26px; background: rgba(255, 255, 255, .8); animation: slide .35s cubic-bezier(.2, .8, .2, 1); }
:where(.sb2) .drawer__head { display: flex; align-items: center; justify-content: space-between; }
:where(.sb2) .drawer__head h3 { font-size: 1.3rem; }
:where(.sb2) .drawer__list { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 10px; }
:where(.sb2) .cart-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .7); }
:where(.sb2) .cart-item img { width: 46px; height: 64px; object-fit: cover; border-radius: 4px; background: var(--blue-soft); }
:where(.sb2) .cart-item b { flex: 1; font-size: .92rem; line-height: 1.3; }
:where(.sb2) .cart-item button { color: var(--muted); }
:where(.sb2) .cart-item button:hover { color: var(--pink); }
:where(.sb2) .sb-toast { position: fixed; left: 50%; bottom: 24px; z-index: 1100; padding: 12px 20px; border-radius: 99px; font-weight: 700; background: rgba(255, 255, 255, .9);
  transform: translate(-50%, 140%); opacity: 0; transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .35s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
:where(.sb2) .sb-toast.show { transform: translate(-50%, 0); opacity: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes pop { 40% { transform: scale(1.3); } }

@media (max-width: 1100px) {
  :where(.sb2) .foot__in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  :where(.sb2) .only-sm { display: inline-grid !important; }
  :where(.sb2) .hide-sm { display: none !important; }
  :where(.sb2) .nav__links { position: absolute; top: var(--nav-h); left: 12px; right: 12px; margin: 0; padding: 10px; flex-direction: column; border-radius: 20px;
    background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-lg); border: 1px solid var(--stroke); display: none; }
  :where(.sb2) .nav__links.open { display: flex; animation: fade .2s; }
  :where(.sb2) .nav__links a { padding: .75em 1em; }
  :where(.sb2) .nav__links a.only-sm { display: block !important; }
  :where(.sb2) .nav__act { margin-left: auto; }
}
@media (max-width: 600px) {
  :where(.sb2) .wrap { padding-inline: 16px; }
  :where(.sb2) .hide-xs { display: none !important; }
  :where(.sb2) .brand__word { height: 24px; }
  :where(.sb2) .foot__in { grid-template-columns: 1fr; }
  :where(.sb2) .orbs span:nth-child(n+3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  :where(.sb2) *, :where(.sb2) *::before, :where(.sb2) *::after { animation: none !important; transition: none !important; }
}
