/* ===== Shared header/footer + store components (port of the mockup assets/store.css) =====
   Load after site.css: consumes its variables (--clay, --sage, --plum, --gold...). */

/* ---------- header condiviso ---------- */
.site-header-host { position: sticky; top: 0; z-index: 1030; }
.site-nav .nav-link.active { color: var(--clay-dark) !important; }
.site-nav .nav-link.active::after { width: 60%; }
.btn-icon {
  width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  position: relative; font-size: 1.1rem;
}
.btn-ghost.active, .btn-ghost:focus-visible { background: var(--surface); border-color: var(--clay-dark); color: var(--clay-dark); }
.btn:focus-visible { outline: 2px solid var(--clay-dark); outline-offset: 3px; box-shadow: none; }
.cart-count {
  position: absolute; top: -4px; right: -4px; box-sizing: border-box; min-width: 20px; height: 20px; padding: 0 4px;
  border-radius: 999px; background: var(--clay-dark); color: var(--surface); font-size: .72rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; border: 2px solid var(--cream);
  font-variant-numeric: lining-nums tabular-nums; text-box: trim-both cap alphabetic;
}
.cart-count[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .nav-cart.bump .cart-count { animation: bump .45s ease; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.nav-account { display: inline-flex; align-items: center; gap: .4rem; max-width: 220px; }
.nav-account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; display: inline-block; vertical-align: bottom; }
.soft-dropdown { border: 0; border-radius: 16px; padding: .5rem; box-shadow: var(--shadow); background: var(--surface); }
.soft-dropdown .dropdown-item { border-radius: 10px; padding: .5rem .8rem; color: var(--ink); display: flex; gap: .55rem; align-items: center; }
.soft-dropdown .dropdown-item:hover, .soft-dropdown .dropdown-item:focus { background: var(--sand); color: var(--clay-dark); }
@media (max-width: 1199px) {
  .site-nav .navbar-collapse { padding-bottom: .8rem; }
  .site-nav .navbar-nav { margin-top: .6rem; }
}
.footer-links { row-gap: 0 !important; column-gap: 1.1rem !important; }
.footer-links a { color: var(--ink); text-decoration: none; font-size: .92rem; display: inline-block; padding-block: .6rem; }
.footer-links a:hover { color: var(--clay-dark); }

/* ---------- copertine corso (gradiente) ---------- */
.cover-clay { background: linear-gradient(150deg, color-mix(in srgb, var(--clay) 40%, var(--clay-dark)) 0%, var(--clay-dark) 50%, var(--clay-darker) 100%); }
.cover-sage { background: linear-gradient(150deg, color-mix(in srgb, var(--sage) 75%, var(--ink)) 0%, color-mix(in srgb, var(--sage) 65%, var(--ink)) 50%, color-mix(in srgb, var(--sage) 55%, var(--ink)) 100%); }
.cover-plum { background: linear-gradient(150deg, color-mix(in srgb, var(--plum) 60%, var(--cream)) 0%, color-mix(in srgb, var(--plum) 80%, var(--cream)) 50%, var(--plum) 100%); }
.cover-gold { background: linear-gradient(150deg, color-mix(in srgb, var(--gold) 65%, var(--ink)) 0%, color-mix(in srgb, var(--gold) 55%, var(--ink)) 50%, color-mix(in srgb, var(--gold) 40%, var(--ink)) 100%); }
.course-cover {
  position: relative; aspect-ratio: 16/9; overflow: hidden; color: var(--surface);
  display: flex; align-items: flex-end; padding: 1.1rem 1.2rem;
}
.course-cover::before {
  content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
  right: -18%; top: -30%; background: radial-gradient(circle, color-mix(in srgb, var(--surface) 28%, transparent), transparent 65%);
}
.course-cover::after {
  content: ""; position: absolute; inset: auto -10% -45% auto; width: 55%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--surface) 25%, transparent);
}
.course-cover .cover-icon {
  position: absolute; right: 1.2rem; top: 1.1rem; width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center; font-size: 1.5rem; background: color-mix(in srgb, var(--surface) 18%, transparent);
  backdrop-filter: blur(6px); z-index: 1;
}
.course-cover .cover-cat {
  position: relative; z-index: 1; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
  background: color-mix(in srgb, var(--ink) 22%, transparent); padding: .3rem .75rem; border-radius: 999px;
}
.access-badge {
  position: absolute; left: 1rem; top: 1rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--surface); color: var(--ink); font-size: .76rem; font-weight: 600;
  padding: .32rem .75rem; border-radius: 999px; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--ink) 40%, transparent);
}
.access-badge i { color: var(--sage); }
.access-badge.is-free i { color: var(--gold); }
.access-badge.is-subscription i { color: var(--plum); }
.access-badge.is-grant i { color: var(--clay-dark); }

/* ---------- card corso ---------- */
.course-card {
  height: 100%; background: var(--surface); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; position: relative;
  border: 1px solid color-mix(in srgb, var(--ink) 6%, transparent); transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.course-card:hover, .course-card:focus-within { transform: translateY(-6px); box-shadow: var(--shadow); }
.course-card .course-body { padding: 1.3rem 1.4rem 1.4rem; display: flex; flex-direction: column; flex-grow: 1; }
.course-card h3 { font-size: 1.55rem; line-height: 1.15; margin: 0 0 .4rem; }
.course-card h3 a { color: inherit; text-decoration: none; }
.course-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 3; } /* card interamente cliccabile */
.course-card h3 a:focus-visible { outline: none; }
.course-card:has(h3 a:focus-visible) { outline: 2px solid var(--clay-dark); outline-offset: 3px; }
.course-card:hover .course-cta, .course-card:focus-within .course-cta { color: var(--clay-darker); }
.course-card .course-sub { font-size: .93rem; margin-bottom: .9rem; }
.course-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }
.course-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.course-meta i { color: var(--clay-dark); }
.course-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding-top: .9rem; border-top: 1px dashed color-mix(in srgb, var(--ink) 10%, transparent); }
.course-price { font-family: var(--serif); font-size: 1.7rem; color: var(--ink); line-height: 1; }
.course-price s { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-left: .45rem; }
.course-price.is-free { color: var(--sage); }
.course-cta { font-weight: 600; font-size: .88rem; color: var(--clay-dark); white-space: nowrap; }
.course-cta i { transition: transform .25s; display: inline-block; }
.course-card:hover .course-cta i { transform: translateX(4px); }
.level-pill {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600;
  padding: .22rem .6rem; border-radius: 999px; background: var(--sand); color: var(--ink);
}

/* skeleton */
.skeleton .course-cover, .skeleton .sk-line { background: linear-gradient(90deg, var(--sand) 25%, color-mix(in srgb, var(--sand) 50%, var(--cream)) 50%, var(--sand) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.skeleton .course-cover::before, .skeleton .course-cover::after { display: none; }
.sk-line { height: 14px; border-radius: 8px; margin-bottom: .6rem; }
.sk-line.w-60 { width: 60%; } .sk-line.w-80 { width: 80%; } .sk-line.w-40 { width: 40%; } .sk-line.big { height: 24px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton .course-cover, .skeleton .sk-line { animation: none; } }

/* ---------- piani abbonamento (su sfondo chiaro) ---------- */
.plan-card {
  height: 100%; background: var(--surface); border-radius: var(--radius); padding: 2rem;
  display: flex; flex-direction: column; border: 1px solid color-mix(in srgb, var(--ink) 7%, transparent); position: relative;
  transition: transform .3s, box-shadow .3s;
}
.plan-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.plan-card.featured { border: 2px solid var(--gold); background: linear-gradient(175deg, color-mix(in srgb, var(--gold) 8%, var(--surface)), var(--surface) 60%); }
.plan-card.is-current { border: 2px solid var(--sage); }
.plan-card .tag { align-self: flex-start; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; padding: .3rem .8rem; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-weight: 600; margin-bottom: .8rem; }
.plan-card .tag.current { background: var(--ok-bg); color: var(--ok); }
.plan-card h3 { font-size: 1.7rem; margin: 0 0 .3rem; }
.plan-price { font-family: var(--serif); font-size: 2.5rem; color: var(--ink); line-height: 1.1; margin: .3rem 0 .6rem; }
.plan-price small { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-left: .25rem; }
.plan-card p { font-size: .93rem; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 1.6rem; flex-grow: 1; }
.plan-card li { padding: .45rem 0 .45rem 1.8rem; position: relative; border-bottom: 1px dashed color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); font-size: .93rem; }
.plan-card li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; color: var(--sage); font-size: 1.1rem; top: .4rem; }
.plan-switch { display: flex; gap: .25rem; background: var(--sand); border-radius: 999px; padding: .25rem; margin: .5rem 0 .8rem; }
.plan-switch button { flex: 1 1 0; min-width: 0; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .85rem; font-weight: 500; padding: .3rem .5rem; transition: background .2s, color .2s; }
.plan-switch button:hover { color: var(--ink); }
.plan-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px color-mix(in srgb, var(--ink) 12%, transparent); }
.plan-switch button:focus-visible { outline: 2px solid var(--clay-dark); outline-offset: 2px; }
.plan-save { align-self: flex-start; font-size: .78rem; font-weight: 600; padding: .2rem .7rem; border-radius: 999px; background: var(--ok-bg); color: var(--ok); margin: -.2rem 0 .8rem; }
.btn-sage { background: var(--sage); color: var(--surface); border: 0; }
.btn-sage:hover, .btn-sage:disabled { background: color-mix(in srgb, var(--sage) 80%, var(--ink)); color: var(--surface); }

/* ---------- pagine negozio ---------- */
.store-hero { position: relative; overflow: hidden; padding: 4rem 0 3rem; }
.store-hero .hero-orb.orb-1 { width: 320px; height: 320px; top: -140px; right: -60px; }
.store-hero .hero-orb.orb-2 { width: 260px; height: 260px; bottom: -160px; left: -80px; }
.store-hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.05; }
.filters { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.filter-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-pill {
  border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: .45rem 1rem; font-size: .9rem; font-weight: 500; transition: all .2s;
}
.filter-pill:hover { border-color: var(--clay-dark); color: var(--clay-dark); }
.filter-pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.filter-pill:focus-visible { outline: 2px solid var(--clay-dark); outline-offset: 3px; }
.filter-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.soft-input, .soft-select {
  background-color: var(--surface); border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); border-radius: 14px;
  padding: .65rem 1rem; color: var(--ink);
}
.soft-input:focus, .soft-select:focus { border-color: var(--clay-dark); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--clay) 15%, transparent); }
.search-wrap { position: relative; flex: 1 1 260px; min-width: 0; }
.search-wrap i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap .soft-input { padding-left: 2.6rem; width: 100%; }
.filter-row .soft-select { flex: 0 1 220px; min-width: 0; }
.results-count { font-size: .9rem; }
.empty-state {
  text-align: center; background: var(--surface); border-radius: var(--radius); padding: 3rem 1.5rem;
  border: 1px dashed color-mix(in srgb, var(--ink) 15%, transparent);
}
.empty-state .empty-icon { width: 64px; height: 64px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--sand); color: var(--clay-dark); font-size: 1.6rem; margin-bottom: 1rem; }
.empty-state h2, .empty-state h3 { font-size: 1.8rem; }

/* scheda corso */
.course-hero { padding: 3rem 0 2.5rem; color: var(--surface); position: relative; overflow: hidden; }
.course-hero::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -160px; top: -220px; background: radial-gradient(circle, color-mix(in srgb, var(--surface) 22%, transparent), transparent 65%); }
.course-hero .container { position: relative; }
.course-hero h1 { color: var(--surface); font-size: clamp(2.3rem, 5vw, 3.8rem); line-height: 1.04; }
.course-hero .lead { color: var(--surface); font-size: 1.15rem; max-width: 640px; }
.course-hero .breadcrumb-link { color: var(--surface); text-decoration: none; font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding-right: .5rem; }
.course-hero .breadcrumb-link:hover { color: var(--surface); text-decoration: underline; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: .4rem; background: color-mix(in srgb, var(--ink) 20%, transparent); padding: .38rem .85rem; border-radius: 999px; font-size: .88rem; }
.course-hero .access-badge { position: static; }
.content-card { background: var(--surface); border-radius: var(--radius); padding: 2rem; margin-bottom: 1.5rem; }
.content-card h2 { font-size: 2rem; margin-bottom: 1rem; }
.learn-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
@media (min-width: 768px) { .learn-list { grid-template-columns: 1fr 1fr; } }
.learn-list li { display: flex; gap: .6rem; align-items: flex-start; color: var(--ink); }
.learn-list i { color: var(--sage); font-size: 1.2rem; line-height: 1.4; }
.lesson-list { list-style: none; padding: 0; margin: 0; counter-reset: lesson; }
.lesson-item {
  display: flex; align-items: center; gap: .9rem; padding: .85rem .4rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
}
.lesson-item:last-child { border-bottom: 0; }
.lesson-num { font-family: var(--serif); font-size: 1.3rem; color: var(--muted); width: 2rem; flex-shrink: 0; text-align: center; }
.lesson-title { flex-grow: 1; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.lesson-title small { display: block; color: var(--muted); font-size: .8rem; }
.lesson-dur { font-size: .85rem; white-space: nowrap; }
.lesson-action {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; border: 0;
  display: inline-grid; place-items: center; font-size: 1.05rem; text-decoration: none;
}
.lesson-action.is-preview { background: var(--clay-dark); color: var(--surface); }
.lesson-action.is-preview:hover { background: var(--clay-darker); color: var(--surface); }
.lesson-action.is-open { background: var(--ok-bg); color: var(--ok); }
.lesson-action.is-open:hover { background: var(--sage); color: var(--surface); }
.lesson-action.is-locked { background: var(--sand); color: var(--muted); }
.lesson-tag { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--clay-dark); margin-left: .4rem; }
.buy-box {
  background: var(--surface); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow);
}
.buy-aside { position: sticky; top: var(--aside-top, 100px); }
.buy-box .buy-price { font-family: var(--serif); font-size: 2.8rem; color: var(--ink); line-height: 1; }
.buy-box .buy-price s { font-family: var(--sans); font-size: 1rem; color: var(--muted); margin-left: .5rem; }
.buy-box .save-pill { display: inline-block; background: color-mix(in srgb, var(--clay) 12%, transparent); color: var(--clay-dark); font-size: .78rem; font-weight: 600; border-radius: 999px; padding: .2rem .6rem; margin-top: .5rem; }
.buy-box .divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .85rem; margin: 1.3rem 0 1rem; }
.buy-box .divider::before, .buy-box .divider::after { content: ""; flex: 1; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.buy-box .credit-note { font-size: .86rem; color: var(--muted); margin: .5rem 0 0; text-align: center; }
.buy-box .credit-confirm { background: var(--sand); border-radius: 16px; padding: 1rem 1.1rem; margin-bottom: 1rem; color: var(--ink); }
.unlock-plan {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; width: 100%;
  background: var(--cream); border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); border-radius: 14px;
  padding: .75rem 1rem; color: var(--ink); text-align: left; margin-bottom: .5rem; transition: all .2s;
}
.unlock-plan:hover { border-color: var(--clay-dark); background: var(--surface); }
.unlock-plan:focus-visible { outline: 2px solid var(--clay-dark); outline-offset: 3px; }
.unlock-plan strong { display: block; font-weight: 600; font-size: .95rem; }
.unlock-plan small { color: var(--muted); }
.unlock-plan .p { font-family: var(--serif); font-size: 1.35rem; white-space: nowrap; }
.buy-box .perks { list-style: none; padding: 0; margin: 1.2rem 0 0; font-size: .86rem; }
.buy-box .perks li { display: flex; gap: .5rem; padding: .2rem 0; }
.buy-box .perks i { color: var(--sage); }
.owned-note { background: var(--ok-bg); color: var(--ok); border-radius: 14px; padding: .9rem 1rem; font-size: .92rem; display: flex; gap: .55rem; }
.warn-note { background: var(--err-bg); color: var(--err); border-radius: 14px; padding: .9rem 1rem; font-size: .92rem; display: flex; gap: .55rem; }
.info-note { background: var(--sand); color: var(--ink); border-radius: 14px; padding: .9rem 1rem; font-size: .92rem; display: flex; gap: .55rem; }
.notfound { padding: 6rem 0; text-align: center; }
.notfound .big { font-family: var(--serif); font-size: clamp(5rem, 15vw, 8rem); line-height: 1; color: var(--clay-dark); opacity: .35; }

/* player segnaposto 16:9 */
.player-placeholder {
  position: relative; aspect-ratio: 16/9; width: 100%; border-radius: 18px; overflow: hidden; color: var(--surface);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 1.3rem 1.5rem;
}
.player-placeholder::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--ink) 45%, transparent)); }
.player-placeholder > * { position: relative; }
.player-placeholder .play-deco {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%);
  width: 78px; height: 78px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink);
  display: grid; place-items: center; font-size: 2rem; box-shadow: 0 15px 40px -10px color-mix(in srgb, var(--ink) 50%, transparent);
  cursor: default; padding-left: 6px;
}
.player-placeholder .play-deco::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--surface) 50%, transparent); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .player-placeholder .play-deco::after { animation: none; } }
.player-placeholder .pp-kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; opacity: .9; }
.player-placeholder .pp-title { font-family: var(--serif); font-size: clamp(1.3rem, 3vw, 1.9rem); line-height: 1.15; }
.player-placeholder .pp-bar { height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--surface) 30%, transparent); margin-top: .8rem; overflow: hidden; }
.player-placeholder .pp-bar span { display: block; height: 100%; width: 12%; background: var(--surface); }
.player-placeholder.is-loading .play-deco { opacity: .5; }

/* checkout */
.cart-row { display: flex; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 7%, transparent); }
.cart-row:last-child { border-bottom: 0; }
.cart-thumb { width: 72px; height: 54px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; color: var(--surface); font-size: 1.3rem; }
.cart-info { flex-grow: 1; min-width: 0; }
.cart-info strong { display: block; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.cart-info small { color: var(--muted); }
.cart-info .row-note { display: block; font-size: .8rem; margin-top: .2rem; }
.cart-info .row-note.warn { color: var(--clay-dark); }
.cart-info .row-note.ok { color: var(--ok); }
.cart-price { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); white-space: nowrap; text-align: right; }
.cart-price s { display: block; font-family: var(--sans); font-size: .78rem; color: var(--muted); }
.btn-remove { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--sand); color: var(--ink); flex-shrink: 0; display: inline-grid; place-items: center; }
.btn-remove:hover { background: var(--clay-dark); color: var(--surface); }
.btn-remove:focus-visible { outline: 2px solid var(--clay-dark); outline-offset: 3px; }
.summary-line { display: flex; justify-content: space-between; padding: .35rem 0; color: var(--ink); }
.summary-line.total { font-family: var(--serif); font-size: 1.8rem; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); margin-top: .5rem; padding-top: .8rem; }
.summary-line.discount { color: var(--ok); }
.demo-pay {
  border: 1px dashed var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); border-radius: 16px; padding: 1rem 1.1rem;
  display: flex; gap: .7rem; color: var(--ink); font-size: .9rem; margin: 1rem 0;
}
.demo-pay i { color: var(--gold); font-size: 1.4rem; line-height: 1.2; }
.auth-tabs { display: flex; gap: .4rem; background: var(--sand); border-radius: 999px; padding: .3rem; margin-bottom: 1.2rem; }
.auth-tabs button { flex: 1; min-height: 44px; border: 0; background: transparent; border-radius: 999px; padding: .5rem; font-weight: 500; color: var(--ink); }
.auth-tabs button[aria-selected="true"] { background: var(--surface); box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--ink) 25%, transparent); color: var(--clay-dark); }
.auth-tabs button:focus-visible { outline: 2px solid var(--clay-dark); outline-offset: 3px; }
.store-form .form-label { font-weight: 500; color: var(--ink); font-size: .9rem; margin-bottom: .3rem; }
.store-form .form-control {
  background-color: var(--cream); border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); border-radius: 14px; padding: .7rem 1rem; color: var(--ink);
}
.store-form .form-control:focus { background-color: var(--surface); border-color: var(--clay-dark); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--clay) 15%, transparent); }
.store-form .form-check-input:checked { background-color: var(--clay-dark); border-color: var(--clay-dark); }
.store-form .form-check-label { font-size: .88rem; }
.store-form .optional { color: var(--muted); font-weight: 400; font-size: .8rem; }
.coupon-row { display: flex; gap: .5rem; }
.coupon-row .form-control { text-transform: uppercase; min-width: 0; }
.coupon-row .form-control::placeholder { text-transform: none; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: .55rem .9rem; font-size: .9rem; }
.coupon-applied button { border: 0; background: transparent; color: var(--ok); text-decoration: underline; font-size: .85rem; }
.confirm-card { background: var(--surface); border-radius: 32px; padding: 3rem 2rem; text-align: center; box-shadow: var(--shadow); max-width: 680px; margin: 0 auto; }
.confirm-card .ok-icon { width: 76px; height: 76px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ok-bg); color: var(--ok); font-size: 2.2rem; margin-bottom: 1rem; }
.confirm-items { list-style: none; padding: 0; margin: 1.5rem 0; text-align: left; }
.confirm-items li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px dashed color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); align-items: center; flex-wrap: wrap; }
.order-number { font-family: var(--serif); font-size: 1.6rem; color: var(--clay-dark); }
.btn [hidden], .btn-busy[hidden] { display: none !important; }

@media (max-width: 575px) {
  .content-card, .buy-box { padding: 1.4rem; }
  .plan-card { padding: 1.6rem; }
  .cart-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 44px; grid-template-areas: "thumb info remove" "thumb price remove"; column-gap: .85rem; row-gap: .25rem; align-items: start; }
  .cart-thumb { grid-area: thumb; width: 56px; height: 44px; }
  .cart-info { grid-area: info; }
  .cart-price { grid-area: price; text-align: left; font-size: 1.3rem; }
  .cart-price s { display: inline; margin-left: .45rem; }
  .cart-row .btn-remove { grid-area: remove; }
  .cart-row.cart-row-static { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "thumb info" "thumb price"; }
  .confirm-card { padding: 2.2rem 1.2rem; }
  .store-hero { padding: 2.8rem 0 2rem; }
  .filter-row .soft-select { flex: 1 1 100%; }
}
@media (max-width: 991px) {
  .buy-aside { position: static; }
}

/* Additions (phase 4b): catalogue, course detail, cart consents, success page */
.plans-intro { max-width: 640px; }
.sk-line.sk-light { background: color-mix(in srgb, var(--surface) 30%, transparent); }
.sk-line.sk-tall { height: 48px; }
.course-hero .eyebrow-on-cover { color: color-mix(in srgb, var(--surface) 90%, transparent); }
.course-description { white-space: pre-line; }
.narrow-640 { max-width: 640px; }
.preview-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; background: var(--ink); }
.consents { font-size: .94rem; color: var(--ink); line-height: 1.5; }
.consents a { color: var(--clay-dark); }
.btn-close-sm { box-sizing: border-box; width: 44px; height: 44px; padding: 0; margin: -.6rem -.6rem -.6rem auto; background-size: .7rem; flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.confirm-card .ok-icon.is-muted { background: var(--sand); color: var(--muted); }
.store-form .btn-link { color: var(--clay-dark); }
.store-form .btn-link:hover { color: var(--clay-dark); text-decoration: underline !important; }
.buy-box .btn-clay:disabled { background: var(--clay-dark); border-color: var(--clay-dark); color: var(--surface); opacity: .55; box-shadow: none; }
.confirm-card h2:focus { outline: none; }
.consents .form-check-input:checked, .store-form .form-check-input:checked { background-color: var(--clay-dark); border-color: var(--clay-dark); }
.consents .form-check-input:focus, .store-form .form-check-input:focus { border-color: var(--clay-dark); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--clay) 20%, transparent); }

/* Additions (phase 7b): course byline + "at a glance" facts (server-rendered, read by search/AI crawlers) */
.course-hero .course-byline { color: color-mix(in srgb, var(--surface) 88%, transparent); font-size: .95rem; margin: .9rem 0 0; }
.course-facts .content-card { margin-bottom: 0; }
.course-facts .facts-summary { color: var(--ink); }
.course-facts .facts-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem 1.6rem; margin: 1.2rem 0 0; }
.course-facts .facts-list dt { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.course-facts .facts-list dd { margin: .15rem 0 0; color: var(--ink); }
.course-facts .facts-list a { color: var(--clay-dark); }

/* ===== Mobile UX (phase U1): catalogue, course page, cart ===== */

/* ---------- compact page heroes on phones (catalogue, cart, success) ---------- */
@media (max-width: 575.98px) {
  .store-hero { padding: 1.6rem 0 1.25rem; }
  .store-hero h1 { font-size: 2rem; }
  .store-hero .lead-soft { font-size: 1rem; margin-top: .6rem !important; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---------- catalogue filters: one scrollable pill row, search + level side by side ---------- */
.filter-pill { min-height: 44px; }
@media (max-width: 575.98px) {
  .filters { gap: .6rem; margin-bottom: 1rem; }
  .filter-pills {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -.75rem; padding: 0 2rem 0 .75rem;
    scroll-snap-type: x proximity; scroll-padding-inline: .75rem;
    -webkit-mask-image: linear-gradient(90deg, var(--ink) calc(100% - 2.5rem), transparent); mask-image: linear-gradient(90deg, var(--ink) calc(100% - 2.5rem), transparent);
  }
  .filter-pills::-webkit-scrollbar { display: none; }
  .filter-pill { flex-shrink: 0; white-space: nowrap; scroll-snap-align: start; }
  .filter-row { flex-wrap: wrap; gap: .5rem; }
  .filter-row .search-wrap { flex: 1 1 0; }
  .filter-row .soft-select { flex: 0 0 9.25rem; }
  .results-count { flex-basis: 100%; }
}

/* ---------- course page ---------- */
.lesson-item { position: relative; border-radius: 12px; }
.lesson-item .lesson-action::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.lesson-item .lesson-action:focus-visible { outline: none; }
.lesson-item:has(.lesson-action:focus-visible) { outline: 2px solid var(--clay-dark); outline-offset: 2px; }
.lesson-item:hover { background: var(--cream); }
.lesson-action.is-locked { cursor: pointer; }
.lesson-action.is-locked:hover { color: var(--ink); }
.buy-bar .bottom-bar-price small { font-family: var(--sans); font-size: .82rem; margin-left: .2rem; }

/* ---------- cart: phone order (items, next step, summary), total line, consents, skeletons ---------- */
.cart-mobile-total { display: none; }
@media (max-width: 991.98px) {
  .cart-layout { display: flex; flex-direction: column; margin: 0; }
  .cart-layout > .cart-col { display: contents; }
  .cart-layout #cartCard { order: 1; }
  .cart-layout #accountCard { order: 2; }
  .cart-layout #summaryCard { order: 3; margin-bottom: 1.5rem; }
  .cart-layout.is-logged #accountCard { order: 4; }
  .cart-mobile-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: .4rem; padding-top: .8rem; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); font-family: var(--serif); font-size: 1.5rem; color: var(--ink); }
  .cart-mobile-total[hidden] { display: none; }
}
.cart-skeleton { padding: 0; }
.cart-skeleton .sk-row { display: flex; gap: 1rem; align-items: center; min-height: 89px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 7%, transparent); }
.cart-skeleton .sk-row:last-child { border-bottom: 0; }
@media (max-width: 575.98px) { .cart-skeleton .sk-row { min-height: 160px; align-items: flex-start; padding-top: 1rem; } .cart-skeleton .sk-thumb { width: 56px; height: 44px; } }
.cart-skeleton .sk-thumb { width: 72px; height: 54px; border-radius: 12px; flex-shrink: 0; }
.cart-skeleton .sk-thumb, .cart-skeleton .sk-line, .sk-block { background: linear-gradient(90deg, var(--sand) 25%, color-mix(in srgb, var(--sand) 50%, var(--cream)) 50%, var(--sand) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.cart-skeleton .sk-lines { flex: 1; }
.sk-block { height: 44px; border-radius: 14px; margin-bottom: .6rem; }
@media (prefers-reduced-motion: reduce) { .cart-skeleton .sk-thumb, .cart-skeleton .sk-line, .sk-block { animation: none; } }
#accountInfo:empty { min-height: 60px; }

.consents .form-check { position: relative; display: flex; align-items: flex-start; gap: .75rem; min-height: 44px; padding: .55rem .75rem; margin: 0 -.75rem; border-radius: 12px; cursor: pointer; }
.consents .form-check-label::before { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.consents .form-check-input, .consents .form-check-label a { position: relative; z-index: 1; }
.consents .form-check + .form-check { margin-top: .15rem; }
.consents .form-check:hover { background: var(--cream); }
.consents .form-check .form-check-input { float: none; flex-shrink: 0; width: 1.5rem; height: 1.5rem; margin: 0; cursor: pointer; border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.consents .form-check-label { cursor: pointer; flex: 1; }
.consents .form-check.is-missing { background: color-mix(in srgb, var(--clay) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--clay-dark) 45%, transparent); }
#payBtn[aria-disabled="true"] { box-shadow: none; }
.pay-hint { color: var(--clay-dark); font-weight: 500; }
.pay-hint:empty { display: none; }

/* password field with show/hide toggle (area + cart forms, toggle handled by layout.js) */
.ar-pw { position: relative; }
.ar-pw .form-control { padding-right: 3.3rem !important; background-image: none !important; }
.ar-pw-toggle {
  position: absolute; right: .2rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); width: 44px; height: 44px; border-radius: 50%;
}
.ar-pw-toggle:hover { color: var(--clay-dark); background: color-mix(in srgb, var(--clay) 8%, transparent); }
.ar-pw ~ .invalid-feedback { display: none; }
.was-validated .ar-pw:has(:invalid) ~ .invalid-feedback { display: block; }
.course-hero .course-byline { color: var(--surface); }
.help-box { background: var(--sand); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-top: 1.2rem; }
.help-box h2 { font-size: 1.5rem; margin-bottom: .4rem; }
.help-box p { font-size: .92rem; margin-bottom: 1rem; }
.help-box .help-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.help-box .help-actions .btn { flex: 1 1 auto; min-height: 44px; }

/* video bundles: list band, detail items, course aside box, cart hints */
.bundle-card .cover-icon { font-size: 2.6rem; }
.bundle-save { color: var(--clay-dark); font-weight: 600; }
.qty-band { display: flex; gap: 1.2rem; align-items: flex-start; background: var(--surface); border-radius: var(--radius); padding: 1.8rem; }
.qty-icon { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--clay) 12%, var(--surface)); color: var(--clay-dark); font-size: 1.4rem; }
.qty-title { font-size: clamp(1.7rem, 3vw, 2.2rem); margin-bottom: .4rem; }
.qty-rules { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.qty-rules li { display: inline-flex; align-items: center; gap: .4rem; background: var(--cream); border-radius: 999px; padding: .4rem .9rem; color: var(--ink); font-weight: 500; }
.qty-rules i { color: var(--sage); }
.bundle-items { list-style: none; padding: 0; margin: 0; }
.bundle-item { display: flex; gap: .9rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 7%, transparent); }
.bundle-item:last-child { border-bottom: 0; }
.bundle-item .cart-thumb { width: 56px; height: 44px; font-size: 1.1rem; }
.bundle-item-text { flex-grow: 1; min-width: 0; }
.bundle-item-text strong { display: block; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.bundle-item-text a { text-decoration: none; }
.bundle-item-text a:hover { color: var(--clay-darker) !important; text-decoration: underline; }
.bundle-item-text small { color: var(--muted); }
.bundle-item-price { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); white-space: nowrap; }
.bundle-item .access-badge { position: static; white-space: nowrap; }
.course-facts .facts-items { margin: .8rem 0 0; padding-left: 1.2rem; color: var(--ink); }
.course-facts .facts-items li { padding: .15rem 0; }
.course-facts .facts-items a { color: var(--clay-dark); }
.bundle-box { background: var(--surface); border: 1px solid color-mix(in srgb, var(--clay) 25%, transparent); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin-top: 1.2rem; }
.bundle-box h2 { font-size: 1.4rem; margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem; }
.bundle-box h2 i { color: var(--clay-dark); font-size: 1.1rem; }
.bundle-box ul { list-style: none; padding: 0; margin: 0; }
.bundle-box li + li { margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed color-mix(in srgb, var(--ink) 10%, transparent); }
.bundle-box p { font-size: .92rem; color: var(--ink); margin-bottom: .3rem; }
.bundle-box a { color: var(--clay-dark); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; }
.cart-hint { font-size: .86rem; color: var(--clay-dark); background: color-mix(in srgb, var(--clay) 8%, var(--surface)); border-radius: 12px; padding: .6rem .8rem; margin-top: .6rem; display: flex; gap: .45rem; }
.coupon-note { font-size: .86rem; color: var(--muted); margin-top: .5rem; }
@media (max-width: 575px) {
  .qty-band { flex-direction: column; padding: 1.4rem; }
  .bundle-item { flex-wrap: wrap; }
  .bundle-item-text { flex-basis: calc(100% - 56px - .9rem); }
  .bundle-item-price, .bundle-item .access-badge { margin-left: calc(56px + .9rem); }
}

/* subscriptions page (how it works) and the banner on the catalogues */
.how-card { height: 100%; background: var(--surface); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.how-card h3 { font-size: 1.4rem; margin: .9rem 0 .4rem; }
.how-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--clay) 12%, var(--surface)); color: var(--clay-dark); font-size: 1.35rem; }
.plans-banner { display: flex; align-items: center; gap: 1.1rem; padding: 1.25rem 1.5rem; border-radius: var(--radius); background: var(--sand); color: var(--ink); text-decoration: none; }
.plans-banner:hover { color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--clay-dark) 35%, transparent); }
.plans-banner:focus-visible { outline: 2px solid var(--clay-dark); outline-offset: 3px; }
.plans-banner-icon { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--surface); color: var(--clay-dark); font-size: 1.3rem; }
.plans-banner-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.plans-banner-text strong { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.plans-banner-text span { color: var(--muted); font-size: .93rem; }
.plans-banner-cta { flex-shrink: 0; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; font-weight: 600; color: var(--clay-dark); }
@media (max-width: 767.98px) {
  .plans-banner { flex-wrap: wrap; padding: 1.1rem; }
  .plans-banner-text { flex-basis: calc(100% - 64px); }
  .plans-banner-cta { flex-basis: 100%; }
}

/* ---------- site search: header overlay (#siteSearch, outside the header host) and /cerca/ results ---------- */
.site-search { position: fixed; inset: 0; z-index: 1060; display: flex; justify-content: center; align-items: flex-start; padding: .75rem .75rem 0; }
.site-search[hidden] { display: none; }
.site-search-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 50%, transparent); }
.site-search-panel {
  position: relative; width: min(680px, 100%); max-height: calc(100dvh - 1.5rem); display: flex; flex-direction: column;
  background: var(--cream); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden;
}
.site-search-form { display: flex; align-items: center; gap: .5rem; padding: .75rem; border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); }
.site-search-form .search-wrap { flex: 1 1 auto; }
.site-search-results { overflow-y: auto; overscroll-behavior: contain; padding: .5rem .75rem 1rem; }
body.search-open { overflow: hidden; }
.search-empty { margin: 0; padding: 1.25rem .5rem; color: var(--muted); text-align: center; }
.search-group { padding-top: .75rem; }
.search-group-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .35rem; padding: 0 .25rem; font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.search-group-count { min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--sand); color: var(--clay-dark); font-size: .72rem; letter-spacing: 0; text-align: center; }
.search-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.search-item { display: flex; align-items: center; gap: .8rem; min-height: 52px; padding: .5rem .6rem; border-radius: 14px; color: var(--ink); text-decoration: none; }
.search-item:hover, .search-item:focus-visible { background: var(--surface); color: var(--clay-dark); }
.search-item:focus-visible { outline: 2px solid var(--clay-dark); outline-offset: -2px; }
.search-item-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sand); color: var(--clay-dark); }
.search-item-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.search-item-text strong { font-weight: 600; overflow-wrap: anywhere; }
.search-item-text span { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-item-badge { margin-left: auto; flex: 0 0 auto; padding: .15rem .6rem; border-radius: 999px; background: var(--sand); color: var(--clay-dark); font-size: .75rem; font-weight: 600; }
.search-all { display: flex; width: 100%; justify-content: center; margin-top: 1rem; }
.search-page .filter-row .btn { flex: 0 0 auto; min-height: 44px; }
.search-results .search-group { background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1rem 1rem; margin-bottom: 1rem; }
.search-results .search-item:hover, .search-results .search-item:focus-visible { background: var(--cream); }
@media (min-width: 576px) { .site-search { padding-top: 5vh; } }
