/* Parent purchase layout, including non-blocking promotional presentation. */
.catalog-product-scroll { min-width: 0; }
.school-main-image[hidden] { display: none; }
.catalog-product-scroll:focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; }

/* One vertical scroll surface on desktop; short and zoomed screens keep normal page scrolling. */
@media (min-width: 1101px) and (min-height: 700px) {
    html:has(body.stage-builder) { height: 100%; overflow: hidden; }
    body.stage-builder { height: 100dvh; overflow: hidden; }
    body.stage-builder .page-shell {
        height: 100%;
        padding: 16px 0 10px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    body.stage-builder .site-header { flex: 0 0 auto; margin: 0; }
    body.stage-builder .messages { flex: 0 0 auto; margin: 0; }
    body.stage-builder .main-shell { flex: 1; min-height: 0; margin: 0; }
    body.stage-builder .builder-layout {
        height: 100%;
        min-height: 0;
        grid-template-columns: minmax(280px, .7fr) minmax(0, 1.5fr);
        grid-template-areas: "context context" "photo products";
        grid-template-rows: auto minmax(0, 1fr);
        gap: 16px;
        align-items: stretch;
    }
    body.stage-builder .builder-layout > * { min-height: 0; }
    body.stage-builder .student-summary {
        position: relative;
        z-index: 3;
        grid-template-columns: minmax(0, 1fr) minmax(220px, 320px) auto;
        align-items: center;
        padding: 12px 16px;
        gap: 16px;
    }
    body.stage-builder .student-summary:not(:has(.student-switcher)) { grid-template-columns: minmax(0, 1fr) auto; }
    body.stage-builder .student-summary-head h1 { font-size: clamp(1.5rem, 2vw, 2rem); }
    body.stage-builder .student-summary-head { min-width: 0; flex-wrap: wrap; gap: 12px; }
    body.stage-builder .campaign-deadline { min-width: 0; padding: 6px 10px; gap: 8px; border-radius: 12px; }
    body.stage-builder .campaign-deadline-icon { flex-basis: 28px; width: 28px; height: 28px; border-radius: 8px; }
    body.stage-builder .campaign-deadline-icon svg { width: 18px; height: 18px; }
    body.stage-builder .campaign-deadline > span:last-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
    body.stage-builder .campaign-deadline strong { font-size: 1rem; }
    body.stage-builder .student-switcher { min-width: 0; border-top: 0; padding: 0; gap: 4px; }
    body.stage-builder .student-switcher-label { flex: 0 0 auto; }
    body.stage-builder .linked-access-strip { min-width: 0; }
    body.stage-builder .linked-access-card { min-height: 44px; padding: 4px 8px; }
    body.stage-builder .linked-access-avatar { width: 28px; height: 28px; }
    body.stage-builder .student-details { display: block; padding-top: 0; margin: 0; }
    body.stage-builder .student-details > summary { gap: 8px; }
    body.stage-builder .student-details[open] summary { margin-bottom: 0; }
    body.stage-builder .student-details[open] .student-info-grid {
        position: absolute;
        top: 100%;
        left: 16px;
        right: 16px;
        z-index: 4;
        margin-top: 4px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fffdf9;
        box-shadow: 0 12px 28px rgba(36, 31, 26, .16);
    }
    body.stage-builder .student-info-grid { gap: 8px; }
    body.stage-builder .student-info-card { min-height: 56px; padding: 8px 10px; }
    body.stage-builder .visual-stage {
        position: static;
        grid-template-rows: auto minmax(0, 1fr) auto;
        padding: 12px;
        gap: 8px;
    }
    body.stage-builder .visual-stage-head h1 { font-size: 1.3rem; }
    body.stage-builder .visual-stage-head .section-kicker { display: none; }
    body.stage-builder .school-visual-main {
        min-height: 0;
        height: 100%;
        grid-template-rows: minmax(0, 1fr) auto;
    }
    body.stage-builder .school-main-image { height: 100%; min-height: 0; max-height: none; }
    body.stage-builder .school-visual-main .visual-main-copy { padding: 10px 12px; gap: 6px; }
    body.stage-builder .school-visual-main .visual-main-copy h2 { font-size: 1.15rem; }
    body.stage-builder .school-visual-main .visual-main-copy strong { font-size: .88rem; }
    body.stage-builder .school-visual-main.has-photo .visual-main-copy { display: none; }
    body.stage-builder .school-thumb-grid {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 96px;
        grid-template-columns: none;
        overflow-x: auto;
        padding: 3px 3px 6px;
        scrollbar-width: thin;
    }
    body.stage-builder .school-thumb-visual { aspect-ratio: 16 / 9; }
    body.stage-builder .school-thumb-copy { padding: 6px 8px; font-size: .8rem; }
    body.stage-builder .catalog-main { min-height: 0; grid-template-rows: minmax(0, 1fr); }
    body.stage-builder .catalog-products {
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 16px 20px;
        gap: 12px;
        overflow: hidden;
    }
    body.stage-builder .catalog-products > :not(.catalog-product-scroll) { flex: 0 0 auto; }
    body.stage-builder .catalog-products-head h2 { font-size: 1.6rem; }
    body.stage-builder .catalog-products-head .section-kicker { display: none; }
    body.stage-builder .catalog-controls { padding: 8px; gap: 10px; flex-wrap: wrap; }
    body.stage-builder .catalog-tabs { gap: 5px; }
    body.stage-builder .catalog-tabs button { min-height: 40px; }
    body.stage-builder .catalog-product-scroll {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scrollbar-gutter: stable;
        padding: 4px 6px 12px 2px;
    }
    body.stage-builder .catalog-product-scroll .product-collection { padding-top: 0; border-top: 0; }
    body.stage-builder .legal-footer { flex: 0 0 auto; margin: 0; padding: 8px 76px 0 4px; gap: 8px 20px; }
    body.stage-builder .compact-cart-bar { display: none; }
    body.stage-builder.has-cart-items .top-nav a[href$="/panier/"] { color: var(--primary-deep); background: rgba(185, 92, 55, .1); }
}

@media (min-width: 1101px) {
    .builder-layout { grid-template-areas: "photo context" "photo products"; grid-template-rows: auto 1fr; }
    .builder-layout > .student-summary { grid-area: context; }
    .builder-layout > .visual-stage { grid-area: photo; }
    .builder-layout > .catalog-main { grid-area: products; }
}
.student-details > summary {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: .88rem;
    color: var(--secondary);
}
.student-details > summary::after { content: "+"; margin-left: auto; font-size: 1.2rem; }
.student-details[open] > summary::after { content: "\2212"; }
.student-details:not([open]) .student-info-grid { display: none; }
.student-details[open] .student-info-grid { margin-top: 12px; }

.catalog-products .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 248px), 1fr));
    align-items: stretch;
    gap: 18px;
}
.catalog-products .product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(36, 31, 26, .13);
    background: #fffdf9;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.catalog-products .product-card:hover { transform: none; }
.catalog-products .product-card-copy { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.catalog-products .product-card h4 { min-height: 0; font-size: 1.15rem; line-height: 1.3; overflow-wrap: anywhere; }
.catalog-products .product-card-copy > form { margin-top: 0; padding-top: 12px; }
.catalog-products .product-card-footer { gap: 12px; flex-wrap: wrap; }
.catalog-products .product-card-footer > strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.catalog-products .product-add-button { min-height: 46px; flex: 1; max-width: 180px; font-size: .94rem; }
.catalog-products .product-card-description :is(summary, p) { font-size: .9rem !important; line-height: 1.5; }
.product-photo-context { margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.5; }
.product-photo-context strong { color: var(--text); font-weight: 600; }
.product-photo-choice { min-height: 44px; padding: 6px 0; border: 0; background: none; color: var(--secondary); font: inherit; font-weight: 600; text-align: left; text-decoration: underline; cursor: pointer; }
.product-photo-choice[hidden], .product-photo-context [hidden] { display: none; }
.catalog-products .product-add-button:disabled { opacity: .5; cursor: not-allowed; }
.preview-photo-notice { width: 100%; margin: 0; color: var(--muted); font-size: .9rem; }
.preview-photo-notice[hidden] { display: none; }
.catalog-products .product-digital-meta { margin: 0; font-size: .87rem; line-height: 1.45; }
.catalog-products .product-card-visual { flex-shrink: 0; height: 216px; min-height: 0; }
.catalog-products .product-card-visual .product-card-image { object-fit: contain; }
.catalog-products .product-preview-label { opacity: 1; transform: none; }
.catalog-products .render-mode-picker { gap: 8px; }
.catalog-products .render-mode-picker label { min-height: 40px; }
.catalog-products .product-add-button.is-submitting { cursor: wait; }
.catalog-products .product-add-button.is-added { background: var(--secondary); }
.catalog-tabs button[aria-selected="false"]:hover { color: var(--text); background: #eee9e1; }

html:has(body.modal-open), html:has(body.cart-addon-open) { overflow: hidden; }
#preview-overlay { padding: 24px; }
#preview-overlay .preview-dialog {
    width: min(1080px, 100%);
    height: min(800px, calc(100dvh - 48px));
    max-height: calc(100dvh - 48px);
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0;
    padding: 0;
    overflow: hidden;
    background: #fffdf9;
}
.preview-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}
.preview-sheet-head > div { min-width: 0; }
.preview-sheet-head h2 { margin: 5px 0 0; font-size: 1.6rem; line-height: 1.2; overflow-wrap: anywhere; }
#preview-overlay .preview-close { position: static; min-height: 44px; flex-shrink: 0; color: var(--text); background: #eee9e1; }
.preview-dialog-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr);
    align-content: start;
    align-items: start;
    scrollbar-gutter: stable;
}
#preview-overlay .preview-dialog-visual {
    min-height: 370px;
    height: auto;
    overflow: visible;
    border-radius: 0;
    background: #f1eee8;
}
#preview-overlay .preview-dialog-visual::after { display: none; }
#preview-overlay .preview-product-image { position: relative; height: 420px; padding: 20px; object-fit: contain; }
#preview-overlay .preview-product-image[hidden] { display: none; }
#preview-overlay .preview-dialog-copy { padding: 24px; overflow: visible; height: auto; }
#preview-overlay .preview-copy-text { font-size: 1rem; line-height: 1.6; }
#preview-overlay .preview-pack-components {
    position: relative;
    inset: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    overflow: visible;
    background: none;
}
#preview-overlay .preview-pack-component { padding: 12px; box-shadow: none; border-color: var(--line); background: #fff; }
#preview-overlay .preview-pack-component-visual { height: 200px; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#preview-overlay .preview-pack-component-visual > img { display: block; width: 100%; height: 100%; object-fit: contain; }
#preview-overlay .preview-pack-component-copy { font-size: .9rem; overflow-wrap: anywhere; }
#preview-overlay .preview-pack-component-copy :is(strong, span) { font-size: .9rem; }
#preview-overlay .preview-pack-select-label { font-size: .85rem; }
#preview-overlay .preview-pack-select-label select { width: 100%; min-height: 44px; font-size: 16px; }
.preview-sheet-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: #fffdf9;
}
.preview-sheet-price { flex-shrink: 0; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.preview-sheet-footer form { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.preview-sheet-footer [data-modal-add-button] { width: auto; min-width: 180px; min-height: 48px; }
.preview-sheet-footer .render-mode-picker { margin: 0; }
.preview-sheet-footer .render-mode-picker label { min-height: 40px; }

.checkout-list > .checkout-item {
    grid-template-columns: 100px minmax(0, 1fr);
    align-items: start;
    gap: 14px 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.checkout-list > .checkout-item > .checkout-actions { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.checkout-list > .checkout-item > .checkout-actions :is(.icon-button, .link-button) { min-width: 44px; min-height: 44px; }
.checkout-list > .checkout-item .checkout-line-price { margin-left: auto; font-variant-numeric: tabular-nums; }
.checkout-list > .checkout-item .checkout-item-copy h3 { font-size: 1.12rem; line-height: 1.35; }
.checkout-list > .checkout-item .checkout-item-copy > .muted { font-size: .9rem; }
.cart-suggestion-error { margin: 8px 0 0; color: #8a352a; font-size: .88rem; line-height: 1.4; }
.checkout-actions .cart-suggestion-error { flex-basis: 100%; }
body .cart-toast { left: 50%; right: auto; max-width: calc(100vw - 24px); box-sizing: border-box; color: #fffdf8; transform: translate(-50%, 12px); }
body .cart-toast.is-visible { transform: translate(-50%, 0); }
.cart-pack-components { display: grid; gap: 8px; }
.cart-pack-component { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 10px; min-width: 0; }
.cart-pack-component:not(:has(> img)) { grid-template-columns: minmax(0, 1fr); }
.cart-pack-component > img { width: 44px; height: 58px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 6px; object-fit: contain; background: #f1eee8; }
:is(.cart-pack-component, .cart-item-visual.has-pack-renders) > img.is-black-white { filter: grayscale(1); }
:is(.cart-pack-component, .cart-item-visual.has-pack-renders) > img.is-sepia { filter: sepia(.88) saturate(.82) contrast(1.04); }
.cart-item-visual.has-pack-renders { grid-template-rows: minmax(0, 1fr); }
.cart-item-visual.has-pack-renders > img { min-width: 0; min-height: 0; object-fit: contain; }
.checkout-item-pack .cart-pack-component > :is(p, .cart-pack-component-copy) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; margin: 0; min-width: 0; max-width: 100%; }
.cart-pack-component :is(p, .cart-pack-component-copy) :is(strong, span, small) { display: block; min-width: 0; max-width: 100%; font-size: .85rem; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.cart-student-group > .cart-group-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.cart-student-group > .cart-group-head > strong { white-space: nowrap; font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.cart-photo-group > .cart-photo-head > span { white-space: nowrap; }

.parent-mobile-menu[hidden] { display: none; }
.parent-mobile-menu { position: fixed; inset: 0; z-index: 150; display: grid; align-items: end; }
.parent-mobile-menu-backdrop { position: absolute; inset: 0; background: rgba(22, 29, 28, .42); }
.parent-mobile-menu-sheet { position: relative; max-height: 85dvh; overflow-y: auto; padding: 20px 20px max(22px, env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: #fffdf9; }
.parent-mobile-menu-sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.parent-mobile-menu-sheet h2 { margin: 0; font-size: 1.4rem; }
.parent-mobile-menu-sheet button { min-height: 44px; border: 0; padding: 0 14px; border-radius: 10px; background: #eee9e1; color: var(--text); cursor: pointer; }
.parent-mobile-menu-sheet > a { display: grid; gap: 4px; min-height: 60px; padding: 16px 0; border-top: 1px solid var(--line); font-size: 1rem; }
.parent-mobile-menu-sheet > a:first-of-type { margin-top: 16px; }
.parent-mobile-menu-sheet > a > span { font-size: .87rem; color: var(--muted); }
.parent-mobile-menu-sheet > .parent-menu-assistant { display: grid; width: 100%; gap: 4px; min-height: 60px; padding: 16px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.parent-mobile-menu-sheet > .parent-menu-assistant > span { color: var(--muted); font-size: .87rem; }
body.parent-menu-open { overflow: hidden; }
body.parent-menu-open .assistant-shell,
body.modal-open .assistant-shell { visibility: hidden; }
.parent-mobile-menu-sheet :is(button, a):focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; }
.mobile-nav > button { border: 0; background: none; color: inherit; cursor: pointer; }

@media (min-width: 821px) and (max-width: 1100px) {
    .site-header { flex-direction: column; align-items: stretch; gap: 8px; }
    .top-nav { min-width: 0; max-width: 100%; flex-wrap: wrap; justify-content: flex-start; padding: 5px; gap: 4px; }
    .top-nav .nav-link { padding: 9px 10px; min-height: 44px; font-size: .88rem; }
}

@media (max-width: 900px) {
    .builder-layout { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
    .builder-layout > .catalog-main { display: contents; }
    .builder-layout :is(.student-summary, .visual-stage, .catalog-products, .archived-campaign-panel) { width: 100%; }
    .builder-layout .student-summary { order: 1; }
    .builder-layout > .visual-stage { order: 2; position: static; }
    .builder-layout :is(.catalog-products, .archived-campaign-panel) { order: 3; }
    .student-summary-head { gap: 12px; }
    .builder-layout .student-summary { padding: 16px; }
    .student-summary .student-summary-head { display: grid; grid-template-columns: minmax(0, 1fr); }
    .student-summary .campaign-deadline { padding: 10px 12px; min-height: 0; }
    .student-summary .campaign-deadline strong { font-size: 1.05rem; }
    .student-summary .campaign-deadline-icon { width: 32px; height: 32px; }
    .student-summary .student-details { padding-bottom: 0; }
    .student-summary-head h1 { font-size: 1.5rem; }
    .student-summary .linked-access-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible; padding: 0; }
    .student-summary .linked-access-card { min-width: 0; width: auto; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; padding: 10px; }
    .student-summary .linked-access-avatar { width: 32px; height: 32px; font-size: 1rem; }
    .student-summary .linked-access-copy :is(strong, span) { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
    .student-summary .linked-access-copy strong { font-size: .9rem; }
    .student-summary .linked-access-check { display: none; }
    .student-details { margin-top: 8px; padding-top: 4px; }
    .visual-stage .visual-stage-head { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; text-align: left; }
    .visual-stage .visual-stage-head > div { min-width: 0; }
    .visual-stage .visual-stage-head h1 { font-size: 1.25rem; text-align: left; }
    .visual-stage .photo-badge { width: auto; flex-shrink: 0; align-self: center; white-space: nowrap; font-size: .8rem; }
    .visual-stage-head .section-kicker { display: none; }
    .school-visual-main.has-photo { display: block; min-height: 0; }
    .school-visual-main.has-photo .school-main-image { position: static; display: block; height: clamp(210px, 28svh, 280px); width: 100%; max-height: none; padding: 12px; object-fit: contain; }
    .school-visual-main.has-photo .visual-main-copy { position: static; padding: 12px 14px; background: #fffdf9; color: var(--text); }
    .school-visual-main.has-photo .visual-main-copy h2 { margin: 4px 0 0; font-size: 1.08rem; }
    .school-visual-main.has-photo .visual-main-copy strong { display: none; }
    .school-visual-main .card-tag { padding: 0; border: 0; background: none; color: var(--muted); font-size: .85rem; }
    .visual-thumbs { margin-top: 12px; }
    .school-thumb { flex-basis: 112px; }
    .school-thumb-visual { height: 82px; }
    .school-thumb-copy strong { white-space: normal; font-size: .88rem; line-height: 1.3; }
    .school-thumb-copy span { font-size: .82rem; }
    .catalog-controls { gap: 14px; }
    .catalog-tabs button { font-size: .92rem; }
    .selected-photo-chip { font-size: .85rem; }
}

@media (max-width: 720px) {
    .mobile-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .mobile-nav > button { border: 0; background: none; color: inherit; cursor: pointer; }
    .mobile-nav-link span:not(.mobile-nav-count) { font-size: .82rem !important; }
    .catalog-tabs { width: 100%; display: flex; flex-wrap: nowrap; gap: 4px; overflow: visible; }
    .catalog-tabs button { flex: 1; min-width: 0; min-height: 44px; padding: 8px 6px; font-size: .88rem; white-space: nowrap; }
    .catalog-products .product-grid { grid-template-columns: minmax(0, 1fr); }
    .catalog-products .product-card { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); }
    .catalog-products .product-card-visual { height: 100%; min-height: 210px; }
    .catalog-products .product-card-copy { padding: 14px; }
    .catalog-products .product-card h4 { font-size: 1.05rem; }
    .catalog-products .product-preview-label { font-size: .78rem; }
    .catalog-products .product-card-footer { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 8px; }
    .catalog-products .product-add-button { flex-basis: auto; width: 100%; min-width: 0; max-width: none; min-height: 46px; height: auto; }
    .catalog-products .product-card-footer > strong { font-size: 1.12rem; }
    .catalog-products .product-photo-context { font-size: .83rem; }
    #preview-overlay { padding: 0; }
    #preview-overlay .preview-dialog { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
    .preview-sheet-head { padding: max(14px, env(safe-area-inset-top)) 16px 12px; }
    .preview-sheet-head h2 { font-size: 1.3rem; }
    .preview-dialog-scroll { display: block; }
    #preview-overlay .preview-dialog-visual { min-height: 0; }
    #preview-overlay .preview-product-image { height: clamp(210px, 38dvh, 360px); padding: 16px; }
    #preview-overlay .preview-dialog-copy { padding: 16px; }
    #preview-overlay .preview-pack-component-visual { height: 160px; }
    #preview-overlay .preview-pack-components { padding: 12px; gap: 10px; }
    .preview-sheet-footer { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); gap: 10px; flex-wrap: wrap; }
    .preview-sheet-price { font-size: 1.2rem; }
    .preview-sheet-footer form { display: contents; }
    .preview-sheet-footer .render-mode-picker { width: 100%; order: -1; }
    .preview-sheet-footer [data-modal-add-button] { flex: 1; min-width: 0; font-size: .95rem; padding-inline: 12px; }
    .checkout-list > .checkout-item { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
    .checkout-list > .checkout-item > .checkout-actions { grid-column: 1 / -1; }
    .checkout-list > .checkout-item > .cart-item-visual { width: 72px; height: 98px; }
    .cart-student-group { padding: 14px; }
    .cart-student-group > .cart-group-head { gap: 8px; }
    .cart-student-group > .cart-group-head h2 { font-size: 1.28rem; }
    .cart-student-group > .cart-group-head > strong { font-size: 1rem; }
    .cart-photo-group > .cart-photo-head { gap: 8px; flex-wrap: wrap; }
    .cart-pack-component > img { width: 36px; height: 48px; }
    .cart-pack-component { grid-template-columns: 36px minmax(0, 1fr); }
}

@media (max-width: 360px) {
    .catalog-tabs button { flex: 1 0 auto; font-size: .82rem; padding-inline: 4px; }
    .catalog-products .product-card { display: flex; }
    .catalog-products .product-card-visual { height: 210px; min-height: 0; }
    .catalog-products .product-card-footer { display: flex; flex-wrap: nowrap; align-items: center; }
    .catalog-products .product-add-button { flex-basis: auto; }
    #preview-overlay .preview-pack-components { grid-template-columns: minmax(0, 1fr); }
    .cart-student-group > .cart-group-head { flex-wrap: wrap; }
}
@media (min-width: 561px) and (max-height: 480px) and (orientation: landscape) {
    #preview-overlay .is-pack-preview .preview-pack-component { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 6px 10px; }
    #preview-overlay .is-pack-preview .preview-pack-component-visual { grid-row: 1 / span 2; height: 118px; }
    #preview-overlay .is-pack-preview .preview-pack-component-copy,
    #preview-overlay .is-pack-preview .preview-pack-component-configuration { grid-column: 2; }
    #preview-overlay .is-pack-preview .preview-pack-component-configuration { padding-top: 0; border: 0; }
}

@media (min-width: 361px) and (max-width: 480px) {
    #preview-overlay .preview-pack-components { grid-template-columns: minmax(0, 1fr); }
    #preview-overlay .preview-pack-component { display: grid; grid-template-columns: 106px minmax(0, 1fr); gap: 10px; }
    #preview-overlay .preview-pack-component-visual { grid-row: 1 / span 2; height: 170px; }
    #preview-overlay .preview-pack-component-copy,
    #preview-overlay .preview-pack-component-configuration { grid-column: 2; min-width: 0; }
}

@media (min-width: 361px) and (max-width: 720px) {
    body.stage-builder.has-mobile-parent-nav .assistant-shell:not(.is-open) {
        left: 12px !important;
        right: auto !important;
    }
}

@media (max-height: 480px) and (orientation: landscape) {
    #preview-overlay { padding: 10px; }
    #preview-overlay .preview-dialog { height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); }
    .preview-sheet-head { padding-block: 8px; }
    .preview-sheet-head h2 { font-size: 1.2rem; }
    .preview-sheet-footer { padding-block: 8px; }
    #preview-overlay .preview-pack-components { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .preview-dialog-scroll { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-products .product-card { transition: none; }
}

/* Packs use all the modal width, rather than a narrow image column beside empty space. */
#preview-overlay .is-pack-preview .preview-dialog-scroll { display: flex; flex-direction: column; align-items: stretch; }
#preview-overlay .is-pack-preview .preview-dialog-copy { flex: 0 0 auto; order: -1; padding: 14px 20px; background: #fffdf9; border: 0; border-radius: 0; box-shadow: none; }
#preview-overlay .is-pack-preview .product-description-details { display: block; margin: 0; padding: 0; border: 0; background: none; }
#preview-overlay .is-pack-preview .product-description-details > summary { display: none; }
#preview-overlay .is-pack-preview .preview-copy-text { margin: 0; font-size: .95rem; }
#preview-overlay .is-pack-preview .preview-dialog-visual { display: block; flex: 0 0 auto; padding: 0; min-height: 0; width: 100%; background: #f2f4f1; }
#preview-overlay .is-pack-preview .preview-pack-components { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; padding: 18px; gap: 14px; }
#preview-overlay .is-pack-preview .preview-pack-component { display: flex; flex-direction: column; gap: 10px; min-width: 0; height: auto; padding: 12px; border-radius: 14px; }
#preview-overlay .is-pack-preview .preview-pack-component-visual { width: 100%; height: 160px; min-height: 0; grid-row: auto; }
#preview-overlay .is-pack-preview .preview-pack-component-copy { display: grid; gap: 4px; padding: 0; min-width: 0; }
#preview-overlay .is-pack-preview .preview-pack-component-copy strong { white-space: normal; line-height: 1.35; }
#preview-overlay .is-pack-preview .preview-pack-component-configuration { width: 100%; margin: 0; padding-top: 8px; border-top: 1px solid var(--line); }
#preview-overlay .is-pack-preview .preview-pack-component-configuration[hidden] { display: none; }
#preview-overlay .is-pack-preview .preview-pack-select-label { display: grid; gap: 5px; min-width: 0; }
#preview-overlay .is-pack-preview .preview-pack-select-label select { min-width: 0; max-width: 100%; padding: 8px; }
.preview-pack-count { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.preview-pack-count[hidden] { display: none; }
.preview-price-block { display: grid; gap: 4px; flex-shrink: 0; }
.preview-price-block > small { color: var(--muted); font-size: .8rem; }
.cart-addon-price-hint { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.pack-more-count { position: absolute; left: 8px; top: 8px; z-index: 4; padding: 6px 9px; border-radius: 8px; background: #fffdf9; color: var(--text); font-size: .78rem; font-weight: 700; }
.suggestion-recipient { width: 100%; grid-column: 1 / -1; display: grid; gap: 6px; padding: 14px 20px; border-bottom: 1px solid var(--line); order: -2; }
.suggestion-recipient :is(label, strong) { font-size: 1rem; }
.suggestion-recipient select { width: 100%; max-width: 480px; min-height: 46px; font-size: 16px; }
.suggestion-recipient > span { font-size: .88rem; color: var(--muted); }
#preview-overlay .preview-dialog:not(.is-pack-preview) .preview-dialog-visual { height: 420px; min-height: 0; padding: 0; overflow: hidden; }
#preview-overlay .preview-dialog:not(.is-pack-preview) .preview-product-image { height: 100%; }
#preview-overlay .preview-dialog:not(.is-pack-preview) .parent-template-canvas-modal { transform: translate(-50%, -50%); }
.cart-suggestion-error { width: 100%; font-size: .95rem; line-height: 1.5; color: #8f2e23; }
.cart-suggestion-error[hidden] { display: none; }

body.stage-builder .builder-promotion-status { position: static; transform: none; width: 100%; max-width: none; margin: 14px 0; filter: none; }
body.stage-builder .builder-promotion-status:not([hidden]) { display: block; }
.builder-promotion-status .cart-promotion { padding: 14px; box-shadow: none; border-radius: 14px; }
.cart-promotion-copy { min-width: 0; }
.cart-promotion-copy :is(strong, p, a, button) { font-size: .94rem; line-height: 1.45; overflow-wrap: anywhere; }
.cart-promotion-copy p { display: block !important; }
.cart-promotion-other { display: block; font-size: .85rem; }
.cart-promotion-rules { font-size: .88rem; line-height: 1.45; }
.promotion-product-button { display: inline-flex; align-items: center; min-height: 44px; padding: 5px 0; border: 0; background: none; color: var(--secondary); font: inherit; font-weight: 700; text-align: left; text-decoration: underline; cursor: pointer; }
.line-promotion { font-size: .88rem; line-height: 1.45; overflow-wrap: anywhere; }
.line-promotion ul { padding-left: 20px; }
.cart-addon-dialog { max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; padding: 24px; }
.cart-addon-dialog h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); line-height: 1.25; }
.cart-addon-dialog > p { font-size: .95rem; line-height: 1.5; }
.cart-addon-close { width: 44px; height: 44px; }
.cart-addon-card { width: 100%; text-align: left; font-family: inherit; grid-template-columns: 64px minmax(0, 1fr) auto; cursor: pointer; }
.cart-addon-card:disabled { opacity: .7; cursor: wait; }
.cart-addon-copy strong { font-size: 1rem; white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.35; }
.cart-addon-copy small { font-size: .8rem; }
.cart-addon-copy b { font-size: 1rem; }
.cart-addon-arrow span { display: inline; font-size: .82rem; white-space: normal; }
.cart-addon-dismiss { min-height: 46px; }
body.cart-addon-open .assistant-shell { visibility: hidden; }
.checkout-item-pack .cart-pack-components { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px 20px; padding: 12px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.checkout-item-pack .cart-pack-component > :is(p, .cart-pack-component-copy) { grid-template-columns: minmax(0, 1fr); width: 100%; }
.checkout-item-pack .cart-pack-component > :is(p, .cart-pack-component-copy) :is(strong, span, small) { font-size: .88rem; line-height: 1.45; }
.checkout-item-pack .cart-pack-component-copy > small { font-size: .78rem; font-weight: 500; color: var(--muted); }

@media (max-width: 900px) {
    #preview-overlay .is-pack-preview .preview-pack-components { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    #preview-overlay .preview-dialog:not(.is-pack-preview) .preview-dialog-visual { height: clamp(220px, 36dvh, 360px); }
    #preview-overlay .is-pack-preview .preview-pack-components { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 12px; }
    #preview-overlay .is-pack-preview .preview-pack-component { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: start; gap: 8px 12px; padding: 10px; }
    #preview-overlay .is-pack-preview .preview-pack-component-visual { grid-column: 1; grid-row: 1 / span 2; height: 136px; }
    #preview-overlay .is-pack-preview .preview-pack-component:has(> .preview-pack-component-configuration[hidden]) .preview-pack-component-visual { height: 104px; }
    #preview-overlay .is-pack-preview .preview-pack-component-copy,
    #preview-overlay .is-pack-preview .preview-pack-component-configuration { grid-column: 2; }
    #preview-overlay .is-pack-preview .preview-pack-component-configuration { padding-top: 0; border: 0; }
    #preview-overlay .is-pack-preview .preview-pack-component-copy span { font-size: .82rem; }
    #preview-overlay .is-pack-preview .preview-pack-component-copy strong { font-size: .9rem; }
    #preview-overlay .is-pack-preview .preview-pack-select-label span { font-size: .82rem; }
    #preview-overlay .is-pack-preview .preview-pack-select-label select { font-size: 16px; }
    .cart-addon-overlay { padding: 12px; }
    .cart-addon-dialog { max-height: calc(100dvh - 24px); padding: 20px 16px; border-radius: 20px; }
    .cart-addon-dialog > p { margin-right: 0; }
    .cart-addon-card { grid-template-columns: 54px minmax(0, 1fr); gap: 10px; }
    .cart-addon-visual { width: 54px; height: 64px; grid-row: 1 / span 2; }
    .cart-addon-arrow { grid-column: 2; justify-content: flex-start; }
    .cart-addon-copy small { display: none; }
    .cart-addon-dialog h2 { margin-right: 44px; }
    .checkout-item-pack .cart-pack-components { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) {
    #preview-overlay .is-pack-preview .preview-pack-component { grid-template-columns: 82px minmax(0, 1fr); gap: 8px; }
    #preview-overlay .is-pack-preview .preview-pack-component-visual { height: 118px; }
    #preview-overlay .is-pack-preview .preview-pack-select-label select { padding: 7px 4px; }
}

#preview-overlay .is-configurable-preview { grid-template-rows: auto auto auto minmax(0, 1fr); }
.pack-composer-progress { padding: 12px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.pack-composer-progress[hidden] { display: none; }
.pack-composer-progress-copy { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.pack-composer-progress-copy strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.pack-composer-progress-copy span { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.pack-composer-progress progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 20px; overflow: hidden; accent-color: #267b69; background: #e5ece8; }
.pack-composer-progress progress::-webkit-progress-bar { background: #e5ece8; border-radius: 20px; }
.pack-composer-progress progress::-webkit-progress-value { background: #267b69; border-radius: 20px; transition: width .15s ease-out; }
.pack-composer-progress.is-complete strong { color: #176554; }
#preview-overlay .is-configurable-preview .has-pack-composer { display: block; padding: 18px; color: var(--text); }
.pack-composer-hint { margin: 0 0 16px; font-size: .95rem; line-height: 1.5; color: var(--muted); }
.pack-composer-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pack-composer-gallery[hidden], .pack-composer-hint[hidden], .pack-composer-review[hidden] { display: none; }
.pack-composer-card { display: grid; grid-template-rows: 154px auto 1fr; gap: 10px; padding: 12px; min-width: 0; border: 2px solid #e0e6e2; border-radius: 16px; background: #fff; }
.pack-composer-card.is-selected { border-color: #267b69; }
#preview-overlay .is-configurable-preview .pack-composer-card > .preview-pack-component-visual { height: 154px; grid-row: auto; }
.pack-composer-card-copy { display: grid; align-content: start; gap: 5px; min-width: 0; }
.pack-composer-card-copy h3 { margin: 0; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
#preview-overlay .is-configurable-preview .pack-composer-card-copy h3 { color: var(--text); }
.pack-composer-selected { color: #176554; font-size: .85rem; font-weight: 600; }
.pack-composer-selected[hidden] { display: none; }
.pack-composer-card-controls { display: grid; align-content: end; gap: 10px; }
.pack-composer-render { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; }
.pack-composer-render select { width: 100%; min-width: 0; height: 44px; padding: 7px; font-size: 16px; border: 1px solid #d5ded9; border-radius: 10px; background: #fff; color: var(--text); }
.pack-composer-stepper { display: grid; grid-template-columns: 44px minmax(38px, 1fr) 44px; align-items: center; min-height: 44px; gap: 4px; border-radius: 10px; background: #f0f5f1; }
.pack-composer-stepper button { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; border: 1px solid #c6d7ce; border-radius: 10px; background: #fff; color: #174c40; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.pack-composer-stepper output { text-align: center; color: #174c40; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pack-composer-stepper button:disabled { color: #788880; background: #eef1ee; border-color: #e0e6e2; cursor: default; opacity: .65; }
.pack-composer-stepper button:not(:disabled):hover { background: #e6f2eb; }
.pack-composer-unavailable { color: #8b4a36; font-size: .9rem; }
.pack-composer-review-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.pack-composer-review-head h3 { margin: 0; font-size: 1.25rem; }
#preview-overlay .is-configurable-preview .pack-composer-review :is(h3, .pack-composer-review-copy strong) { color: var(--text); }
.pack-composer-edit { min-height: 44px; padding: 8px 16px; border: 1px solid #b8c9c0; border-radius: 10px; background: #fff; color: #174c40; font-size: 1rem; cursor: pointer; }
.pack-composer-review-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pack-composer-review-item { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 1px solid #d6e1da; border-radius: 14px; background: #fff; }
#preview-overlay .is-configurable-preview .pack-composer-review-item > .preview-pack-component-visual { height: 108px; grid-row: auto; }
.pack-composer-review-copy { display: grid; gap: 5px; min-width: 0; font-size: 1rem; overflow-wrap: anywhere; }
.pack-composer-review-copy span { color: var(--muted); font-size: .9rem; }
.pack-composer-review-quantity { font-size: 1.1rem; white-space: nowrap; color: #176554; }
#preview-overlay .is-configurable-preview:has(.is-reviewing) .preview-dialog-copy { display: none; }
#preview-overlay .is-configurable-preview [data-modal-add-button]:disabled { opacity: 1; box-shadow: none; background: #e0e5e0; color: #526159; cursor: default; }
.pack-composer-card button:focus-visible, .pack-composer-edit:focus-visible, .pack-composer-render select:focus-visible { outline: 3px solid #ce8a28; outline-offset: 3px; }
@media (max-width: 900px) {
    .pack-composer-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .pack-composer-progress { padding: 10px 16px; }
    .pack-composer-progress-copy strong { font-size: .95rem; }
    .pack-composer-progress-copy span { font-size: .85rem; }
    #preview-overlay .is-configurable-preview .has-pack-composer { padding: 12px; }
    .pack-composer-gallery { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .pack-composer-card { grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto; gap: 8px 12px; padding: 10px; }
    #preview-overlay .is-configurable-preview .pack-composer-card > .preview-pack-component-visual { grid-column: 1; grid-row: 1 / span 2; height: 142px; }
    .pack-composer-card-copy, .pack-composer-card-controls { grid-column: 2; }
    .pack-composer-render { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .pack-composer-render > span { display: none; }
    .pack-composer-review-list { grid-template-columns: minmax(0, 1fr); }
    .pack-composer-review-item { grid-template-columns: 78px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
    #preview-overlay .is-configurable-preview .pack-composer-review-item > .preview-pack-component-visual { height: 96px; }
}
@media (max-width: 360px) {
    .pack-composer-card { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
    #preview-overlay .is-configurable-preview .pack-composer-card > .preview-pack-component-visual { height: 132px; }
    .pack-composer-card-copy h3 { font-size: .94rem; }
    .pack-composer-review-item { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; }
    .pack-composer-review-head h3 { font-size: 1.1rem; }
}
@media (max-height: 500px) and (min-width: 561px) {
    .pack-composer-progress { padding-block: 6px; }
    .pack-composer-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pack-composer-card { grid-template-columns: 88px minmax(0, 1fr); grid-template-rows: auto auto; }
    #preview-overlay .is-configurable-preview .pack-composer-card > .preview-pack-component-visual { grid-column: 1; grid-row: 1 / span 2; height: 118px; }
    .pack-composer-card-copy, .pack-composer-card-controls { grid-column: 2; }
    .pack-composer-render > span { display: none; }
    .pack-composer-render { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .pack-composer-progress progress::-webkit-progress-value { transition: none; }
}
