/* Infusion Store — product page V5, below-the-fold rules (loaded in the footer, non-blocking). */

/* 9:16 rail */
.v5-rail-wrap { margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.v5-rail { display: flex; gap: 12px; list-style: none; margin: 0; padding: 4px 0 12px; }
.v5-vcard { flex: 0 0 min(42vw, 180px); scroll-snap-align: start; }
/* 16:9 group under the 9:16 rail: centred, true 16:9, full width on phones */
.v5-wide-grid { margin-top: 8px; }
.v5-wide { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.v5-wide .v5-vcard { flex: 0 1 min(100%, 560px); min-width: 0; }
.v5-vcard__btn { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 9 / 16; padding: 0; border: 0; border-radius: var(--radius-l); background: var(--navy) linear-gradient(160deg, #22324a, #0e1622); overflow: hidden; cursor: pointer; color: #fff; }
.v5-vcard--wide .v5-vcard__btn { aspect-ratio: 16 / 9; }
.v5-vcard__btn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.v5-vcard__title { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 10px; font-size: .875rem; font-weight: 700; text-align: left; background: linear-gradient(transparent, rgb(0 0 0 / 70%)); }

/* Syllabus & PDFs */
.v5-featured { display: flex; gap: 16px; align-items: center; background: var(--cream); border: 1px solid #f3e3a8; border-radius: var(--radius-l); padding: 16px; margin: 0 0 18px; }
.v5-featured__img { width: 96px; height: auto; border-radius: 8px; box-shadow: 0 2px 8px rgb(0 0 0 / 12%); }
.v5-featured__label { margin: 0; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--link-hover); }
.v5-featured__title { margin: 2px 0 10px; font-weight: 700; font-size: 1.0625rem; }
.v5-featured__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.v5-featured__all { font-size: .9375rem; font-weight: 600; color: var(--navy); white-space: nowrap; }
.v5-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.v5-filters button { border: 1px solid var(--line); background: #fff; border-radius: 30px; padding: 6px 14px; font: inherit; font-size: .875rem; cursor: pointer; }
.v5-filters button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
/* Fixed column widths. `.product-section th { width: 38% }` (1.x two-column spec table) must not
   apply here: it made "#" and "Book" 38% each and left a wide empty gap. */
.v5-syl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.v5-syl th, .v5-syl td { width: auto; text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid var(--line); }
.v5-syl thead th { font-size: .8125rem; color: var(--muted); background: var(--surface); }
.v5-syl__c-n { width: 52px; }
.v5-syl__c-s { width: 32%; }
.v5-syl__c-a { width: 216px; }
.v5-syl--no-topics .v5-syl__c-s { width: auto; }
.v5-syl__n { font-weight: 800; color: var(--muted); }
.v5-syl__s strong { display: block; line-height: 1.4; overflow-wrap: anywhere; }
.v5-syl__t { color: #3f4a5a; font-size: .9375rem; line-height: 1.55; overflow-wrap: anywhere; }
.v5-syl__a { white-space: nowrap; }
.v5-syl__intro { margin: -4px 0 16px; color: #3f4a5a; max-width: 760px; }
.v5-syl__group th { background: var(--cream); color: var(--navy); font-size: .875rem; font-weight: 800; padding: 10px 12px; border-bottom: 1px solid #f3e3a8; }
.v5-syl__group.is-compulsory th { background: var(--surface); }
.v5-syl__more { display: none; }
.v5-dl { font-size: .875rem; margin-left: 8px; }
@media (min-width: 700px) and (max-width: 1023px) {
	.v5-syl__c-a { width: 132px; }
	.v5-syl__a { white-space: normal; }
	.v5-syl__a .v5-dl { display: inline-block; margin: 8px 0 0; }
}
/* Phones: book + demo PDF only. Topics column and paper filter hidden (the filter would only
   hide rows that are already short), every row visible. */
@media (max-width: 699px) {
	.v5-filters, .v5-syl thead, .v5-syl colgroup, .v5-syl td.v5-syl__t { display: none; }
	/* Topics open per book with the "Syllabus topics" button (1.4.0). */
	.v5-syl tr.is-open td.v5-syl__t { display: block; grid-column: 1 / -1; font-size: .9375rem; background: var(--surface); border-radius: 8px; padding: 10px 12px; }
	.v5-syl__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 0; border: 0; background: none; color: var(--navy); font: inherit; font-size: .8125rem; font-weight: 700; text-decoration: underline; cursor: pointer; }
	.v5-syl__more::after { content: "▾"; text-decoration: none; transition: transform .15s; }
	.v5-syl__more[aria-expanded="true"]::after { transform: rotate(180deg); }
	.v5-syl tr.v5-syl__group { display: block; padding: 0; border: 0; margin: 14px 0 8px; }
	.v5-syl tr.v5-syl__group th { display: block; border-radius: 10px; }
	.v5-syl, .v5-syl tbody { display: block; }
	.v5-syl tr, .v5-syl tr[hidden] { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 10px; padding: 12px; }
	.v5-syl td { display: block; border: 0; padding: 0; }
	.v5-syl td.v5-syl__n { width: 28px; height: 28px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: .75rem; }
	.v5-syl td.v5-syl__n:empty { display: none; }
	.v5-syl__n:empty + .v5-syl__s { grid-column: 1 / -1; }
	.v5-syl td.v5-syl__a { grid-column: 1 / -1; white-space: normal; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
	.v5-syl__a .v5-dl { margin: 0; }
}

/* Notes and MCQs */
.v5-note { border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px; margin: 0 0 16px; background: #fff; }
.v5-note__src { margin: -6px 0 10px; font-size: .8125rem; color: var(--muted); }
.v5-note__body table { border-collapse: collapse; }
.v5-note__body td, .v5-note__body th { border: 1px solid var(--line); padding: 6px 8px; }
.v5-mcqs { padding-left: 1.4em; }
.v5-mcq { margin: 0 0 18px; }
.v5-mcq__q { font-weight: 700; margin: 0 0 4px; }
.v5-mcq__meta { margin: 0 0 6px; font-size: .8125rem; color: var(--muted); }
.v5-mcq__opts { margin: 0 0 8px; }
.v5-mcq details summary { cursor: pointer; font-weight: 700; color: var(--navy); }

/* WhatsApp feedback */
.v5-wa { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.v5-wa__item { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.v5-wa__head { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: .9375rem; }
.v5-wa__head time { color: var(--muted); font-size: .8125rem; }
.v5-wa__src { font-size: .75rem; font-weight: 700; color: var(--success); background: #eaf6ef; border-radius: 20px; padding: 1px 8px; }
.v5-wa blockquote { margin: 0; padding: 0; border: 0; }
.v5-stars { margin: 0; color: #b7791f; letter-spacing: 2px; }

/* Related articles */
.v5-related__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.v5-related__grid a { display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); height: 100%; }
.v5-related__grid img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.v5-related__title { display: block; padding: 10px 12px; font-weight: 700; }

/* Dialogs */
html.v5-locked { overflow: hidden; }
.v5-dialog { border: 0; padding: 0; background: #fff; color: var(--ink); max-width: min(960px, 100vw); width: 100%; max-height: 100dvh; border-radius: var(--radius-l); }
.v5-dialog::backdrop { background: rgb(10 15 25 / 80%); }
.v5-dialog__close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 92%); font-size: 1.75rem; line-height: 1; cursor: pointer; color: var(--navy); }
.v5-dialog__title { margin: 0; padding: 14px 60px 10px 16px; font-weight: 700; }
.v5-dialog__foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 16px 16px; }
.v5-dialog__foot:empty { display: none; }
.v5-pdf__body iframe { display: block; width: 100%; height: min(75dvh, 900px); border: 0; background: var(--surface); }
.v5-pdf__note, .v5-pdf__status { padding: 0 16px; }
.v5-pdf__status { color: var(--muted); }
/* PDF.js viewer (phones/tablets): pages rendered inside the sheet */
.v5-pdf[data-mode="pdfjs"][open] { display: flex; flex-direction: column; }
.v5-pdf[data-mode="pdfjs"] .v5-pdf__body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.v5-pdf__bar { display: flex; align-items: center; gap: 8px; padding: 0 16px 8px; }
.v5-pdf__count { flex: 1; font-size: .8125rem; color: var(--muted); }
.v5-pdf__zoom { width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.v5-pdf__zoom:disabled { opacity: .4; cursor: default; }
.v5-pdf__pages { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: #e9ecf1; padding: 8px; }
.v5-pdf__page { position: relative; margin: 0 auto 8px; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 18%); display: grid; place-items: center; }
.v5-pdf__page canvas { display: block; width: 100%; height: 100%; }
.v5-pdf__pn { color: #9aa3b2; font-weight: 700; }
.v5-pdf[data-mode="pdfjs"] { height: min(85dvh, 1000px); }
.v5-video { background: #000; color: #fff; width: auto; max-width: 100vw; }
.v5-video .v5-dialog__title { color: #fff; }
/* Stage size from the viewport: the player keeps its exact ratio (no black bands from a wrong box)
   and the whole dialog (title + player + button) fits the screen. */
.v5-video { --v5-chrome: 132px; }
.v5-video__stage { position: relative; width: min(100vw, 520px, calc((100dvh - var(--v5-chrome)) * 9 / 16)); aspect-ratio: 9 / 16; margin: 0 auto; background: #000; }
.v5-video__stage.is-wide { width: min(100vw, 960px, calc((100dvh - var(--v5-chrome)) * 16 / 9)); aspect-ratio: 16 / 9; }
.v5-video__stage iframe, .v5-video__stage video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.v5-video__nav { position: absolute; top: 50%; left: 0; right: 0; display: flex; justify-content: space-between; pointer-events: none; transform: translateY(-50%); }
.v5-video__nav button { pointer-events: auto; width: 40px; height: 56px; border: 0; background: rgb(255 255 255 / 20%); color: #fff; font-size: 1.75rem; cursor: pointer; }
.v5-video__nav button:disabled { visibility: hidden; }
.v5-video .v5-dialog__foot { justify-content: center; align-items: center; }
.v5-video__step { min-height: 44px; padding: 0 16px; border: 1.5px solid rgb(255 255 255 / 55%); border-radius: 10px; background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.v5-video__step:hover { background: rgb(255 255 255 / 12%); }
.v5-video__step--prev { margin-right: auto; }
.v5-video__step--next { margin-left: auto; }
@media (max-width: 699px) {
	.v5-dialog { border-radius: 0; height: 100dvh; max-height: 100dvh; }
	/* PDF on phones: a sheet over ~80% of the screen; the product page stays visible above it. */
	.v5-dialog.v5-pdf { height: 82dvh; max-height: 82dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
	.v5-pdf .v5-dialog__foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
	/* Video on phones: only as tall as its content, centred; no empty black area below a 16:9 player. */
	.v5-dialog.v5-video { width: 100vw; height: fit-content; max-height: 100dvh; margin: auto 0; }
	.v5-video .v5-dialog__foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* Mobile sticky purchase bar */
.v5-buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgb(0 0 0 / 8%); }
.v5-buybar[hidden] { display: none; }
.v5-buybar__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.v5-buybar__title { font-size: .8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v5-buybar__price { font-weight: 800; }
.v5-buybar__price del { font-weight: 400; font-size: .8125rem; }
.v5-buybar__btn { flex: 0 0 auto; }
html.v5-has-buybar body { padding-bottom: 76px; }
@media (min-width: 900px) { .v5-buybar { display: none !important; } }
@media (max-width: 899px) { .v5-video__nav { display: none; } }

/* 1.5.0: syllabus topics folded on desktop too ("Syllabus topics" button per book) */
@media (min-width: 700px) {
	.v5-syl colgroup, .v5-syl .v5-syl__th-t { display: none; }
	.v5-syl, .v5-syl thead, .v5-syl tbody { display: block; }
	.v5-syl tr { display: grid; grid-template-columns: 52px minmax(0, 1fr) 216px; align-items: start; border-bottom: 1px solid var(--line); }
	.v5-syl th, .v5-syl td { display: block; border-bottom: 0; }
	.v5-syl td.v5-syl__t { display: none; grid-column: 2 / -1; padding-top: 0; }
	.v5-syl tr.is-open td.v5-syl__t { display: block; }
	.v5-syl tr.v5-syl__group { display: block; border: 0; }
	.v5-syl tr.v5-syl__group th { display: block; }
	.v5-syl__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 0; border: 0; background: none; color: var(--navy); font: inherit; font-size: .875rem; font-weight: 700; text-decoration: underline; cursor: pointer; }
	.v5-syl__more::after { content: "▾"; text-decoration: none; transition: transform .15s; }
	.v5-syl__more[aria-expanded="true"]::after { transform: rotate(180deg); }
}
@media (min-width: 700px) and (max-width: 1023px) {
	.v5-syl tr { grid-template-columns: 52px minmax(0, 1fr) 132px; }
}

/* 1.5.0: free downloads */
.v6-dl { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.v6-dl__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.v6-dl__ico { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--cream); color: var(--navy); font-size: .6875rem; font-weight: 800; letter-spacing: .04em; }
.v6-dl__t { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.v6-dl__a { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.v6-dl__paid-h { margin: 14px 0 4px; }
.v6-dl__paid { margin: 0; padding-left: 20px; }

/* 1.5.0: student reviews */
.v6-rv__sum { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.v6-rv__avg { font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.v6-rv__star { color: #b7791f; font-size: 1.25rem; }
.v6-rv__head { display: flex; gap: 12px; align-items: flex-start; }
.v6-rv__ph { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.v6-rv__ph--i { display: grid; place-items: center; background: var(--surface); color: var(--navy); font-weight: 800; }
.v6-rv .v5-wa__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; }
.v6-rv__city { color: var(--muted); font-size: .875rem; }
.v6-rv__city::before { content: "· "; }
.v6-rv__meta { flex-basis: 100%; display: flex; gap: 8px; align-items: center; font-size: .8125rem; color: var(--muted); }
.v6-rv__photos { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 10px 0 0; padding: 0; }
.v6-rv__photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* 1.5.0: free counselling call */
.v6-counsel { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); padding: 16px; }
.v6-counsel__text { margin: 0 0 12px; }
.v6-counsel__form { display: grid; grid-template-columns: 1fr; gap: 10px 14px; }
@media (min-width: 700px) { .v6-counsel__form { grid-template-columns: 1fr 1fr; } .v6-counsel__row--wide { grid-column: 1 / -1; } }
.v6-counsel__row { margin: 0; }
.v6-counsel__row label { display: block; font-weight: 700; font-size: .875rem; margin: 0 0 4px; }
.v6-counsel__row input[type="text"], .v6-counsel__row input[type="tel"], .v6-counsel__row textarea { width: 100%; min-height: 46px; padding: 8px 12px; border: 1.5px solid #9aa4b5; border-radius: 10px; font: inherit; background: #fff; }
.v6-counsel__consent { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 400 !important; font-size: .8125rem !important; }
.v6-counsel__consent input { margin-top: 3px; }
.v6-counsel__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.v6-counsel__msg { grid-column: 1 / -1; margin: 0; font-weight: 700; }
.v6-counsel__msg.is-ok { color: #17643a; }
.v6-counsel__msg.is-err { color: #b3261e; }
.v6-counsel__form [hidden] { display: none !important; }
