/* ==========================================================================
   GBM Studies — Prototype 01 — cart (nav button, drawer, add-to-cart
   buttons, complete-bundle banner). Shared by every page.
   ========================================================================== */

/* ---------- Nav button ---------- */
.nav__cart { position: relative; flex: none; width: 40px; height: 40px; margin-right: .9rem; border-radius: 50%; display: grid; place-items: center; color: inherit; font-size: .95rem; opacity: .85; transition: opacity .25s, background-color .25s; }
.nav__cart::after { content: ""; position: absolute; top: 10px; bottom: 10px; right: calc(-.9rem - 1px); width: 1px; background: currentColor; opacity: .22; pointer-events: none; }
.nav__cart:hover { opacity: 1; background: rgba(214,185,124,.14); }
.nav__cart:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; }
.nav__cart-n { position: absolute; top: 1px; right: -1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; font-family: var(--font-sans); font-size: .64rem; font-weight: 700; line-height: 1; color: var(--emerald-950); background: var(--gold-400); box-shadow: 0 0 0 2px var(--emerald-950); }
.nav.is-light .nav__cart-n { box-shadow: 0 0 0 2px var(--ivory-50); }
.nav__cart-n[hidden] { display: none; }

/* ---------- Drawer ---------- */
html.cart-open { overflow: hidden; }
.cart { position: fixed; inset: 0; z-index: calc(var(--z-nav) + 20); }
.cart[hidden] { display: none; }
.cart__scrim { position: absolute; inset: 0; background: rgba(3,17,11,.55); opacity: 0; transition: opacity .45s var(--ease-out); }
.cart__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column; background: var(--ivory-50); color: var(--ink-900); box-shadow: -30px 0 80px -30px rgba(0,0,0,.55); transform: translate3d(104%, 0, 0); transition: transform .5s var(--ease-out); }
.cart.is-open .cart__scrim { opacity: 1; }
.cart.is-open .cart__panel { transform: none; }
.cart__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.6rem 1.6rem 1.2rem; border-bottom: 1px solid var(--line-light); }
.cart__k { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-700); }
.cart__t { margin-top: .3rem; font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; line-height: 1.05; }
.cart__x { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-700); box-shadow: inset 0 0 0 1px var(--line-light); transition: box-shadow .25s, color .25s; }
.cart__x:hover { color: var(--ink-900); box-shadow: inset 0 0 0 1px var(--ink-300); }
.cart__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: .4rem 1.6rem 1.6rem; }
.cart :is(a, button):focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }

.cart__list li.cart__item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line-light); }
.cart__item img { width: 72px; height: 54px; object-fit: cover; border-radius: 10px; }
.cart__item small { display: block; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-700); }
.cart__item a { display: block; margin: .15rem 0 .2rem; font-weight: 600; font-size: .95rem; line-height: 1.25; }
.cart__item a:hover { color: var(--emerald-700); }
.cart__item span { font-size: .86rem; font-weight: 600; }
.cart__item s { margin-left: .3rem; font-weight: 400; font-size: .78rem; color: var(--ink-300); }
.cart__rm { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-500); font-size: .8rem; transition: background-color .25s, color .25s; }
.cart__rm:hover { color: #b3412c; background: rgba(192,84,63,.1); }

.cart__bundle { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .9rem; align-items: start; margin-top: 1.3rem; padding: 1.1rem 1.15rem; border-radius: 18px; color: var(--ivory-50); background: radial-gradient(120% 140% at 0% 0%, #1b5a40, #061c14 70%); box-shadow: inset 0 0 0 1px rgba(230,211,166,.2); }
.cart__bundle > i { margin-top: .15rem; color: var(--gold-300); }
.cart__bundle b { display: block; font-size: .95rem; }
.cart__bundle span { display: block; margin-top: .2rem; font-size: .8rem; line-height: 1.45; color: rgba(246,238,219,.68); }
.cart__bundle-btn { grid-column: 2; justify-self: start; margin-top: .6rem; padding: .55rem 1rem; border-radius: var(--radius-pill); font-size: .82rem; font-weight: 600; color: var(--emerald-950); background: var(--grad-gold); transition: transform .3s var(--ease-out); }
.cart__bundle-btn:hover { transform: translateY(-1px); }
.cart__bundle.is-on { background: linear-gradient(120deg, #fffdf7, #f4ecd8); color: var(--ink-900); box-shadow: inset 0 0 0 1px rgba(197,161,90,.5); }
.cart__bundle.is-on > i { color: var(--gold-700); }
.cart__bundle.is-on span { color: var(--ink-500); }

.cart__more { margin-top: 1.4rem; }
.cart__more p { margin-bottom: .5rem; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-500); }
.cart__more li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: .7rem; align-items: center; padding: .55rem 0; }
.cart__more li + li { border-top: 1px solid var(--line-light); }
.cart__more img { width: 40px; height: 30px; object-fit: cover; border-radius: 6px; }
.cart__more span { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart__more b { font-size: .82rem; font-weight: 600; }
.cart__more button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; color: var(--emerald-800); box-shadow: inset 0 0 0 1px var(--line-light); transition: background-color .25s, color .25s, box-shadow .25s; }
.cart__more button:hover { color: var(--ivory-50); background: var(--emerald-800); box-shadow: none; }

.cart__empty { display: grid; justify-items: center; gap: .6rem; padding: 2.6rem 0 1rem; text-align: center; }
.cart__empty > span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; color: var(--gold-700); background: rgba(197,161,90,.12); }
.cart__empty h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; }
.cart__empty p { max-width: 28ch; color: var(--ink-500); font-size: .9rem; }
.cart__empty .btn { margin-top: .6rem; }

.cart__foot { padding: 1.1rem 1.6rem calc(1.3rem + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line-light); }
.cart__foot[hidden] { display: none; }
.cart__lines { display: grid; gap: .4rem; margin-bottom: 1rem; }
.cart__lines div { display: flex; justify-content: space-between; gap: 1rem; font-size: .86rem; color: var(--ink-500); }
.cart__lines dd { margin: 0; }
.cart__lines .good { color: var(--emerald-600); }
.cart__lines .total { margin-top: .3rem; padding-top: .7rem; border-top: 1px solid var(--line-light); align-items: baseline; color: var(--ink-900); font-weight: 600; }
.cart__lines .total dd { font-family: var(--font-display); font-weight: 400; font-size: 2rem; line-height: 1; color: var(--emerald-800); }
.cart__go { width: 100%; justify-content: center; }
.cart__note { margin-top: .7rem; text-align: center; font-size: .78rem; color: var(--ink-500); }
.cart__note i { margin-right: .3rem; color: var(--emerald-600); }

/* ---------- Add-to-cart controls on cards ---------- */
.p-addcart, .course__cart { position: relative; z-index: 3; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: .82rem; color: var(--emerald-800); box-shadow: inset 0 0 0 1px var(--line-light); transition: background-color .3s, color .3s, box-shadow .3s, transform .3s var(--ease-out); }
.p-addcart:hover, .course__cart:hover { transform: translateY(-1px); color: var(--ivory-50); background: var(--emerald-800); box-shadow: none; }
.p-addcart.is-in, .course__cart.is-in { color: var(--emerald-950); background: var(--grad-gold); box-shadow: none; }
.p-card__foot .p-card__acts { display: flex; align-items: center; gap: .5rem; }
.course__foot .course__acts { display: flex; align-items: center; gap: .5rem; }

/* ---------- Course page ---------- */
.c-buy__cart { margin-top: .6rem; }
.c-buy__cart.is-in, .c-hero__ctas [data-add-to-cart].is-in { box-shadow: inset 0 0 0 1.5px var(--gold-500); }
.c-buy__bundle { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .4rem; margin-top: .8rem; font-size: .82rem; color: var(--ink-500); }
.c-buy__bundle i { color: var(--gold-600); }
.c-buy__bundle b { color: var(--ink-900); }
.c-buy__bundle button { font-weight: 600; color: var(--emerald-700); border-bottom: 1px solid currentColor; }
.c-buy__bundle button.is-in { color: var(--gold-700); }
.c-mbar__acts { display: flex; align-items: center; gap: .5rem; }
.c-mbar__cart { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ivory-50); box-shadow: inset 0 0 0 1px rgba(246,238,219,.35); }
.c-mbar__cart.is-in { color: var(--emerald-950); background: var(--grad-gold); box-shadow: none; }

/* ---------- Complete-bundle banner (catalogue) ---------- */
.p-bundle { display: flex; justify-content: space-between; align-items: center; gap: 1.4rem 2.4rem; flex-wrap: wrap; margin-bottom: 2.4rem; padding: 1.6rem 1.8rem; border-radius: var(--radius-lg); color: var(--ivory-50); background: radial-gradient(90% 140% at 0% 0%, #1b5a40, #061c14 70%); box-shadow: inset 0 0 0 1px rgba(230,211,166,.18), var(--shadow-md); }
.p-bundle__txt { max-width: 46ch; }
.p-bundle__txt .eyebrow { color: var(--gold-400); }
.p-bundle__txt h3 { margin: .5rem 0 .3rem; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); line-height: 1.05; }
.p-bundle__txt h3 em { color: var(--gold-300); }
.p-bundle__txt p:last-child { font-size: .9rem; color: rgba(246,238,219,.7); }
.p-bundle__buy { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.p-bundle__price b { font-family: var(--font-display); font-weight: 400; font-size: 2.2rem; color: var(--gold-300); }
.p-bundle__price s { margin-left: .45rem; font-size: .9rem; color: rgba(246,238,219,.45); }

@media (max-width: 640px) {
  .cart__head { padding: 1.3rem 1.1rem 1rem; }
  .cart__body { padding: .2rem 1.1rem 1.4rem; }
  .cart__foot { padding-inline: 1.1rem; }
  .p-bundle { padding: 1.4rem 1.2rem; }
  .p-bundle__buy, .p-bundle__buy .btn { width: 100%; }
  .p-bundle__buy .btn { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cart__panel, .cart__scrim { transition: none; }
}
