/* =====================================================
   THE PASTRY JUNKIE — COMPACT SHOP ORDERING
===================================================== */

body.shop-page {
    --shop-brown: #421a12;
    --shop-pink: #fdade8;
    --shop-cream: #fff6f0;
}

body.shop-page [data-shop-category] {
    --shop-control-scale: 1;
}

/* Product names remain more prominent than descriptions. */
body.shop-page [data-shop-category] h3 {
    min-height: var(--shop-title-height, 0);

    margin:
        var(--shop-title-top, 12px)
        var(--shop-title-side, 0)
        5px;

    padding-bottom: 0;

    font-size:
        calc(18px * var(--shop-control-scale)) !important;

    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

body.shop-page [data-shop-category] h3::after {
    display: none;
}

body.shop-page .shop-card-copy {
    max-width: 32ch;
    margin: 4px auto 8px;

    color: #674339;

    font-size:
        calc(13px * var(--shop-control-scale));

    font-weight: 400;
    line-height: 1.45;
    min-height: var(--shop-copy-height, 0);
}

body.shop-page .shop-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;

    gap:
        calc(8px * var(--shop-control-scale));

    margin-top:
        calc(6px * var(--shop-control-scale));
}

body.shop-page .shop-card-price {
    display: inline-block;
    margin: 0;

    font-size:
        calc(16px * var(--shop-control-scale));

    font-weight: 800;
    line-height: 1.25;
}


/* =====================================================
   BUTTONS
===================================================== */

.shop-button {
    appearance: none;
    border: 1px solid #421a12;
    border-radius: 4px;
    background: #421a12;
    color: #fdade8;
    font: inherit;
    font-weight: 800;
    line-height: 1.25;
    padding: 10px 16px;
    min-height: 44px;
    cursor: pointer;
    text-align: center;
}

body.shop-page .shop-select {
    appearance: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: calc(44px * var(--shop-control-scale));
    height: calc(44px * var(--shop-control-scale));

    min-width: calc(44px * var(--shop-control-scale));
    min-height: calc(44px * var(--shop-control-scale));

    padding: calc(7px * var(--shop-control-scale));

    border: 0;
    border-radius: 0;

    background: transparent;
    box-shadow: none;
    color: #c62f79;

    cursor: pointer;
    line-height: 1;
}

.shop-bag-icon {
    display: block;
    width: 28px;
    height: 32px;
    flex: 0 0 auto;
}

body.shop-page .shop-select .shop-bag-icon {
    width: calc(28px * var(--shop-control-scale));
    height: calc(32px * var(--shop-control-scale));
}

body.shop-page .shop-select:hover:enabled {
    background: transparent;
    box-shadow: none;
    color: #9f1d5c;
}

.shop-button.secondary {
    background: transparent;
    color: #421a12;
}

.shop-button:disabled,
.shop-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-button:hover:enabled {
    background: #63362a;
    color: #fff0fa;
}

.shop-button:focus-visible,
.shop-select:focus-visible,
.shop-dialog :is(input, select, textarea):focus-visible,
[data-shop-entry]:focus-visible {
    outline: 3px solid #d72485;
    outline-offset: 3px;
}

[data-shop-entry] {
    cursor: pointer;
}

.shop-is-unavailable .shop-card-copy,
.shop-is-unavailable .shop-card-price {
    opacity: 0.55;
}


/* =====================================================
   SIGNATURE CARD SUPPORT
===================================================== */

.shop-badge {
    display: inline-block;

    padding: 4px 8px;
    border: 1px solid #b65182;
    border-radius: 3px;

    font-size:
        calc(12px * var(--shop-control-scale, 1));

    font-weight: 800;
}

.shop-art-pending > span {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 180px;
    width: 80%;
    padding: 16px;

    background: #f8e4e9;
    border: 1px dashed #a87262;

    font-size: 24px;
    font-weight: 800;
}

/* Signature Cake grid placement */
@media (min-width: 1101px) {
    body.shop-page
    #signatureCakes .signature-cake-grid {
        grid-template-columns:
            repeat(
                var(--shop-signature-columns, 6),
                minmax(0, 1fr)
            );

        row-gap: var(--shop-signature-row-gap, 90px);
    }

    body.shop-page
    #signatureCakes .signature-cake-grid
    > .signature-cake-product {
        grid-column:
            var(--shop-signature-card-column, span 2);
    }

    body.shop-page
    #signatureCakes .signature-cake-grid
    > [data-shop-category="cakes"][data-shop-flavor="banana"] {
        grid-column:
            var(--shop-signature-banana-column, 2 / span 2);
    }

    body.shop-page
    #signatureCakes .signature-cake-grid
    > [data-shop-category="half"] {
        grid-column:
            var(--shop-signature-half-column, 4 / span 2);
    }
}
/* =====================================================
   SHOP DIALOGS — ONE RESPONSIVE LAYOUT
===================================================== */

.shop-dialog {
    --shop-dialog-width: 680px;
    --shop-dialog-top: clamp(12px, 4vh, 32px);

    box-sizing: border-box;
    position: fixed;
    inset: var(--shop-dialog-top) 0 auto;

    width: min(
        var(--shop-dialog-width),
        calc(100vw - 24px)
    );

    height: auto;
    min-height: 0;
    max-width: calc(100vw - 24px);

    max-height: calc(
        100dvh - var(--shop-dialog-top) - 12px
    );

    margin: 0 auto;
    padding: 0;

    border: 1px solid #dc8fb5;
    border-radius: 12px;

    background: #fff6f0;
    color: #421a12;

    box-shadow: 0 18px 65px #421a1240;
    font-family: inherit;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;
}

.shop-dialog::backdrop {
    background: #32180f99;
}

body:has(.shop-dialog[open]) {
    overflow: hidden;
}

.shop-dialog * {
    box-sizing: border-box;
}

.shop-dialog [hidden] {
    display: none !important;
}

.shop-dialog-header {
    position: sticky;
    top: 0;
    z-index: 5;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
    padding: 10px 16px;

    border-bottom: 1px solid #e5c8cd;
    background: #fff6f0;
}

.shop-dialog-header h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.shop-close {
    flex: 0 0 44px;

    width: 44px;
    height: 44px;
    padding: 0;

    border: 0;

    background: transparent;
    color: #421a12;

    font: inherit;
    font-size: 28px;

    cursor: pointer;
}

.shop-close:focus-visible {
    outline: 3px solid #bb1c59;
    outline-offset: -3px;
}

.shop-dialog-content {
    padding: 16px;
}

/* Product popup */

.shop-product-dialog {
    background:
        linear-gradient(145deg, #fff9f4, #fff0ed);
}

.shop-product-dialog:has(
    #shopFlavorCounts:not([hidden])
),
.shop-product-dialog:has(
    #shopChocolateMix:checked
) {
    --shop-dialog-width: 1040px;
}

.shop-product-dialog .shop-dialog-header {
    height: 0;
    min-height: 0;
    padding: 0;

    border: 0;
    background: transparent;

    pointer-events: none;
}

.shop-product-dialog .shop-dialog-header h2 {
    position: absolute;

    width: 1px;
    height: 1px;
    margin: -1px;

    overflow: hidden;
    clip-path: inset(50%);
}

.shop-product-dialog .shop-close {
    position: absolute;

    top: 4px;
    right: 4px;

    border-radius: 50%;
    background: #fff8f3ed;

    pointer-events: auto;
}

.shop-product-dialog .shop-dialog-content {
    padding: 62px 16px 76px;
}

/* White artwork, attached to the same edges */

.shop-drizzle-top {
    position: absolute;

    top: 0;
    left: 0;
    right: 0;

    display: flex;
    align-items: flex-start;

    line-height: 0;
    overflow: hidden;

    pointer-events: none;
}

.shop-icing {
    display: block;

    min-width: 0;
    height: auto;

    overflow: hidden;
}

.shop-drizzle-top .shop-icing {
    flex: 0 0 280px;
    width: 280px;
}

/* Stable image column and adjacent content panel */

.shop-product-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
}

/* Desktop-only popup widths. */
@media (min-width: 1200px)
and (hover: hover)
and (pointer: fine) {
    .shop-dialog.tpj-tray-dialog {
        --shop-dialog-width: 840px;
    }

    .shop-dialog.tpj-tray-dialog[data-tray-kind="treats"] {
        --shop-dialog-width: 760px;
    }

    .shop-dialog.tpj-tray-dialog[data-tray-kind="cake"] {
        --shop-dialog-width: 640px;
    }
}

/* Shared visual dessert trays. */
.shop-dialog.tpj-tray-dialog {
    background: #fff8f3;
}

    .shop-dialog.tpj-tray-dialog .shop-dialog-content {
        padding: 76px 22px 18px;
    }

    .tpj-tray-dialog .shop-drizzle-top {
        gap: 0;
    }

    .tpj-tray-dialog
    .shop-drizzle-top .shop-icing + .shop-icing {
        margin-left: -12px;
    }

.tpj-tray-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

    .tpj-tray-heading p {
        margin: 0 0 5px;
        font-size: 10px;
        letter-spacing: 0.15em;
        font-weight: 800;
    }

    .tpj-tray-heading h2 {
        margin: 0;
        color: #a91450;
        font-size: 27px;
        line-height: 1.15;
    }

    .tpj-tray-sizes {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .tpj-tray-builder button {
        font-family: inherit;
        color: #421a12;
        cursor: pointer;
    }

    .tpj-tray-builder button:disabled {
        cursor: not-allowed;
        opacity: 0.5;
    }

    .tpj-tray-builder button:focus-visible {
        outline: 3px solid #bb1c59;
        outline-offset: 3px;
    }

    .tpj-tray-sizes button,
    .tpj-piece-editor > button {
        min-height: 38px;
        padding: 7px 14px;

        border: 1px solid #dfb8bd;
        border-radius: 7px;
        background: #fce4ed;

        font-size: 13px;
        font-weight: 750;
    }

    .tpj-tray-sizes button[aria-pressed="true"] {
        background: #421a12;
        color: #fdade8;
        border-color: #421a12;
    }

    .tpj-tray-message {
        margin: 10px 0;
        color: #a91450;
        font-size: 12px;
    }

    .tpj-tray-message:empty {
        display: none;
    }

    .tpj-tray-count {
        margin: 12px 0 8px;
        font-size: 13px;
        font-weight: 800;
    }

    .tpj-tray-slots {
        display: grid;

        grid-template-columns:
            repeat(var(--tray-columns), minmax(0, 1fr));

        gap: 9px;
        padding: 12px;

        width: 100%;
        max-width: calc(var(--tray-columns) * 200px);
        margin-inline: auto;

        border-radius: 10px;
        background: #fce4ed;
    }

    .tpj-tray-slot {
        position: relative;
        min-width: 0;

        border: 1px dashed #d794ae;
        border-radius: 8px;
        background: #fff8f3b3;
    }

    .tpj-tray-slot.is-active {
        outline: 2px solid #bb1c59;
        outline-offset: 1px;
    }

    .tpj-slot-open {
        display: flex;
        flex-direction: column;
        align-items: center;

        width: 100%;
        min-height: 145px;
        padding: 8px;

        border: 0;
        border-radius: inherit;
        background: transparent;
    }

    .tpj-slot-open img {
        width: 100%;
        height: 108px;
        object-fit: contain;
        object-position: center bottom;
    }

    .tpj-slot-open > span:last-child {
        margin-top: 5px;
        font-size: 11px;
        line-height: 1.3;
        font-weight: 750;
    }

    .tpj-slot-number {
        position: absolute;
        top: 5px;
        left: 7px;
        font-size: 10px;
        opacity: 0.7;
    }

    .tpj-slot-plus {
        display: grid;
        place-items: center;

        flex: 1;
        min-height: 108px;

        color: #b71d5b;
        font-size: 34px;
    }

    .tpj-tray-builder .tpj-slot-remove {
        position: absolute;
        top: 3px;
        right: 3px;

        width: 28px;
        height: 28px;
        padding: 0;

        border: 0;
        border-radius: 50%;
        background: #421a12;
        color: #fff8f3;

        font-size: 21px;
    }

    .tpj-tray-palette h3 {
        margin: 14px 0 3px;
        font-size: 17px;
    }

    .tpj-tray-palette p,
    .tpj-tray-hint,
    .tpj-piece-editor p {
        margin: 5px 0 10px;
        font-size: 12px;
        line-height: 1.45;
    }

.tpj-tray-picks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    flex: 0 0 calc(
    (100% - (var(--pick-columns, 5) - 1) * 8px)
    / var(--pick-columns, 5)
);

min-width: 0;
}

/* Explicit columns prevent uneven wrapping. */
.tpj-tray-picks {
    display: grid;

    grid-template-columns:
        repeat(var(--pick-columns, 5), minmax(0, 1fr));

    column-gap: 8px;
    row-gap: 14px;
}

.tpj-tray-pick {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 100%;
    min-width: 0;
    padding: 6px 3px;

    border: 0;
    border-radius: 6px;
    background: transparent;
}

/* Jars: five in each row, plus one beside both rows. */
.tpj-tray-picks.tpj-jar-picks {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.tpj-jar-picks > .tpj-tray-pick:nth-child(-n+5) {
    grid-row: 1;
}

.tpj-jar-picks > .tpj-tray-pick:nth-child(n+6):nth-child(-n+10) {
    grid-row: 2;
}

.tpj-jar-picks > .tpj-tray-pick:nth-child(11) {
    grid-column: 6;
    grid-row: 1 / span 2;
    align-self: center;
}

/* Apples: four above, three centered below. */
.tpj-tray-picks.tpj-apple-picks {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

.tpj-apple-picks > .tpj-tray-pick {
    grid-column: span 2;
}

.tpj-apple-picks > .tpj-tray-pick:nth-child(5) {
    grid-column: 2 / span 2;
}

.tpj-apple-picks > .tpj-tray-pick:nth-child(6) {
    grid-column: 4 / span 2;
}

.tpj-apple-picks > .tpj-tray-pick:nth-child(7) {
    grid-column: 6 / span 2;
}

    .tpj-tray-pick:hover:not(:disabled) {
        background: #fce4ed;
    }

    .tpj-tray-pick img {
        width: 100%;
        height: 70px;
        object-fit: contain;
    }

    .tpj-tray-pick span {
        margin-top: 4px;
        font-size: 11px;
        line-height: 1.3;
        font-weight: 700;
    }

    .tpj-art-fallback {
        display: grid;
        place-items: center;
        min-height: 70px;
    }

.tpj-treat-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1.5fr) minmax(220px, 1fr);

    align-items: start;
    gap: 14px;
}

/* Use the full width until a spot is opened for editing. */
.tpj-treat-layout:not(:has(.tpj-piece-editor)) {
    display: block;
}

    .tpj-treat-slots .tpj-slot-open {
        min-height: 102px;
    }

    .tpj-treat-slots .tpj-slot-open img,
    .tpj-treat-slots .tpj-slot-plus {
        height: 60px;
        min-height: 60px;
    }

.tpj-treat-layout .tpj-tray-picks {
    --pick-columns: 4;
}

    .tpj-piece-editor {
        padding: 14px;
        border-left: 1px solid #e5c9c3;
    }

    .tpj-piece-editor h3 {
        margin: 0 0 8px;
        font-size: 21px;
    }

    .tpj-tray-field {
        display: block;
        margin-bottom: 12px;
        font-size: 13px;
        font-weight: 750;
    }

    .tpj-tray-field select {
        margin-top: 5px;
        font-weight: 400;
    }

    .tpj-piece-editor > button {
        margin: 4px 5px 4px 0;
    }

    .tpj-tray-builder .tpj-tray-save {
        background: #bb1c59;
        color: white;
        border-color: #bb1c59;
    }

.tpj-cake-choices {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    margin-top: 16px;
}

    .tpj-cake-choices figure {
        margin: 0;
        text-align: center;
    }

.tpj-cake-choices img {
    width: 100%;
    height: 190px;
    object-fit: contain;
}

    .tpj-cake-choices figcaption {
        margin-top: 8px;
        font-size: 11px;
        line-height: 1.4;
    }

    .tpj-tray-about {
        margin-top: 12px;
    }

    .tpj-tray-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;

        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;

        padding: 12px 0 0;
        border-top: 1px solid #e5c9c3;
        background: #fff8f3;
    }

    .tpj-tray-errors {
        flex: 1;
        min-width: 0;
    }

    .tpj-tray-errors .shop-error {
        margin: 0;
        font-size: 12px;
    }

    .tpj-tray-add {
        flex: 0 0 auto;
    }

    .tpj-tray-builder .tpj-tray-add-button {
        min-width: 230px;
        background: #421a12;
        color: #fdade8;
    }
    .tpj-cake-choices .tpj-tray-sizes {
    margin-bottom: 14px;
}

.tpj-tray-dialog .tpj-tray-field select {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 14px;
}

.shop-product-visual {
    min-width: 0;
    align-self: start;
}

.shop-product-visual img {
    display: block;

    width: 100%;
    height: auto;
    max-height: 210px;

    object-fit: contain;
    object-position: center top;
}

.shop-product-panel {
    min-width: 0;
}

.shop-product-layout:has(.shop-no-image) {
    grid-template-columns: minmax(0, 1fr);
}

.shop-no-image {
    display: none;
}

.shop-dialog .shop-product-name {
    margin: 0 0 8px;

    color: #bb1c59;

    font-size: 23px;
    font-style: italic;
    font-weight: 850;
    line-height: 1.12;

    overflow-wrap: break-word;
}

.shop-product-intro p,
.shop-split-explanation p {
    margin: 0 0 10px;

    font-size: 13px;
    line-height: 1.45;
}

.shop-product-dialog
#shopProductOptions > .shop-field {
    max-width: 360px;
}

.shop-product-dialog .shop-field {
    margin: 10px 0;
}

.shop-product-dialog .shop-live {
    margin: 6px 0;
    padding: 0;

    font-size: 12px;
}

/* Shared controls */

.shop-dialog h3 {
    margin: 14px 0 8px;
    font-size: 18px;
    line-height: 1.3;
}

.shop-dialog p {
    line-height: 1.5;
}

.shop-dialog fieldset {
    min-width: 0;
    margin: 10px 0;
    padding: 0;
    border: 0;
}

.shop-dialog legend {
    margin-bottom: 6px;
    font-weight: 800;
}

.shop-dialog label {
    font-size: 14px;
    font-weight: 650;
}

.shop-dialog
input:not([type="radio"]):not([type="checkbox"]),
.shop-dialog select,
.shop-dialog textarea {
    display: block;

    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;

    padding: 9px;

    border: 1px solid #ad8072;
    border-radius: 5px;

    background: #fffaf7;
    color: #421a12;

    font: inherit;
    font-size: 16px;
}

.shop-dialog textarea {
    min-height: 80px;
    resize: vertical;
}

.shop-field {
    display: block;
    margin: 12px 0;
}

.shop-field small {
    display: block;
    margin-top: 5px;

    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
}

.shop-choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shop-choice {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    min-height: 44px;
    padding: 9px 11px;

    border: 1px solid #ad8072;
    border-radius: 5px;

    background: #fffaf7;
    cursor: pointer;
}

.shop-choice:has(input:checked) {
    background: #ffe7ef;
    border-color: #bb1c59;

    box-shadow: inset 0 0 0 1px #bb1c59;
}

.shop-choice input,
.shop-mix-toggle input {
    accent-color: #bb1c59;
}

.shop-two-col {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;
}

/* Keep one flavor or mix */

.shop-product-dialog .shop-mix-picker {
    padding: 8px;

    border: 1px solid #e0b7b0;
    border-radius: 7px;
}

.shop-mix-picker legend {
    padding: 0 4px;

    font-family:
        "Brush Script MT",
        "Segoe Script",
        cursive;

    font-size: 22px;
    line-height: 1.1;
}

.shop-mix-choices {
    display: var(--shop-mix-choice-display, grid);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex-wrap: wrap;
    gap: 8px;
}

.shop-mix-choice {
    appearance: none;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    min-width: 0;
    min-height: 52px;
    padding: 6px;

    border: 1px solid #e6c7c2;
    border-radius: 6px;

    background: #fffaf8;
    color: #421a12;

    font: inherit;
    font-size: 12px;
    text-align: left;

    cursor: pointer;
}

.shop-mix-choice strong {
    display: block;
}

.shop-mix-choice[aria-pressed="true"] {
    border-color: #bb1c59;
    background: #ffe7ef;

    box-shadow: inset 0 0 0 1px #bb1c59;
}

.shop-mix-choice:focus-visible {
    outline: 3px solid #bb1c59;
    outline-offset: 2px;
}

.shop-mix-choice img {
    flex: 0 0 auto;

    width: 28px;
    height: 34px;

    object-fit: contain;
}

.shop-mix-thumbnails {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.shop-mix-thumbnails img {
    width: 22px;
    height: 30px;
}

.shop-mix-thumbnails img + img {
    margin-left: -8px;
}

#shopFlavorCounts {
    display: var(--shop-mix-display, grid);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

#shopFlavorCounts > p {
    grid-column: 1 / -1;

    margin: 0;
    font-size: 12px;
}

.shop-flavor-row {
    display: var(--shop-flavor-display, grid);

    grid-template-columns:
        minmax(0, 1fr)
        var(--shop-flavor-input-width, 52px);

    align-items: center;
    gap: 6px;

    min-width: 0;
    min-height: var(--shop-flavor-height, 56px);
    padding: 6px;

    border: 1px solid #e6c7c2;
    border-radius: 5px;
    background: #fffaf7;
}

.shop-flavor-row span {
    min-width: 0;

    font-size: 12px;
    line-height: 1.3;

    overflow-wrap: break-word;
}

.shop-flavor-row input {
    text-align: center;
}

.shop-mix-toggle {
    display: flex;
    align-items: center;

    gap: 8px;

    min-height: 44px;
    margin: 8px 0;
}

.shop-mix-toggle input {
    flex: 0 0 20px;

    width: 20px;
    height: 20px;
}

/* Chocolate boxes wrap across the panel */

#shopChocolatePieces:has(.shop-piece) {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(210px, 1fr));

    gap: 10px;
}

#shopChocolatePieces > .shop-mix-toggle,
#shopChocolatePieces > p {
    grid-column: 1 / -1;
}

.shop-piece {
    min-width: 0;
    margin: 0;
    padding: 10px;

    border: 1px solid #dcbac2;
    border-radius: 5px;

    background: #fffaf8;
}

.shop-dialog fieldset.shop-piece {
    margin: 0;
    padding: 10px;

    border: 1px solid #dcbac2;
}

.shop-piece label {
    display: block;
}

.shop-piece .shop-two-col {
    grid-template-columns: minmax(0, 1fr);

    gap: 8px;
    margin: 8px 0;
}

.shop-piece-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
}

.shop-piece-actions .shop-button {
    padding: 8px;
    font-size: 12px;
}

/* About this dessert */

.shop-product-information {
    margin-top: 8px;
}

.shop-about {
    padding: 0;
    border-bottom: 1px solid #ead6d8;
}

.shop-about summary {
    display: list-item;

    min-height: 44px;
    padding: 12px 0;

    font-size: 13px;
    font-weight: 750;

    cursor: pointer;
}

.shop-about p,
.shop-about ul {
    margin: 8px 0;

    font-size: 13px;
    line-height: 1.5;
}

.shop-about ul {
    padding-left: 20px;
}

.shop-care-item h4 {
    margin: 10px 0 5px;
    font-size: 13px;
}

.shop-allergy-notice {
    padding-top: 10px;
    border-top: 1px solid #ead6d8;
}

/* Add to Cart */

.shop-product-dialog .shop-product-footer {
    display: block;

    margin-top: 12px;
    padding: 0;

    border: 0;
}

.shop-product-footer .shop-error {
    margin-bottom: 8px;
    font-size: 12px;
}

.shop-product-dialog .shop-add-dessert {
    position: relative;
    display: block;

    width: 100%;
    min-height: 44px;
    padding: 11px 14px;

    border: 0;
    border-radius: 8px 8px 0 0;

color: #fdade8;

    box-shadow: none;

    color: #bb1c59;
    font-size: 13px;

    overflow: visible;
}

.shop-product-dialog .shop-add-dessert:hover:enabled {
    background: #421502;
    color: #fdade8;
}

.shop-button-drizzle {
    position: absolute;

    display: flex;
    align-items: flex-start;

    top: calc(100% - 1px);
    left: 0;
    right: 0;

    line-height: 0;
    pointer-events: none;
}

.shop-button-drizzle .shop-icing {
    flex: 0 0 16.666666%;
    width: 16.666666%;
}

.shop-add-content {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;
    padding-inline: 18px;

    text-align: center;
}

.shop-add-content > span:last-child {
    position: absolute;

    top: 50%;
    right: 0;

    margin: 0;
    transform: translateY(-50%);
}

.shop-product-dialog .shop-add-content strong {
    font-size: inherit;
    font-weight: 850;
}

/* Cart, checkout and review */

.shop-live {
    padding: 6px 0;
    font-weight: 800;
}

.shop-error {
    color: #8e1837;
    font-weight: 700;
    line-height: 1.5;
}

.shop-error:empty {
    display: none;
}

.shop-dialog-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-top: 14px;
    padding-top: 12px;

    border-top: 1px solid #e0bdc8;
}

.shop-dialog-footer strong {
    font-size: 21px;
}

.shop-cart-row {
    padding: 12px 0;
    border-bottom: 1px solid #e1c6ce;
}

.shop-cart-row h3 {
    margin: 0 0 8px;
}

.shop-cart-row ul,
.shop-review ul {
    margin: 8px 0;
    padding-left: 22px;

    line-height: 1.5;
}

.shop-cart-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
    margin-top: 10px;
}

.shop-notice {
    margin: 12px 0;
    padding: 12px;

    background: #f8e5ec;
    border-left: 3px solid #c04b85;

    line-height: 1.5;
}

.shop-policies details {
    padding: 10px 0;
    border-top: 1px solid #e4cdd0;
}

.shop-policies summary {
    min-height: 32px;
    font-weight: 800;

    cursor: pointer;
}

.shop-review {
    overflow-wrap: anywhere;
}

.shop-status {
    padding: 10px;
    line-height: 1.5;
}

.shop-honeypot {
    position: absolute;

    width: 1px;
    height: 1px;

    overflow: hidden;
    clip-path: inset(50%);
}

/* Preserve existing menu zoom compensation */

@media (min-width: 1200px) {
    body.shop-page [data-shop-category] {
        --shop-control-scale: 2;
    }
}

@media screen
and (orientation: landscape)
and (max-height: 600px)
and (hover: none)
and (pointer: coarse) {
    body.shop-page [data-shop-category] {
        --shop-control-scale: 2;
    }
}

/* Phone */

@media (max-width: 700px) {
    .shop-dialog {
        --shop-dialog-top: 8px;

        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
    }

    .shop-product-dialog .shop-dialog-content {
        padding:
            46px
            12px
            max(50px, env(safe-area-inset-bottom));
    }

    .shop-product-layout {
        grid-template-columns:
            90px minmax(0, 1fr);

        gap: 10px;
    }

    .shop-product-visual img {
        max-height: 150px;
    }

    .shop-dialog .shop-product-name {
        font-size: 20px;
    }

    .shop-product-intro p {
        font-size: 12px;
    }

    .shop-drizzle-top .shop-icing {
        flex-basis: 50%;
        width: 50%;
    }

    .shop-drizzle-top .shop-icing:nth-child(n+3) {
        display: none;
    }

    .shop-button-drizzle .shop-icing {
        flex-basis: 33.333333%;
        width: 33.333333%;
    }

    .shop-button-drizzle .shop-icing:nth-child(n+4) {
        display: none;
    }

    #shopFlavorCounts {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .shop-flavor-row {
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
    }

    .shop-flavor-row span {
        font-size: 12px;
    }

    .shop-mix-choices {
        gap: 5px;
    }

    .shop-mix-choice {
        flex-wrap: wrap;

        font-size: 11px;
        text-align: center;
    }

    .shop-two-col {
        grid-template-columns: minmax(0, 1fr);
    }

    #shopChocolatePieces:has(.shop-piece) {
        grid-template-columns: minmax(0, 1fr);
    }

    .shop-dialog-header h2 {
        font-size: 20px;
    }
}

/* One chocolate scrollbar color */

html:has(body.shop-page),
body.shop-page,
body.shop-page * {
    scrollbar-color: #421a12 #fff6f0;
}

html:has(body.shop-page)::-webkit-scrollbar,
body.shop-page::-webkit-scrollbar,
body.shop-page *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html:has(body.shop-page)::-webkit-scrollbar-track,
body.shop-page::-webkit-scrollbar-track,
body.shop-page *::-webkit-scrollbar-track {
    background: #fff6f0;
}

html:has(body.shop-page)::-webkit-scrollbar-thumb,
body.shop-page::-webkit-scrollbar-thumb,
body.shop-page *::-webkit-scrollbar-thumb {
    background: #421a12;
    border-radius: 6px;
}

html:has(body.shop-page)::-webkit-scrollbar-thumb:hover,
html:has(body.shop-page)::-webkit-scrollbar-thumb:active,
body.shop-page::-webkit-scrollbar-thumb:hover,
body.shop-page::-webkit-scrollbar-thumb:active,
body.shop-page *::-webkit-scrollbar-thumb:hover,
body.shop-page *::-webkit-scrollbar-thumb:active {
    background: #421a12;
}

html:has(body.shop-page)::-webkit-scrollbar-corner,
body.shop-page::-webkit-scrollbar-corner,
body.shop-page *::-webkit-scrollbar-corner {
    background: #fff6f0;
}
/* Compact screens: retain the existing dialog dimensions. */
@media (max-width: 1199px),
       (hover: none),
       (pointer: coarse),
       (pointer: none) {

    .shop-dialog.tpj-tray-dialog .shop-dialog-content {
        padding: 62px 16px max(50px, env(safe-area-inset-bottom));
    }

    .tpj-tray-heading h2 {
        font-size: 24px;
        overflow-wrap: anywhere;
    }

    .tpj-tray-sizes button,
    .tpj-piece-editor > button {
        min-height: 44px;
    }

    .tpj-tray-dialog .tpj-tray-field select {
        min-height: 44px;
        font-size: 16px;
        max-width: 100%;
    }

    .tpj-treat-layout {
        display: block;
    }

    .tpj-piece-editor {
        margin-top: 14px;
        padding: 14px 0 0;

        border-left: 0;
        border-top: 1px solid #e5c9c3;

        scroll-margin-block: 12px;
    }

    .tpj-piece-preview img {
        display: block;
        width: 100%;
        height: 90px;
        object-fit: contain;
    }

    .tpj-preview-note {
        display: block;
        font-size: 10px;
        text-align: center;
    }

    .tpj-tray-dialog .tpj-slot-open > span,
    .tpj-tray-pick span {
        overflow-wrap: anywhere;
    }

    .tpj-tray-builder .tpj-slot-remove {
        width: 32px;
        height: 32px;
        min-height: 32px;
    }

    .tpj-slot-remove::before {
        content: "";
        position: absolute;
        inset: -6px;
    }
}

/* Phones: preserve existing popup bounds and scrolling. */
@media (max-width: 700px) {

    .shop-dialog.tpj-tray-dialog .shop-dialog-content {
        padding: 46px 12px max(50px, env(safe-area-inset-bottom));
    }

    /* Overlapping pieces form one continuous attached drip. */
    .tpj-tray-dialog .shop-drizzle-top .shop-icing {
        flex: 0 0 calc(50% + 6px);
        width: calc(50% + 6px);
    }

    .tpj-tray-heading {
        gap: 9px;
    }

    .tpj-tray-heading h2 {
        font-size: 22px;
    }

    /* Two choices per row. */
    .tpj-tray-dialog .tpj-tray-picks {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;
    }

    /* Reset the desktop jar/apple row placements. */
    .shop-dialog.tpj-tray-dialog
    .tpj-tray-picks > .tpj-tray-pick {
        grid-column: auto;
        grid-row: auto;
        align-self: auto;
    }

    /* Center an odd final choice. */
    .shop-dialog.tpj-tray-dialog
    .tpj-tray-picks > .tpj-tray-pick:nth-child(odd):last-child {
        grid-column: 1 / -1;
        justify-self: center;

        width: calc((100% - 10px) / 2);
    }

    .tpj-tray-slots {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        max-width: 100%;
        gap: 8px;
        padding: 10px;
    }

    /* Six- and twelve-piece trays use three columns. */
    .tpj-tray-slots:has(> .tpj-tray-slot:nth-child(6)) {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .tpj-tray-slots:has(> .tpj-tray-slot:only-child) {
        grid-template-columns:
            minmax(0, 1fr);

        max-width: 180px;
    }

    .tpj-slot-open {
        min-height: 116px;
        padding: 8px 5px;
    }

    .tpj-slot-open img,
    .tpj-slot-plus {
        height: 78px;
        min-height: 78px;
    }

    .tpj-cake-choices {
        grid-template-columns:
            minmax(0, 1fr);

        gap: 12px;
    }

    .tpj-cake-choices img {
        height: 160px;
    }

    .tpj-cake-choices figcaption {
        margin-top: 4px;
    }

    .tpj-tray-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .tpj-tray-add {
        width: 100%;
    }

    .tpj-tray-builder .tpj-tray-add-button {
        width: 100%;
        min-width: 0;
        min-height: 44px;

        padding: 10px;
        font-size: 14px;
        line-height: 1.35;
        white-space: normal;
    }
}
/* Plain popup top; preserve the existing mobile height and width limits. */
.shop-dialog .shop-drizzle-top,.tpj-tray-dialog .shop-drizzle-top,.shop-dialog .shop-button-drizzle{display:none!important}

.shop-dialog.shop-product-dialog .shop-dialog-content{padding-top:24px}

/* A single visible row uses the existing dessert cutouts and selection controls. */
.tpj-box-scroll{max-width:100%;overflow-x:auto;padding:8px 3px 4px;scrollbar-width:thin}
.shop-dialog.tpj-tray-dialog .tpj-tray-slots.tpj-real-box{position:relative;isolation:isolate;display:grid;grid-template-columns:repeat(var(--tray-columns),minmax(0,1fr));gap:6px;width:100%;min-width:calc(var(--tray-columns) * 145px + 42px);max-width:none;margin:0;padding:0 24px 8px;background:none;border-radius:0}
.tpj-real-box::before{content:"";position:absolute;z-index:-1;inset:65px 0 58px;background:url("images/Shop/Boxes/white-bakery-tray.png") center/100% 100% no-repeat;pointer-events:none}
.shop-dialog .tpj-real-box .tpj-tray-slot{position:relative;border:0;border-radius:0;background:transparent;min-width:0}
.shop-dialog .tpj-real-box .tpj-tray-slot::before{content:"";position:absolute;z-index:-1;top:137px;left:4%;right:4%;height:43px;border:2px solid #f9f5f0;border-radius:50%;background:linear-gradient(#d2c7bb,#f6eee5);box-shadow:inset 0 4px 7px #58433329}
.shop-dialog .tpj-treat-slots .tpj-tray-slot::before{content:none}
.shop-dialog .tpj-real-box .tpj-slot-open{display:flex;flex-direction:column;justify-content:flex-start;min-height:240px;padding:0 3px 7px;border-radius:8px}
.shop-dialog .tpj-real-box .tpj-slot-open img{display:block;position:relative;z-index:1;width:100%;height:182px;min-height:182px;object-fit:contain;object-position:center bottom}
.shop-dialog .tpj-real-box .tpj-slot-plus{flex:none;display:grid;place-items:center;width:100%;height:182px;min-height:182px;padding-top:98px;background:none;color:#63372b;font-size:30px}
.shop-dialog .tpj-real-box .tpj-slot-open>span:last-child{margin-top:22px;line-height:1.35;font-size:12px;white-space:normal;color:#421c15}
.shop-dialog .tpj-real-box .tpj-slot-number{top:5px;left:6px;background:#fff9f2d9;border-radius:50%;padding:1px 5px;z-index:2}
.shop-dialog .tpj-real-box .tpj-slot-remove{top:3px;right:2px;z-index:3}
.shop-dialog .tpj-real-box .tpj-tray-slot.is-active{outline:2px solid #b51558;outline-offset:0;border-radius:8px}
.tpj-closed-box{position:relative;width:min(420px,85%);height:115px;margin:45px auto 35px;background:linear-gradient(175deg,#fffdfa,#eee7df);border:1px solid #d3c7bd;border-radius:4px 4px 8px 8px;box-shadow:0 12px 14px #5132251a;transform:perspective(800px) rotateX(18deg)}
.tpj-closed-box::before{content:"";position:absolute;inset:-20px -2px 18px;background:linear-gradient(165deg,#fffefa,#f1ebe4);border:1px solid #d4c9be;border-radius:5px;box-shadow:0 3px 3px #50352215}
.tpj-closed-box::after{content:"";position:absolute;bottom:16px;left:calc(50% - 13px);width:26px;height:10px;border:1px solid #d4c9be;border-top:0;border-radius:0 0 12px 12px;background:#f9f4ed}
/* Keep wide boxes scrollable without squeezing the existing editor or palette. */
.tpj-pack-layout>div,.tpj-treat-layout>div{min-width:0}

/* One editable review form, followed by the existing received message. */
.shop-dialog.shop-checkout-dialog{width:min(1120px,calc(100% - 24px));background:#fff9f5;color:#421c15;border:1px solid #dca3b6;border-radius:20px}
.shop-checkout-dialog .shop-dialog-header{display:flex;align-items:center;gap:18px;padding:20px 26px;border-bottom:2px solid #f0c3d1;background:#fff9f5}
.shop-checkout-dialog .shop-dialog-header h2{flex:1;margin:0;font-size:clamp(23px,3vw,32px);color:#9b174a}
.tpj-checkout-logo{width:86px;height:94px;object-fit:contain}
.shop-checkout-dialog .shop-dialog-content{padding:24px 26px}
.tpj-checkout-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(260px,.85fr);gap:28px;align-items:start}
.tpj-checkout-fields,.tpj-checkout-summary{min-width:0}
.tpj-checkout-grid h3{margin:0 0 16px;font-size:20px;color:#421c15}
.shop-checkout-dialog .shop-field{margin:0 0 16px;font-size:14px;font-weight:650}
.shop-checkout-dialog input:not([type=radio]):not([type=checkbox]),.shop-checkout-dialog select,.shop-checkout-dialog textarea{background:#fffefd;border:1px solid #d6acae;border-radius:8px;padding:11px;min-height:46px;color:#421c15;font-size:16px}
.shop-checkout-dialog fieldset{border:1px solid #e6c5cb;border-radius:10px;margin:6px 0 20px;padding:14px}
.shop-checkout-dialog legend{font-weight:700;padding:0 7px}
.shop-checkout-dialog small{font-weight:400}
.tpj-checkout-summary{padding:20px;background:#f9eee9;border:1px solid #e9c6d0;border-radius:13px}
.tpj-summary-item{border-bottom:1px solid #e7ccd0;padding:0 0 12px;margin-bottom:14px}
.tpj-summary-item h4{margin:8px 0;font-size:15px}.tpj-summary-item ul{padding-left:18px;font-size:13px;line-height:1.5}.tpj-summary-item p{font-size:14px}.tpj-summary-item strong{float:right}
.tpj-summary-art{display:flex;align-items:end;overflow-x:auto;gap:4px;padding:4px 0 9px}.tpj-summary-art img{width:76px;height:88px;object-fit:contain;flex:none}
.shop-checkout-dialog #shopFulfillmentTotal{white-space:pre-line;font-weight:700;font-size:16px;line-height:1.8}
.shop-checkout-dialog .shop-notice{font-size:13px;line-height:1.6}
.shop-checkout-dialog .shop-cart-actions{justify-content:space-between;padding-top:18px;border-top:1px solid #e6c5cb}
.tpj-checkout-footer{margin:18px 0 0;text-align:center;font-size:12px;color:#77564e}
.shop-checkout-dialog .shop-policies h4{font-size:14px;margin:12px 0 4px}.shop-checkout-dialog .shop-policies p{font-size:13px;line-height:1.6}
@media(max-width:740px){.tpj-checkout-grid{grid-template-columns:minmax(0,1fr);gap:22px}.shop-checkout-dialog .shop-dialog-header{padding:14px;gap:10px}.tpj-checkout-logo{width:58px;height:68px}.shop-checkout-dialog .shop-dialog-content{padding:16px}.shop-checkout-dialog .shop-cart-actions{flex-wrap:wrap}.shop-checkout-dialog .shop-two-col{grid-template-columns:1fr}}

.shop-dialog.tpj-tray-dialog .tpj-tray-slots.tpj-real-box:has(>.tpj-tray-slot:only-child){width:260px;max-width:100%;margin-inline:auto}
/* Smaller empty opening for a single-item box */
.shop-dialog .tpj-real-box:not(.tpj-treat-slots)
> .tpj-tray-slot:only-child:has(.tpj-slot-plus)::before {
    width: 110px;
    max-width: 65%;
    height: 30px;
    top: 125px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}
/* Remove the oval inserts; keep the existing plus signs. */
.shop-dialog .tpj-real-box .tpj-tray-slot::before {
    content: none !important;
}