/* OP Shop — one isolated stylesheet; theme Trema controls navigation and global layout. */
.opshop {
  --opshop-navy: #173c58;
  --opshop-burgundy: #922c43;
  --opshop-cream: #faf7f2;
  --opshop-border: #e1e7ec;
  --opshop-ink: #1f2933;
  --opshop-muted: #546777;
  --opshop-good: #e5f4eb;
  --opshop-warn: #fff3de;
  color: var(--opshop-ink);
  max-width: 860px;
  margin: 2rem auto 3rem;
  padding: 0 1rem;
}
.opshop-panel {
  background: #fff;
  border: 1px solid var(--opshop-border);
  border-top: 5px solid var(--opshop-navy);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(16, 49, 77, .07);
  padding: clamp(1.2rem, 4vw, 2.7rem);
}
.opshop-eyebrow { display: block; color: var(--opshop-burgundy); font-size: .78rem;
  letter-spacing: .1em; font-weight: 750; margin-bottom: .8rem; }
.opshop .opshop-panel h2 { color: var(--opshop-navy); font-weight: 750;
  font-size: clamp(1.55rem, 3vw, 2.15rem); margin: 0 0 .7rem; }
.opshop-price { font-size: 1.9rem; color: var(--opshop-burgundy);
  font-weight: 800; margin-bottom: 1rem; }
.opshop-price span { color: var(--opshop-muted); font-weight: 500; font-size: 1rem; }
.opshop-summary { background: var(--opshop-cream); border-radius: 8px;
  padding: 1.2rem 1.35rem; line-height: 1.7; margin-bottom: 1.2rem;
  overflow-wrap: anywhere; }
.opshop-summary img { max-width: 100%; height: auto; }
.opshop-summary table { display: block; max-width: 100%; overflow-x: auto; }
.opshop-hint { color: var(--opshop-muted); font-size: .94rem; margin: .9rem 0; }
.opshop-checkout { border-top: 1px solid var(--opshop-border); margin-top: 1.4rem; padding-top: 1.4rem; }
.opshop-account { font-weight: 560; margin-bottom: .9rem; }
.opshop-agreements { display: grid; gap: .85rem; margin: 1.4rem 0; }
/* Agreements: keep the checkbox adjacent to text, never centred by the Moodle theme. */
.opshop .opshop-agreement { display: flex; align-items: flex-start; gap: .7rem;
  margin: 0; padding: .7rem .8rem; border: 1px solid var(--opshop-border);
  border-radius: 7px; font-weight: 400; text-align: left; cursor: pointer; }
.opshop .opshop-agreement input[type="checkbox"] { position: static; float: none;
  margin: .2rem 0 0; padding: 0; flex: 0 0 18px; width: 18px; height: 18px;
  accent-color: var(--opshop-navy); cursor: pointer; }
.opshop .opshop-agreement-text { display: block; flex: 1; min-width: 0; line-height: 1.5; }
.opshop .opshop-agreement:focus-within { outline: 2px solid var(--opshop-navy); outline-offset: 2px; }
.opshop-howto { background: #eff5f8; border-left: 4px solid var(--opshop-navy);
  border-radius: 7px; padding: .9rem 1.1rem; margin: 1.2rem 0; }
.opshop-howto-title { display: block; margin-bottom: .35rem; color: var(--opshop-navy); }
.opshop-howto ol { padding-left: 1.25rem; margin: .4rem 0 0; line-height: 1.55; }
.opshop-howto li + li { margin-top: .3rem; }
.opshop-save-notice { background: #fff6e7; border: 2px solid #d99c47;
  border-radius: 8px; padding: 1rem 1.1rem; margin: 1.15rem 0; }
.opshop-save-title { display: block; font-size: 1.1rem; color: #7f263b; margin-bottom: .4rem; }
.opshop-save-notice p { margin: 0; line-height: 1.6; }
.opshop-status { border-radius: 8px; padding: .9rem 1rem; margin: 1.1rem 0;
  border-left: 4px solid var(--opshop-navy); }
.opshop-status--good { background: var(--opshop-good); }
.opshop-status--warn { background: var(--opshop-warn); border-left-color: var(--opshop-burgundy); }
.opshop-credentials { background: var(--opshop-cream); border: 1px solid var(--opshop-border);
  padding: 1.2rem; line-height: 2; border-radius: 8px; overflow-wrap: anywhere; margin: 1rem 0; }
.opshop .opshop-action.btn-primary { background-color: var(--opshop-navy);
  border-color: var(--opshop-navy); font-weight: 650; margin: .55rem .3rem .55rem 0; }
.opshop .opshop-action.btn-primary:hover,
.opshop .opshop-action.btn-primary:focus { background-color: #0d2b40; border-color: #0d2b40; }
.opshop-secondary { margin: 0 0 1rem; }
.opshop-sandbox { margin-top: 1.6rem; color: var(--opshop-muted); font-size: .8rem; }
.opshop-inline-form { display: inline-block; margin: .5rem .5rem .5rem 0; }
.opshop-receipt #opshop-go[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.opshop-receipt #opshop-go.opshop-ready { opacity: 1; cursor: pointer; }
.opshop-recover input.form-control { max-width: 100%; }
.opshop a { text-underline-offset: 3px; }
@media (max-width: 600px) {
  .opshop { padding: 0 .5rem; margin: 1rem auto 2rem; }
  .opshop-panel { border-radius: 8px; }
  .opshop .opshop-action, .opshop .opshop-inline-form { width: 100%; }
  .opshop .opshop-inline-form .btn { width: 100%; }
  .opshop-receipt #opshop-copy { width: 100%; }
}

/* OP_UI_20261205_V1 — product pages only. Existing receipt and recovery styles unchanged. */
body#page-local-opshop-index #page.drawers .main-inner,
body#page-local-opshop-index #page-content,
body#page-local-opshop-index #page-header {max-width: 1280px;}
body#page-local-opshop-index #region-main {width:100%; min-width:0; max-width:none; padding:clamp(.65rem,2vw,1.6rem);}
body#page-local-opshop-index #region-main [role="main"] {max-width:none; min-width:0;}
body .opshop.opshop-product {--opshop-navy:#294c60;--opshop-burgundy:#922d40;--opshop-ink:#20272f;--opshop-muted:#53606d;--opshop-border:#e2e0db;--opshop-cream:#f5f4f1; max-width:1160px; width:100%; margin:.5rem auto 1.5rem; padding:0;}
body .opshop-product .opshop-panel {border:0; border-radius:0; box-shadow:none; padding:0; background:transparent; min-width:0;}
body .opshop-product .opshop-panel > h2 {font-size:clamp(1.7rem,3vw,2.4rem); line-height:1.18;}
body .opshop-product .opshop-eyebrow {letter-spacing:.07em; margin-bottom:.4rem;}
body .opshop-product .opshop-price {font-size:clamp(1.6rem,2.4vw,2.05rem); line-height:1.3;}
body .opshop-product .opshop-price span {display:inline-block; font-size:.94rem;}
body .opshop-product .opshop-summary {background:transparent; border-radius:0; padding:0; margin:1.15rem 0; overflow-wrap:break-word; line-height:1.6;}
body .opshop-product .opshop-summary > .no-overflow:has(.op-offer-v2) {overflow:visible;}
body .opshop-product :is(.opshop-checkout,.opshop-howto,.opshop-status,.opshop-sandbox) {max-width:760px; margin-inline:auto;}
body .opshop-product .opshop-checkout {padding:clamp(.85rem,2.5vw,1.6rem); border:1px solid #e2e0db; border-radius:.8rem; background:#fff; scroll-margin-top:6rem;}
body .opshop-product .opshop-action.btn-primary, body .opshop-product .opv3-checkout-link {
    color:#fff!important; background:#922d40!important; border-color:#922d40!important; font-weight:700;
    border-radius:.55rem; text-decoration:none; white-space:normal;
}
body .opshop-product :is(.opshop-action.btn-primary,.opv3-checkout-link):hover {background:#742334!important;border-color:#742334!important;color:#fff!important;}
body .opshop-product .opv3-checkout-link {display:inline-flex; align-items:center; min-height:44px; padding:.7rem 1.25rem;}
body .opshop-product .opshop-howto {background:#f1f5f6; border-left-color:#294c60;}
/* Same offer markup in both contexts. Scope all rules to the existing opt-in wrapper. */
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 {color:#20272f; font-size:1rem; line-height:1.6; overflow-wrap:break-word; container-type:inline-size;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 * {box-sizing:border-box;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 h2 {font-size:clamp(1.55rem,4cqi,2.15rem); line-height:1.2; color:#294c60; font-weight:700; margin:.4rem 0 .8rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 h3 {font-size:1.2rem; line-height:1.35; color:#294c60; font-weight:700; margin:1.2rem 0 .7rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 p {margin:0 0 .7rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-kicker {color:#922d40; font-weight:700; font-size:.82rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 :is(.opv2-level,.opv2-small,.opv2-title span) {color:#53606d; font-size:.9rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 :is(.opv2-hero,.opv2-feature,.opv2-author,.opv2-terms) {border:1px solid #e2e0db; background:#fff; border-radius:.85rem; padding:clamp(1rem,3cqi,1.65rem); margin:0 0 1rem; min-width:0;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-hero {background:#f5f4f1; border-top:3px solid #922d40;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-feature {background:#edf2f4; border-top:3px solid #294c60; margin-top:1rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 :is(.opv2-feature,.opv2-author,.opv2-terms) > h3 {margin-top:0;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-facts {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.55rem; margin:1rem 0;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-facts > div {background:#fff; border:1px solid #e2e0db; border-radius:.55rem; padding:.65rem; min-width:0;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-facts strong {display:block; color:#922d40; font-size:1rem; line-height:1.25; overflow-wrap:anywhere;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-facts span {display:block; color:#53606d; font-size:.84rem; margin-top:.3rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-topics {display:grid; grid-template-columns:minmax(0,1fr); gap:.7rem; align-items:start;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-expand {background:#fff; border:1px solid #e2e0db; border-radius:.65rem; margin:0 0 .6rem; min-width:0;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-title {display:block; color:#294c60; padding:.9rem 1rem; margin:0;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-title span {display:block; margin-top:.3rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 summary.opv2-title {cursor:pointer; list-style:none; position:relative; padding-right:2.5rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 summary.opv2-title::-webkit-details-marker {display:none;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 summary.opv2-title::after {content:'+'; color:#922d40; font-weight:700; position:absolute; top:.8rem; right:.9rem; font-size:1.2rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 details[open] > summary.opv2-title::after {content:'−';}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-content {padding:0 1rem .85rem;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-cycle {background:#fff; color:#294c60; text-align:center; border-radius:.5rem; padding:.7rem; margin:.8rem 0;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 a {text-underline-offset: .16em;}
body :is(.opshop-product,.course-summary-modal) .op-offer-v2 :is(a,button,summary):focus-visible {outline:3px solid #294c60; outline-offset:2px;}
body .opshop-product .op-offer-v2 .opv2-modal-action {display:none;}
/* Live price is already printed by OPshop; preserve detailed price/terms below. */
body .opshop-product .op-offer-v2 .opv2-hero .opv2-price {display:none;}
body .course-summary-modal .op-offer-v2 .opv2-modal-action {display:block; margin:.8rem 0 0;}
body .course-summary-modal .op-offer-v2 .opv2-modal-action a {display:block; padding:.75rem; text-align:center; background:#922d40!important; color:#fff!important; border-radius:.55rem; text-decoration:none!important; font-weight:700;}
body .course-summary-modal .op-offer-v2 .opv2-modal-action a:hover {background:#742334!important;color:#fff!important;}
body .course-summary-modal:has(.op-offer-v2) .modal-dialog {width:calc(100% - 1.5rem); max-width:860px; margin-inline:auto;}
body .course-summary-modal:has(.op-offer-v2) .modal-body {max-height:68vh; overflow-y:auto; padding:clamp(.85rem,2vw,1.35rem);}
/* Gallery only for products that have an approved gallery manifest. */
.op-offer-v2 .opv3-lead {display:grid; grid-template-columns:minmax(0,1fr); gap:1rem; margin-bottom:1.15rem; align-items:stretch;}
.op-offer-v2 .opv3-lead > .opv2-hero {margin-bottom:0!important;}
.op-offer-v2 .opv3-gallery {min-width:0; border:1px solid #e2e0db; background:#fff; border-radius:.85rem; padding:1rem; display:flex; flex-direction:column; gap:.6rem;}
.op-offer-v2 .opv3-gallery h3 {margin:0!important; font-size:1.13rem!important;}
.op-offer-v2 .opv3-gallery a.opv3-image {display:block; border:1px solid #e2e0db; border-radius:.5rem; background:#f5f4f1; aspect-ratio:16/10; overflow:hidden;}
.op-offer-v2 .opv3-gallery img {width:100%; height:100%; object-fit:contain; display:block;}
.op-offer-v2 .opv3-caption {margin:0!important; line-height:1.45; color:#53606d; font-size:.9rem; min-height:2.6em;}
.op-offer-v2 .opv3-caption strong {color:#294c60;}
.op-offer-v2 .opv3-controls {display:flex; gap:.45rem; justify-content:space-between; align-items:center;}
.op-offer-v2 .opv3-controls button,.op-offer-v2 .opv3-dots button {border:1px solid #cbd6da; background:#fff; color:#294c60; border-radius:.45rem; min-height:36px; min-width:36px; font-weight:700;}
.op-offer-v2 .opv3-controls button:hover,.op-offer-v2 .opv3-dots button:hover {background:#edf2f4;}
.op-offer-v2 .opv3-dots {display:flex; flex-wrap:wrap; gap:.3rem; justify-content:center;}
.op-offer-v2 .opv3-dots button {min-width:30px; min-height:30px; font-size:.85rem;}
.op-offer-v2 .opv3-dots button[aria-pressed="true"] {background:#294c60; color:#fff; border-color:#294c60;}
.op-offer-v2 .opv3-counter {color:#53606d; font-size:.85rem; font-variant-numeric:tabular-nums;}
@container (min-width:690px) {
    body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-topics {grid-template-columns:repeat(3,minmax(0,1fr));}
}
@container (min-width:850px) {.op-offer-v2 .opv3-lead {grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);}}
@container (min-width:680px) {.course-summary-modal .op-offer-v2 .opv3-lead {grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);}}
@container (max-width:390px) {body :is(.opshop-product,.course-summary-modal) .op-offer-v2 .opv2-facts {grid-template-columns:1fr;}}
@media(max-width:600px) {
    body .opshop-product .opv3-checkout-link {display:flex; justify-content:center; width:100%;}
    body .course-summary-modal:has(.op-offer-v2) .modal-dialog {margin:.75rem auto;}
    body .course-summary-modal:has(.op-offer-v2) .modal-body {max-height:70vh;}
}
