/* ── The webshop on a site: the cart (site/shop-cart.js), and the shop's
   own pages — the order page and the customer's account
   (site/_shop_layout.html.twig). Everything is prefixed pgb- and sized in
   px, so a site's own CSS and font sizes don't reach in. --pgb-accent is
   the site's primary colour. ── */

.pgb-atc-bar-on .pgb-cart-toggle {
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
}
.pgb-cart-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: var(--site-z-cart, 9990);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--pgb-accent, #1e293b);
    color: #fff;
    font:
        600 15px / 1 system-ui,
        sans-serif;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}
.pgb-cart-toggle[hidden] {
    display: none;
}
.pgb-cart-count {
    min-width: 22px;
    padding: 3px 6px;
    border-radius: 999px;
    background: #fff;
    color: #1e293b;
    font-size: 12px;
    text-align: center;
}

.pgb-cart-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9991;
    background: rgba(15, 23, 42, 0.45);
}
.pgb-cart {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9992;
    display: flex;
    flex-direction: column;
    width: min(400px, 100vw);
    background: #fff;
    color: #1e293b;
    font:
        15px / 1.5 system-ui,
        sans-serif;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
}
.pgb-cart[hidden],
.pgb-cart-backdrop[hidden] {
    display: none;
}
.pgb-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.pgb-cart-head h2 {
    margin: 0;
    font-size: 18px;
}
.pgb-cart-close {
    border: 0;
    background: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}
.pgb-cart-lines {
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: 8px 20px;
    list-style: none;
}
.pgb-cart-line {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.pgb-cart-line img,
.pgb-cart-line .pgb-cart-noimg {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
}
.pgb-cart-name {
    font-weight: 600;
}
.pgb-cart-qty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.pgb-cart-qty button {
    width: 26px;
    height: 26px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
}
.pgb-cart-empty {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
}
.pgb-cart-foot {
    padding: 18px 20px;
    border-top: 1px solid #e2e8f0;
}
.pgb-cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: 4px;
}

.pgb-cart-note {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 13px;
}

.pgb-cart-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 14px;
}
.pgb-cart-checkout {
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 10px;
    background: var(--pgb-accent, #1e293b);
    color: #fff;
    font:
        600 16px / 1 system-ui,
        sans-serif;
    cursor: pointer;
}
.pgb-cart-checkout:disabled {
    opacity: 0.6;
    cursor: wait;
}

.pgb-cart-account {
    margin-left: auto;
    margin-right: 16px;
    color: #64748b;
    font-size: 14px;
}

/* The shop's own pages (the shop-content block, ShopBlocks): a card in
   the shop template, in the site's font; buttons and links in its primary
   colour (--pgb-accent, set on .pgb-shop-page). */
.pgb-shop-page {
    /* A short page (a login form) keeps the site's footer near the bottom. */
    min-height: 45vh;
    width: 100%;
    color: #1e293b;
    font-size: 16px;
    line-height: 1.6;
}
.pgb-card {
    max-width: 560px;
    margin: 0 auto;
    padding: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
}
/* In the editor: each sample page under its name and address */
.pgb-sample-label {
    max-width: 560px;
    margin: 28px auto 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pgb-sample-label:first-child {
    margin-top: 0;
}
.pgb-sample-label span {
    margin-left: 6px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.pgb-card--plain {
    padding: 0;
    border: 0;
    background: none;
}
.pgb-card h1 {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.25;
}
.pgb-card a {
    color: var(--pgb-accent, #1e293b);
}
.pgb-intro {
    margin: 0;
    white-space: pre-line;
}

/* The checkout page: the shop's own fields and summary, Stripe's Payment Element in it.
   Wider than the shop's card, and the blocks around it take the section's width. */
.ec-block:has(.pgb-co),
.ec-block-styled:has(.pgb-co),
.pgb-shop-page:has(.pgb-co) {
    align-self: stretch;
    box-sizing: border-box;
    width: 100%;
}
.pgb-card:has(.pgb-co) {
    box-sizing: border-box;
    width: 100%;
    max-width: 1080px !important;
}
.pgb-checkout-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 20px;
}
.pgb-checkout-head h1 {
    margin: 0;
}
.pgb-checkout-back {
    font-size: 14px;
}
.pgb-checkout-error,
/* A test order's checkout (the preview address): nothing is paid */
.pgb-co-test {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fef3c7;
    color: #78350f;
    font-size: 14px;
    line-height: 1.5;
}
.pgb-co-error {
    margin: 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 14px;
}
.pgb-co {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}
.pgb-co.is-busy {
    opacity: 0.6;
    pointer-events: none;
}
.pgb-co-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}
.pgb-co-sec {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pgb-co-sec h2 {
    margin: 0;
    font-size: 18px;
}
.pgb-co-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #475569;
    font-size: 13px;
}
.pgb-co-field em {
    color: #94a3b8;
    font-style: normal;
}
.pgb-co-field input,
.pgb-co-field select,
.pgb-co-code input {
    box-sizing: border-box;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 15px;
}
.pgb-co-field input:focus,
.pgb-co-field select:focus,
.pgb-co-code input:focus {
    border-color: var(--pgb-accent, #1e293b);
    outline: 2px solid color-mix(in srgb, var(--pgb-accent, #1e293b) 20%, transparent);
}
.pgb-co-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 10px;
}
.pgb-co-fixed {
    margin: 0;
    font-size: 15px;
}
.pgb-co-choice,
.pgb-co-methods {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}
.pgb-co-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    font-size: 15px;
    cursor: pointer;
}
.pgb-co-option + .pgb-co-option {
    border-top: 1px solid #e2e8f0;
}
.pgb-co-option:has(input:checked) {
    background: #f8fafc;
}
.pgb-co-option input {
    margin: 0;
    accent-color: var(--pgb-accent, #1e293b);
}
.pgb-co-option span {
    flex: 1;
}
.pgb-co-option small {
    display: block;
    color: #64748b;
    font-size: 13px;
}
.pgb-co-payment {
    min-height: 120px;
}
.pgb-co-muted {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}
.pgb-co-methods .pgb-co-muted {
    padding: 12px;
}
.pgb-co-pay {
    padding: 15px;
    border: 0;
    border-radius: 10px;
    background: var(--pgb-accent, #1e293b);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.pgb-co-pay:disabled {
    opacity: 0.55;
    cursor: default;
}
/* The terms accepted on purpose, right above the pay button */
.pgb-co-accept {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}
.pgb-co-accept input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex: none;
    accent-color: var(--pgb-accent, #1e293b);
}
.pgb-co-accept a {
    color: inherit;
    text-decoration: underline;
}
.pgb-co-legal {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}
.pgb-co-legal a {
    color: inherit;
    text-decoration: underline;
}
.pgb-co-sum {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border-radius: 12px;
    background: #f8fafc;
}
.pgb-co-lines {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pgb-co-lines li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.pgb-co-lines img,
.pgb-co-thumb {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #e2e8f0;
    object-fit: cover;
}
.pgb-co-line-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
}
.pgb-co-line-name small {
    display: block;
    color: #64748b;
    font-weight: 400;
}
.pgb-co-code {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pgb-co-code input {
    flex: 1 1 10rem;
    width: auto;
    text-transform: uppercase;
}
.pgb-co-small {
    padding: 11px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}
.pgb-co-applied {
    margin: 0;
    font-size: 14px;
}
.pgb-co-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--pgb-accent, #1e293b);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.pgb-co-totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    font-size: 15px;
}
.pgb-co-totals div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.pgb-co-totals dt,
.pgb-co-totals dd {
    margin: 0;
}
.pgb-co-totals dd {
    font-variant-numeric: tabular-nums;
}
.pgb-co-grand {
    padding-top: 6px;
    font-size: 18px;
    font-weight: 700;
}
@media (max-width: 760px) {
    .pgb-co {
        grid-template-columns: minmax(0, 1fr);
    }
    .pgb-co-sum {
        order: -1;
    }
}

/* The order page */
.pgb-order-lines,
.pgb-orders {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}
.pgb-order-lines td,
.pgb-orders td {
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
}
.pgb-order-lines td:last-child,
.pgb-orders td:last-child {
    text-align: right;
}
.pgb-order-total td {
    border-bottom: 0;
    font-weight: 700;
}
.pgb-order-sub {
    margin: 24px 0 8px;
    font-size: 17px;
}
.pgb-order-downloads {
    margin: 0 0 16px;
    padding-left: 20px;
    font-weight: 600;
}

/* Sending something back, on the order page */
.pgb-return {
    margin: 8px 0 24px;
}
.pgb-return-said {
    padding: 10px 12px;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
}
.pgb-return-said--error {
    background: #fef2f2;
    color: #991b1b;
}
.pgb-return-note {
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
}
.pgb-form .pgb-return-line {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 500;
}
.pgb-form select,
.pgb-form textarea {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 16px;
}
.pgb-return-track {
    align-items: flex-start;
}

/* The account pages: a form, a list */
.pgb-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 20px 0 8px;
}
.pgb-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
}
.pgb-form input {
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
    font-size: 16px;
}
.pgb-button {
    padding: 13px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--pgb-accent, #1e293b);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.pgb-card a.pgb-button {
    display: inline-block;
    margin-top: 8px;
    color: #fff;
}
.pgb-button--quiet {
    padding: 8px 0;
    background: none;
    color: #64748b;
    font-weight: 500;
    text-decoration: underline;
}
.pgb-message {
    padding: 12px 14px;
    border-radius: 8px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 14px;
}

.pgb-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 12px;
    font-size: 14px;
}
.pgb-account-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

/* The search (site/shop-search.js): a box at the top of the page */
.pgb-search-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9991;
    background: rgba(15, 23, 42, 0.45);
}
.pgb-search {
    position: fixed;
    top: 8vh;
    left: 50%;
    z-index: 9992;
    display: flex;
    flex-direction: column;
    width: min(560px, calc(100vw - 32px));
    max-height: 80vh;
    transform: translateX(-50%);
    background: #fff;
    color: #1e293b;
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
    font:
        15px / 1.5 system-ui,
        sans-serif;
    overflow: hidden;
}
.pgb-search[hidden],
.pgb-search-backdrop[hidden] {
    display: none;
}
.pgb-search-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 12px 18px;
    border-bottom: 1px solid #e2e8f0;
}
.pgb-search-input {
    flex: 1;
    min-width: 0;
    padding: 8px 0;
    border: 0;
    outline: none;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 17px;
}
.pgb-search-close {
    border: 0;
    background: none;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.pgb-search-results {
    margin: 0;
    padding: 6px;
    list-style: none;
    overflow-y: auto;
}
.pgb-search-note {
    padding: 14px 12px;
    color: #64748b;
}
.pgb-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
}
.pgb-search-item:hover,
.pgb-search-item:focus-visible {
    background: #f1f5f9;
}
.pgb-search-item img,
.pgb-search-noimg {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
}
.pgb-search-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.pgb-search-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pgb-search-cat {
    color: #64748b;
    font-size: 13px;
}
.pgb-search-price {
    flex: none;
    font-weight: 600;
}
.pgb-search-input::-webkit-search-cancel-button {
    display: none;
}
