/*
 * Dobrunka | Customer purchase presentation
 *
 * Project-owned styles only. RWS/Eshop owns the HTML structure, price display,
 * form submission, allocation views and cart behavior. No managed files changed.
 * Rules cover cart, checkout, review, success and browser-local order history.
 * Keep shared commercial data and interactions in the Eshop; style only here.
 */

/* Project-wide purchase accents: the same control border and button lift
 * appear in cart, checkout and final review; keep identical values together. */
.rws-purchase {
    --purchase-control-border: rgba(23, 127, 119, .2);
    --purchase-control-border-strong: rgba(23, 127, 119, .35);
    --purchase-primary-shadow: 0 .45rem 1rem rgba(23, 127, 119, .15);
}

/* CART 1. Layout and navigation ------------------------------------------ */
.rws-purchase .eshop-cart {
    --cart-ink: var(--color-ink, #17252d);
    --cart-copy: var(--color-copy, #35474e);
    --cart-muted: var(--color-muted, #5d6a70);
    --cart-accent: var(--color-brand-strong, #177f77);
    --cart-border: var(--surface-line-strong, rgba(23, 82, 76, .14));
    --cart-pale: var(--color-brand-pale, #f6fbfa);
    --cart-action-soft: var(--color-action-soft, #dcefeb);
    --cart-action-ink: #145b58;
    --cart-remove-ink: #a42f25;
    --cart-soft: var(--color-brand-soft, #eaf7f5);
    --cart-shadow: var(--shadow-soft, 0 .625rem 1.5rem rgba(31, 86, 79, .055));
    gap: clamp(.9rem, 2vw, 1.6rem);
}

.rws-purchase .eshop-cart__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 19.5rem);
    gap: clamp(1.25rem, 3vw, 2.75rem);
    align-items: start;
}

.rws-purchase .eshop-cart__items {
    display: grid;
    gap: .85rem;
    min-width: 0;
}

.rws-purchase .eshop-cart__layout > .eshop-cart-summary {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
}

/* Only the cart's view switch: clear tabs, not action buttons. */
.rws-purchase .eshop-cart .eshop-link-group--views {
    justify-content: start;
    gap: .4rem;
    margin: 0 0 .25rem;
}

.rws-purchase .eshop-cart .eshop-link-group--views a {
    display: inline-flex;
    min-height: 2.65rem;
    align-items: center;
    padding: .5rem .9rem;
    border: 1px solid var(--cart-border);
    border-radius: var(--radius-pill, 999rem);
    background: var(--color-white, #fff);
    color: var(--cart-copy);
    font-size: .87rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: background var(--transition-fast, 180ms ease), box-shadow var(--transition-fast, 180ms ease);
}

.rws-purchase .eshop-cart .eshop-link-group--views a[aria-current="page"] {
    background: var(--cart-soft);
    color: var(--cart-accent);
    box-shadow: inset 0 .1rem .3rem rgba(24, 109, 100, .07);
}

.rws-purchase .eshop-cart .eshop-link-group--views a:hover {
    background: var(--cart-soft);
}

/* CART 2. Product view: the native table remains in HTML, visually arranged into
 * compact product cards. All cells and semantic price labels remain present. */
.rws-purchase .eshop-cart__table-wrap,
.rws-purchase .eshop-cart-table {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
}

.rws-purchase .eshop-cart-table {
    border: 0;
    border-collapse: separate;
}

.rws-purchase .eshop-cart-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.rws-purchase .eshop-cart-table tbody {
    display: grid;
    gap: .85rem;
    min-width: 0;
}

.rws-purchase .eshop-cart-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(16rem, .9fr) minmax(7.5rem, .62fr);
    grid-template-areas:
        "product quantity subtotal"
        "code unit action";
    align-items: center;
    gap: .35rem 1rem;
    min-width: 0;
    padding: clamp(.9rem, 1.45vw, 1.25rem);
    border: 1px solid var(--cart-border);
    border-radius: var(--radius-card-small, 1.375rem .5rem 1.375rem .5rem);
    background: linear-gradient(125deg, var(--cart-soft), var(--cart-pale) 90%);
    box-shadow: var(--cart-shadow), inset 0 1px rgba(255, 255, 255, .78);
}

.rws-purchase .eshop-cart-table tbody td {
    display: block;
    width: auto !important;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    vertical-align: middle;
    overflow-wrap: break-word;
}

.rws-purchase .eshop-cart-table tbody td::before { display: none; }
.rws-purchase .eshop-cart-table tbody td:nth-child(1) { grid-area: product; align-self: end; }
.rws-purchase .eshop-cart-table tbody td:nth-child(2) { grid-area: code; align-self: start; }
.rws-purchase .eshop-cart-table tbody td:nth-child(3) { grid-area: quantity; }
.rws-purchase .eshop-cart-table tbody td:nth-child(4) { grid-area: unit; }
.rws-purchase .eshop-cart-table tbody td:nth-child(5) { grid-area: subtotal; }
.rws-purchase .eshop-cart-table tbody td:nth-child(6) { grid-area: action; }

.rws-purchase .eshop-cart-table td[data-label="Produkt"] {
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.13rem, 1.5vw, 1.32rem);
    font-weight: 700;
    line-height: 1.22;
}

.rws-purchase .eshop-cart-table td[data-label="Produkt"] a {
    color: var(--cart-ink);
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

.rws-purchase .eshop-cart-table td[data-label="Produkt"] a:hover { color: var(--cart-accent); }

.rws-purchase .eshop-cart-table td[data-label="Produkt"] p {
    margin: .4rem 0 0;
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: .83rem;
    font-weight: 500;
    line-height: 1.45;
}

.rws-purchase .eshop-cart-table td[data-label="Kód"] {
    color: var(--cart-muted);
    font-size: .79rem;
    line-height: 1.4;
}

.rws-purchase .eshop-cart-table td[data-label="Cena za jednotku"] {
    color: var(--cart-copy);
    font-size: .81rem;
    line-height: 1.45;
}

.rws-purchase .eshop-cart-table td[data-label="Cena za jednotku"] strong { font-weight: 600; }
.rws-purchase .eshop-cart-table td[data-label="Cena za jednotku"] small { color: var(--cart-muted); font-size: .89em; }

/* The Eshop renders the amount and VAT label together in one <strong>.
 * Keep the complete price comfortably legible without over-emphasising "s DPH". */
.rws-purchase .eshop-cart-table td[data-label="Mezisoučet"] {
    align-self: start;
    color: var(--cart-accent);
    font-variant-numeric: tabular-nums;
    font-size: .98rem;
    line-height: 1.4;
    text-align: right;
}

.rws-purchase .eshop-cart-table td[data-label="Mezisoučet"] strong {
    display: inline-block;
    font-size: 1em;
    font-weight: 700;
}

.rws-purchase .eshop-cart-table td[data-label="Mezisoučet"] small {
    color: var(--cart-muted);
    font-size: .72rem;
    font-weight: 400;
}

/* Quantity's explicit Update action is preserved; nothing auto-submits. */
.rws-purchase .eshop-cart .eshop-quantity-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 0;
}

.rws-purchase .eshop-cart .eshop-quantity-control button[data-quantity-decrement],
.rws-purchase .eshop-cart .eshop-quantity-control button[data-quantity-increment] {
    display: inline-grid;
    place-items: center;
    flex: 0 0 2.55rem;
    width: 2.55rem;
    height: 2.55rem;
    min-height: 2.55rem;
    padding: 0;
    border: 1px solid var(--cart-border);
    border-radius: 50%;
    background: var(--color-white, #fff);
    color: var(--cart-accent);
    box-shadow: 0 .2rem .5rem rgba(31, 86, 79, .08);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.rws-purchase .eshop-cart .eshop-quantity-control button[data-quantity-decrement]:hover,
.rws-purchase .eshop-cart .eshop-quantity-control button[data-quantity-increment]:hover {
    background: var(--cart-soft);
}

.rws-purchase .eshop-cart .eshop-quantity-control input[type="number"],
.rws-purchase .eshop-cart .eshop-quantity-control input[type="text"] {
    flex: 0 0 4.5rem;
    width: 4.5rem;
    min-width: 4rem;
    min-height: 2.55rem;
    height: 2.55rem;
    margin: 0;
    padding: .4rem;
    border: 1px solid var(--purchase-control-border-strong);
    border-radius: .65rem;
    background: var(--color-white, #fff);
    box-shadow: inset 0 .125rem .25rem rgba(31, 86, 79, .05);
    color: var(--cart-ink);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.rws-purchase .eshop-cart .eshop-quantity-control input[type="submit"] {
    min-height: 2.55rem;
    padding: .4rem .7rem;
    border: 1px solid var(--purchase-control-border);
    border-radius: var(--radius-pill, 999rem);
    background: var(--cart-action-soft);
    color: var(--cart-action-ink);
    font-size: .81rem;
    font-weight: 700;
    cursor: pointer;
}

.rws-purchase .eshop-cart .eshop-quantity-control input[type="submit"]:hover { background: #cde6e0; }

.rws-purchase .eshop-cart-table td[data-label="Množství"] > strong {
    display: block;
    margin-bottom: .3rem;
    color: var(--cart-ink);
    font-size: .87rem;
}

.rws-purchase .eshop-cart-table td[data-label="Množství"] > div {
    color: var(--cart-copy);
    font-size: .78rem;
    line-height: 1.55;
}

.rws-purchase .eshop-cart-table td[data-label="Množství"] > div span {
    font-weight: 600;
}

/* Removal is destructive, but should not compete with the checkout CTA. */
.rws-purchase .eshop-cart-table td[data-label="Akce"] { justify-self: end; }
.rws-purchase .eshop-cart-table td[data-label="Akce"] form { margin: 0; }
.rws-purchase .eshop-cart-table td[data-label="Akce"] .eshop-link-button {
    min-height: 2.4rem;
    padding: .35rem .7rem;
    border: 1px solid rgba(183, 53, 36, .16);
    border-radius: var(--radius-pill, 999rem);
    background: rgba(183, 53, 36, .045);
    color: var(--cart-remove-ink);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.rws-purchase .eshop-cart-table td[data-label="Akce"] .eshop-link-button:hover {
    background: rgba(183, 53, 36, .1);
}

/* CART 3. Items grouped by working list ------------------------------- */
.rws-purchase .eshop-cart-group { min-width: 0; }

.rws-purchase .eshop-cart-group > h2 {
    margin: 0 0 .7rem;
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -.02em;
}

.rws-purchase .eshop-cart-group__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(12rem, auto);
    align-items: center;
    gap: 1rem;
    min-width: 0;
    padding: 1rem 1.15rem;
    border: 1px solid var(--cart-border);
    border-radius: var(--radius-card-small, 1.375rem .5rem 1.375rem .5rem);
    background: linear-gradient(125deg, var(--cart-soft), var(--cart-pale));
    box-shadow: var(--cart-shadow);
}

.rws-purchase .eshop-cart-group__row + .eshop-cart-group__row { margin-top: .7rem; }

.rws-purchase .eshop-cart-group__product { gap: .25rem; }
.rws-purchase .eshop-cart-group__product > strong {
    font-family: var(--font-heading, Georgia, serif);
    font-size: 1.1rem;
    line-height: 1.25;
}

.rws-purchase .eshop-cart-group__product small,
.rws-purchase .eshop-cart-group__quantity {
    color: var(--cart-muted);
    font-size: .82rem;
    font-weight: 500;
}

.rws-purchase .eshop-cart-group__actions {
    display: flex;
    align-items: center;
    justify-content: end;
    flex-wrap: wrap;
    gap: .45rem;
    margin: 0;
}

.rws-purchase .eshop-cart-group__actions input[type="number"],
.rws-purchase .eshop-cart-group__actions input[type="text"] {
    width: 5.25rem;
    min-width: 4rem;
    min-height: 2.65rem;
    border: 1px solid var(--purchase-control-border-strong);
    border-radius: .65rem;
    background: var(--color-white, #fff);
    text-align: center;
}

.rws-purchase .eshop-cart-group__actions .eshop-button--secondary {
    min-height: 2.65rem;
    padding: .45rem .85rem;
    border: 1px solid var(--purchase-control-border);
    border-radius: var(--radius-pill, 999rem);
    background: var(--cart-action-soft);
    color: var(--cart-action-ink);
    font-size: .83rem;
    font-weight: 700;
}

.rws-purchase .eshop-cart-group__actions .eshop-link-button {
    min-height: 2.65rem;
    padding: .45rem .6rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--cart-remove-ink);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: .2em;
    cursor: pointer;
}

/* CART 4. Summary ---------------------------------------------------------- */
.rws-purchase .eshop-cart-summary {
    display: grid;
    gap: .8rem;
    padding: clamp(1.1rem, 2.2vw, 1.7rem);
    border: 1px solid var(--cart-border);
    border-radius: var(--radius-card, 1.75rem .5rem 1.75rem .5rem);
    background: linear-gradient(160deg, #fff 5%, var(--cart-pale) 100%);
    box-shadow: var(--shadow-medium, 0 1.125rem 2.5rem rgba(31, 86, 79, .085));
    color: var(--cart-copy);
}

/* Aside already has the accessible name "Souhrn košíku" in the Eshop template.
 * The project repeats it visually as a heading; no functional content is added. */
.rws-purchase .eshop-cart-summary::before {
    content: "Souhrn košíku";
    display: block;
    margin-bottom: .15rem;
    color: var(--cart-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    font-weight: 600;
    letter-spacing: -.025em;
    line-height: 1.2;
}

.rws-purchase .eshop-cart-summary p { margin: 0; line-height: 1.45; }
.rws-purchase .eshop-cart-summary > p:first-of-type {
    color: var(--cart-accent);
    font-size: clamp(1.08rem, 1.65vw, 1.35rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.rws-purchase .eshop-cart-summary > p:first-of-type strong {
    display: block;
    margin-bottom: .25rem;
    color: var(--cart-copy);
    font-size: .81rem;
    font-weight: 700;
}

.rws-purchase .eshop-cart-summary > p:not(:first-of-type) {
    color: var(--cart-muted);
    font-size: .88rem;
}

.rws-purchase .eshop-cart-summary > p:not(:first-of-type) small { font-size: 1em; }

.rws-purchase .eshop-cart-summary__actions {
    display: grid;
    gap: .65rem;
    justify-items: stretch;
    padding-top: 1rem;
    border-top: 1px solid var(--cart-border);
}

.rws-purchase .eshop-cart-summary__actions .eshop-button {
    display: inline-flex;
    width: 100%;
    min-height: 3rem;
    justify-content: center;
    align-items: center;
    padding: .7rem 1rem;
    border: 1px solid var(--cart-accent);
    border-radius: var(--radius-pill, 999rem);
    background: var(--cart-accent);
    box-shadow: 0 .35rem .75rem rgba(31, 86, 79, .12);
    color: var(--color-white, #fff);
    font-size: .86rem;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    transition: transform var(--transition-fast, 180ms ease), box-shadow var(--transition-fast, 180ms ease);
}

.rws-purchase .eshop-cart-summary__actions .eshop-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 .55rem 1rem rgba(31, 86, 79, .15);
}

.rws-purchase .eshop-cart-summary__actions .eshop-button--secondary {
    border-color: var(--purchase-control-border);
    background: var(--cart-action-soft);
    box-shadow: 0 .25rem .65rem rgba(31, 86, 79, .07);
    color: var(--cart-action-ink);
}

/* CART 5. Empty state ------------------------------------------------------ */
.rws-purchase .eshop-empty-state {
    max-width: 42rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--surface-line-strong, rgba(23, 82, 76, .14));
    border-radius: var(--radius-card, 1.75rem .5rem 1.75rem .5rem);
    background: var(--color-brand-pale, #f6fbfa);
    box-shadow: var(--shadow-soft, 0 .625rem 1.5rem rgba(31, 86, 79, .055));
}

.rws-purchase .eshop-empty-state a { color: var(--color-brand-strong, #177f77); font-weight: 700; }

/* CART 6. Adaptation without a second scrolling area ---------------------- */
@media (max-width: 70rem) {
    .rws-purchase .eshop-cart__layout { grid-template-columns: minmax(0, 1fr); }
    .rws-purchase .eshop-cart__layout > .eshop-cart-summary { max-width: 31rem; }
}

@media (max-width: 45rem) {
    .rws-purchase .eshop-cart-table tbody tr {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "product product"
            "code code"
            "quantity quantity"
            "unit subtotal"
            "action action";
        align-items: start;
        gap: .45rem .7rem;
        padding: 1rem;
    }

    .rws-purchase .eshop-cart-table tbody td[data-label="Množství"] { margin-top: .5rem; }
    .rws-purchase .eshop-cart-table tbody td[data-label="Cena za jednotku"] { align-self: end; }
    .rws-purchase .eshop-cart-table tbody td[data-label="Mezisoučet"] { align-self: end; }
    .rws-purchase .eshop-cart-table tbody td[data-label="Akce"] { justify-self: start; }

    .rws-purchase .eshop-cart-table tbody td[data-label="Množství"]::before,
    .rws-purchase .eshop-cart-table tbody td[data-label="Mezisoučet"]::before {
        display: block;
        margin-bottom: .25rem;
        color: var(--cart-muted);
        font-family: var(--font-body, system-ui, sans-serif);
        font-size: .76rem;
        font-weight: 600;
        line-height: 1.4;
        text-align: left;
    }

    .rws-purchase .eshop-cart-table tbody td[data-label="Mezisoučet"]::before { text-align: right; }

    .rws-purchase .eshop-cart-group__row {
        grid-template-columns: minmax(0, 1fr);
        gap: .75rem;
    }

    .rws-purchase .eshop-cart-group__actions { justify-content: start; }
}

@media (max-width: 25rem) {
    .rws-purchase .eshop-cart-table tbody tr {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "product" "code" "quantity" "unit" "subtotal" "action";
    }
    .rws-purchase .eshop-cart-table tbody td[data-label="Mezisoučet"] { text-align: left; }
    .rws-purchase .eshop-cart-table tbody td[data-label="Mezisoučet"]::before { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    .rws-purchase .eshop-cart .eshop-link-group--views a,
    .rws-purchase .eshop-cart-summary__actions .eshop-button { transition: none; }
    .rws-purchase .eshop-cart-summary__actions .eshop-button:hover { transform: none; }
}

/* CHECKOUT 1. Details: restrained editorial type, compact forms, wider order summary.
 * Structural and commercial behavior remains owned by Eshop/RWS. */
.rws-purchase .eshop-checkout-layout {
    --dc-accent: var(--color-brand-strong, #177f77);
    --dc-ink: var(--color-ink, #17252d);
    --dc-copy: var(--color-copy, #35474e);
    --dc-muted: var(--color-muted, #5d6a70);
    --dc-line: var(--surface-line-strong, rgba(23, 82, 76, .14));
    --dc-pale: var(--color-brand-pale, #f6fbfa);
    --dc-soft: var(--color-brand-soft, #eaf7f5);
    --dc-shadow: var(--shadow-medium, 0 1.125rem 2.5rem rgba(31, 86, 79, .085));
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(21rem, .94fr);
    align-items: start;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--dc-ink);
}

.rws-purchase .eshop-checkout-layout > * { min-width: 0; }

/* Main form: group related fields without turning every step into a large card. */
.rws-purchase .eshop-checkout-form {
    display: grid;
    gap: 1.3rem;
    max-width: none;
    margin: 0;
}

.rws-purchase .eshop-checkout-step {
    min-width: 0;
    padding: 0 0 1.45rem;
    border-bottom: 1px solid var(--dc-line);
}

.rws-purchase .eshop-checkout-step:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.rws-purchase .eshop-checkout-step h2 {
    margin: 0 0 .75rem;
    color: var(--dc-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.45rem, 2.05vw, 1.85rem);
    font-weight: 700;
    line-height: 1.2;
}

.rws-purchase .eshop-checkout-step__help {
    margin: -.2rem 0 .85rem;
    color: var(--dc-muted);
    font-size: .875rem;
    line-height: 1.5;
}

.rws-purchase .eshop-checkout-fields,
.rws-purchase .eshop-checkout-fields--two {
    gap: .9rem 1rem;
}

.rws-purchase .eshop-checkout-fields--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rws-purchase .eshop-checkout-field > label {
    margin: 0 0 .35rem;
    color: var(--dc-ink);
    font-size: .87rem;
    font-weight: 650;
    line-height: 1.35;
}

.rws-purchase .eshop-checkout-field > input,
.rws-purchase .eshop-checkout-field > textarea {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding: .625rem .85rem;
    border: 1px solid var(--dc-line);
    border-radius: .78rem;
    background: var(--color-white, #fff);
    box-shadow: inset 0 .14rem .42rem rgba(24, 80, 75, .055);
    color: var(--dc-ink);
    font: inherit;
    font-size: .96rem;
    line-height: 1.35;
    transition: border-color var(--transition-fast, 180ms ease), box-shadow var(--transition-fast, 180ms ease);
}

.rws-purchase .eshop-checkout-field > textarea {
    min-height: 6rem;
    resize: vertical;
}

.rws-purchase .eshop-checkout-field > :is(input, textarea):focus {
    border-color: var(--dc-accent);
    box-shadow: inset 0 .14rem .42rem rgba(24, 80, 75, .035), 0 0 0 .16rem rgba(23, 127, 119, .12);
}

.rws-purchase .eshop-checkout-optional,
.rws-purchase .eshop-checkout-delivery {
    margin-top: .65rem;
}

.rws-purchase .eshop-checkout-company-fields,
.rws-purchase .eshop-checkout-delivery-fields {
    padding-top: .85rem;
}

.rws-purchase .eshop-checkout-toggle {
    padding: .3rem 0;
    color: var(--dc-accent);
    font-size: .88rem;
    font-weight: 600;
    text-decoration-thickness: 1px;
    text-underline-offset: .15em;
}

.rws-purchase .eshop-checkout-toggle:hover { color: var(--dc-ink); }

/* Compact delivery and payment choices. The selected state reflects the real radio. */
.rws-purchase .eshop-checkout-options {
    display: grid;
    gap: .55rem;
    min-width: 0;
}

.rws-purchase .eshop-checkout-options label {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    min-height: 2.8rem;
    margin: 0;
    padding: .6rem .85rem;
    border: 1px solid var(--dc-line);
    border-radius: .82rem;
    background: var(--dc-pale);
    color: var(--dc-copy);
    font-size: .92rem;
    line-height: 1.4;
    cursor: pointer;
    transition: background var(--transition-fast, 180ms ease), border-color var(--transition-fast, 180ms ease);
}

.rws-purchase .eshop-checkout-options label:has(input:checked) {
    border-color: var(--purchase-control-border-strong);
    background: var(--dc-soft);
    color: var(--dc-ink);
    font-weight: 600;
}

.rws-purchase .eshop-checkout-options label:not(:has(input:disabled)):hover {
    border-color: rgba(23, 127, 119, .38);
    background: var(--dc-soft);
}

.rws-purchase .eshop-checkout-options input[type="radio"] {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--dc-accent);
}

.rws-purchase .eshop-checkout-options label:has(input:disabled) {
    opacity: .55;
    cursor: not-allowed;
}

/* Notes, legal links and onward action retain their actual Eshop meanings. */
.rws-purchase .eshop-checkout-legal-notice {
    margin-block: 1rem;
    color: var(--dc-copy);
    font-size: .9rem;
    line-height: 1.6;
}

.rws-purchase .eshop-checkout-layout a { color: var(--dc-accent); }
.rws-purchase .eshop-checkout-layout a:hover { color: var(--dc-ink); }

.rws-purchase .eshop-checkout-next { margin-top: .35rem; }
.rws-purchase .eshop-checkout-next p {
    margin: .55rem 0 .9rem;
    color: var(--dc-muted);
    font-size: .84rem;
    line-height: 1.5;
}

.rws-purchase .eshop-checkout-next input[type="submit"] {
    min-height: 2.9rem;
    padding: .6rem 1.35rem;
    border: 1px solid var(--dc-accent);
    border-radius: var(--radius-pill, 999rem);
    background: var(--dc-accent);
    box-shadow: var(--purchase-primary-shadow);
    color: var(--color-white, #fff);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    transition: transform var(--transition-fast, 180ms ease), box-shadow var(--transition-fast, 180ms ease);
}

.rws-purchase .eshop-checkout-next input[type="submit"]:hover:not(:disabled) {
    transform: translateY(-.1rem);
    box-shadow: 0 .65rem 1.3rem rgba(23, 127, 119, .2);
}

/* The wider summary is a visual sibling of the approved cart summary. */
.rws-purchase .eshop-checkout-aside {
    min-width: 0;
    padding: clamp(1.25rem, 2.3vw, 1.75rem);
    border: 1px solid var(--dc-line);
    border-radius: var(--radius-card, 1.75rem .5rem 1.75rem .5rem);
    background: linear-gradient(135deg, var(--dc-pale), var(--dc-soft) 135%);
    box-shadow: var(--dc-shadow), inset 0 1px rgba(255, 255, 255, .8);
}

.rws-purchase .eshop-checkout-aside h2 {
    margin: 0 0 1rem;
    color: var(--dc-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.5rem, 2.1vw, 1.9rem);
    font-weight: 700;
    line-height: 1.18;
}

.rws-purchase .eshop-checkout-aside__items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rws-purchase .eshop-checkout-aside__items li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .35rem .8rem;
    min-width: 0;
    padding: .75rem 0;
    border-bottom: 1px solid var(--dc-line);
    color: var(--dc-ink);
    font-size: .9rem;
    line-height: 1.4;
}

.rws-purchase .eshop-checkout-aside__items li > :first-child { min-width: 0; }
.rws-purchase .eshop-checkout-aside__items li small {
    margin-top: .18rem;
    color: var(--dc-muted);
    font-size: .83rem;
}

.rws-purchase .eshop-checkout-aside__items strong {
    color: var(--dc-ink);
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.rws-purchase .eshop-checkout-aside__total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: .6rem .9rem;
    padding-top: 1rem;
    color: var(--dc-ink);
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.35;
}

.rws-purchase .eshop-checkout-aside__total strong {
    color: var(--dc-accent);
    font-size: clamp(1.2rem, 1.85vw, 1.55rem);
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
}

.rws-purchase .eshop-checkout-aside__note {
    margin: .85rem 0;
    color: var(--dc-muted);
    font-size: .83rem;
    line-height: 1.5;
}

.rws-purchase .eshop-checkout-aside > a {
    color: var(--dc-accent);
    font-size: .9rem;
    font-weight: 650;
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

@media (max-width: 62rem) {
    .rws-purchase .eshop-checkout-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.35rem;
    }
    .rws-purchase .eshop-checkout-aside { grid-row: 1; }
}

@media (max-width: 40rem) {
    .rws-purchase .eshop-checkout-step h2 { font-size: 1.48rem; }
    .rws-purchase .eshop-checkout-fields--two { grid-template-columns: minmax(0, 1fr); }
    .rws-purchase .eshop-checkout-aside { padding: 1.1rem; }
    .rws-purchase .eshop-checkout-aside__total strong { font-size: 1.3rem; }
}

@media (max-width: 29rem) {
    .rws-purchase .eshop-checkout-aside__items li,
    .rws-purchase .eshop-checkout-aside__total {
        grid-template-columns: minmax(0, 1fr);
    }
    .rws-purchase .eshop-checkout-aside__items strong {
        justify-self: start;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rws-purchase .eshop-checkout-layout :is(input, textarea, label) { transition: none; }
    .rws-purchase .eshop-checkout-next input[type="submit"] { transition: none; }
    .rws-purchase .eshop-checkout-next input[type="submit"]:hover { transform: none; }
}


/* CHECKOUT 2. Mobile order summary: project-only progressive enhancement.
 * JS wraps only the existing product list in native <details>. Totals and
 * links remain outside. If JS is absent, Eshop's original list stays visible.
 * Desktop always displays the full list; narrow layouts get a compact toggle. */
.rws-purchase .eshop-checkout-aside__disclosure > summary { display: none; }
.rws-purchase .eshop-checkout-aside__disclosure > .eshop-checkout-aside__items { margin: 0; }

@media (max-width: 62rem) {
    .rws-purchase .eshop-checkout-aside--enhanced {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .rws-purchase .eshop-checkout-aside--enhanced > h2 { order: 0; margin-bottom: .6rem; }
    .rws-purchase .eshop-checkout-aside--enhanced > .eshop-checkout-aside__total {
        order: 1;
        padding-top: .1rem;
    }
    .rws-purchase .eshop-checkout-aside--enhanced > .eshop-checkout-aside__disclosure {
        order: 2;
        margin: .8rem 0 .3rem;
    }
    .rws-purchase .eshop-checkout-aside--enhanced > .eshop-checkout-aside__note { order: 3; }
    .rws-purchase .eshop-checkout-aside--enhanced > a { order: 4; align-self: flex-start; }

    .rws-purchase .eshop-checkout-aside__disclosure > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .7rem;
        min-height: 2.8rem;
        padding: .6rem .85rem;
        border: 1px solid rgba(23, 127, 119, .24);
        border-radius: .8rem;
        background: var(--dc-soft, #eaf7f5);
        box-shadow: 0 .22rem .6rem rgba(31, 86, 79, .045);
        color: var(--dc-accent, #177f77);
        font-family: var(--font-body, system-ui, sans-serif);
        font-size: .9rem;
        font-weight: 650;
        line-height: 1.3;
        cursor: pointer;
        list-style: none;
    }
    .rws-purchase .eshop-checkout-aside__disclosure > summary::-webkit-details-marker { display: none; }
    .rws-purchase .eshop-checkout-aside__disclosure > summary::after {
        content: "";
        flex: 0 0 .5rem;
        width: .5rem;
        height: .5rem;
        margin: -.2rem .1rem 0 0;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        transition: transform .16s ease;
    }
    .rws-purchase .eshop-checkout-aside__disclosure[open] > summary::after {
        margin: .2rem .1rem 0 0;
        transform: rotate(225deg);
    }
    .rws-purchase .eshop-checkout-aside__disclosure > summary:hover {
        background: var(--color-action-soft, #dcefeb);
    }
    .rws-purchase .eshop-checkout-aside__disclosure > summary:focus-visible {
        outline: 3px solid var(--dc-accent, #177f77);
        outline-offset: 3px;
    }
    .rws-purchase .eshop-checkout-aside__disclosure[open] > .eshop-checkout-aside__items {
        padding: .25rem .25rem .3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rws-purchase .eshop-checkout-aside__disclosure > summary::after { transition: none; }
}


/* CHECKOUT 3. Final review – Dobrunka.
 * The Eshop owns the four-column review table, the shared orderCommerce
 * partial (including billing, shipping, taxes and notes), and the binding
 * confirmation form. Style their existing markup; never rewrite its text,
 * prices, legal notices or submit behavior in the project. */
.rws-purchase .eshop-checkout-review {
    --cr-accent: var(--color-brand-strong, #177f77);
    --cr-ink: var(--color-ink, #17252d);
    --cr-copy: var(--color-copy, #35474e);
    --cr-muted: var(--color-muted, #5d6a70);
    --cr-line: var(--surface-line-strong, rgba(23, 82, 76, .14));
    --cr-pale: var(--color-brand-pale, #f6fbfa);
    --cr-soft: var(--color-brand-soft, #eaf7f5);
    --cr-shadow: var(--shadow-soft, 0 .625rem 1.5rem rgba(31, 86, 79, .055));
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(20rem, .88fr);
    grid-template-areas:
        "products-title commerce"
        "products commerce"
        "finish finish";
    grid-template-rows: auto 1fr auto;
    align-items: start;
    gap: .85rem clamp(1.35rem, 2.8vw, 2.5rem);
    min-width: 0;
    color: var(--cr-ink);
}

.rws-purchase .eshop-checkout-review > h2 {
    grid-area: products-title;
    margin: 0;
    color: var(--cr-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.45rem, 2.1vw, 1.85rem);
    font-weight: 700;
    line-height: 1.2;
}

/* This table has FOUR cells per row, unlike the cart's SIX-cell table.
 * Explicitly restore true tabular display on desktop to avoid inheriting
 * the card grid and six cart-specific grid areas. */
.rws-purchase .eshop-checkout-review > .eshop-cart__table-wrap {
    grid-area: products;
    min-width: 0;
    margin: 0;
    padding: .35rem 1rem;
    overflow: hidden;
    border: 1px solid var(--cr-line);
    border-radius: var(--radius-card-small, 1.375rem .5rem 1.375rem .5rem);
    background: linear-gradient(145deg, var(--cr-pale), var(--cr-soft));
    box-shadow: var(--cr-shadow);
}

.rws-purchase .eshop-checkout-review .eshop-checkout-items {
    display: table;
    width: 100%;
    min-width: 0;
    table-layout: auto;
    border-spacing: 0;
    border-collapse: collapse;
    overflow: visible;
}

.rws-purchase .eshop-checkout-review .eshop-checkout-items thead {
    display: table-header-group;
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
}

.rws-purchase .eshop-checkout-review .eshop-checkout-items tbody {
    display: table-row-group;
}

.rws-purchase .eshop-checkout-review .eshop-checkout-items thead tr,
.rws-purchase .eshop-checkout-review .eshop-checkout-items tbody tr {
    display: table-row;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.rws-purchase .eshop-checkout-review .eshop-checkout-items th,
.rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td {
    display: table-cell;
    width: auto !important;
    min-width: 0;
    padding: .8rem .45rem;
    border: 0;
    border-bottom: 1px solid var(--cr-line);
    background: transparent;
    color: var(--cr-copy);
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: .85rem;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    grid-area: auto;
}

.rws-purchase .eshop-checkout-review .eshop-checkout-items th {
    padding-top: .7rem;
    color: var(--cr-muted);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.35;
}

.rws-purchase .eshop-checkout-review .eshop-checkout-items tr:last-child td { border-bottom: 0; }
.rws-purchase .eshop-checkout-review .eshop-checkout-items td::before { display: none; }
.rws-purchase .eshop-checkout-review .eshop-checkout-items td:first-child { width: 48% !important; }
.rws-purchase .eshop-checkout-review .eshop-checkout-items td:first-child strong {
    color: var(--cr-ink);
    font-weight: 700;
}
.rws-purchase .eshop-checkout-review .eshop-checkout-items td:first-child p {
    margin: .3rem 0 0;
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: .81rem;
}
.rws-purchase .eshop-checkout-review .eshop-checkout-items :is(th, td):not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.rws-purchase .eshop-checkout-review .eshop-checkout-items td:not(:first-child) {
    white-space: normal;
}
.rws-purchase .eshop-checkout-review .eshop-checkout-items td:last-child strong {
    color: var(--cr-ink);
    font-weight: 750;
}
.rws-purchase .eshop-checkout-review .eshop-checkout-items td:nth-child(2) div {
    margin-top: .15rem;
    color: var(--cr-muted);
    font-size: .77rem;
    line-height: 1.4;
}

/* OrderCommerce is shared by review, success, email and administration.
 * Keep all its content and its original ordering together; style this
 * particular public review instance only. */
.rws-purchase .eshop-checkout-review__commerce {
    grid-area: commerce;
    display: grid;
    align-content: start;
    gap: .55rem;
    min-width: 0;
    margin: 0;
    padding: clamp(1.2rem, 2.1vw, 1.85rem);
    border: 1px solid var(--cr-line);
    border-radius: var(--radius-card, 1.75rem .5rem 1.75rem .5rem);
    background: linear-gradient(145deg, var(--cr-pale), var(--cr-soft));
    box-shadow: var(--shadow-medium, 0 1.125rem 2.5rem rgba(31, 86, 79, .085));
    overflow-wrap: anywhere;
}

.rws-purchase .eshop-checkout-review__commerce > h2 {
    margin: 0 0 .55rem;
    color: var(--cr-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.45rem, 2.15vw, 1.85rem);
    font-weight: 700;
    line-height: 1.2;
}
.rws-purchase .eshop-checkout-review__commerce h3 {
    margin: 1rem 0 .15rem;
    color: var(--cr-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.25;
}
.rws-purchase .eshop-checkout-review__commerce p {
    margin: 0;
    color: var(--cr-copy);
    font-size: .9rem;
    line-height: 1.55;
}
.rws-purchase .eshop-checkout-review__commerce table {
    width: 100%;
    margin: .7rem 0;
    border-collapse: collapse;
    color: var(--cr-ink);
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}
.rws-purchase .eshop-checkout-review__commerce table :is(th, td) {
    padding: .55rem .35rem;
    border-bottom: 1px solid var(--cr-line);
    line-height: 1.35;
    text-align: left;
    vertical-align: top;
    overflow-wrap: normal;
    word-break: normal;
}
.rws-purchase .eshop-checkout-review__commerce table th { font-weight: 700; }
.rws-purchase .eshop-checkout-review__commerce table :is(th, td):last-child {
    text-align: right;
}
.rws-purchase .eshop-checkout-review__commerce a { color: var(--cr-accent); }
/* The standard commerce partial finishes with the total; when its last
 * paragraph is a bold total, separate it without assuming a price value. */
.rws-purchase .eshop-checkout-review__commerce > p:last-child:has(> strong) {
    margin-top: .65rem;
    padding-top: .9rem;
    border-top: 1px solid var(--cr-line);
}
.rws-purchase .eshop-checkout-review__commerce > p:last-child > strong {
    color: var(--cr-accent);
    font-size: 1.06rem;
    font-weight: 750;
    line-height: 1.4;
}

/* Last step: clear review, separate legally binding confirmation from editing. */
.rws-purchase .eshop-checkout-review__finish {
    grid-area: finish;
    min-width: 0;
    margin-top: clamp(.75rem, 1.5vw, 1.5rem);
    padding: clamp(1rem, 2.2vw, 1.6rem);
    border: 1px solid var(--cr-line);
    border-radius: var(--radius-card, 1.75rem .5rem 1.75rem .5rem);
    background: linear-gradient(135deg, var(--cr-pale), var(--cr-soft));
    box-shadow: var(--cr-shadow);
}
.rws-purchase .eshop-checkout-confirmation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: stretch;
    gap: 1rem 2rem;
    min-width: 0;
    margin: 0;
}
.rws-purchase .eshop-checkout-confirmation__notice {
    max-width: 72ch;
    margin: 0;
    color: var(--cr-copy);
    font-size: .91rem;
    line-height: 1.6;
}
.rws-purchase .eshop-checkout-confirmation__notice a,
.rws-purchase .eshop-checkout-review-link a {
    color: var(--cr-accent);
    font-weight: 650;
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}
.rws-purchase .eshop-checkout-confirmation__notice a:hover,
.rws-purchase .eshop-checkout-review-link a:hover { color: var(--cr-ink); }
.rws-purchase .eshop-checkout-confirmation input[type="submit"] {
    justify-self: end;
    min-width: min(100%, 16.5rem);
    min-height: 3.1rem;
    padding: .75rem 1.35rem;
    border: 1px solid var(--cr-accent);
    border-radius: var(--radius-pill, 999rem);
    background: var(--cr-accent);
    box-shadow: var(--purchase-primary-shadow);
    color: var(--color-white, #fff);
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: .94rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    cursor: pointer;
    transition: transform var(--transition-fast, 180ms ease), box-shadow var(--transition-fast, 180ms ease);
}
.rws-purchase .eshop-checkout-confirmation input[type="submit"]:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 .6rem 1.25rem rgba(23, 127, 119, .19);
}
.rws-purchase .eshop-checkout-review-link {
    margin: .7rem 0 0;
    color: var(--cr-muted);
    font-size: .88rem;
    line-height: 1.4;
    text-align: right;
}
.rws-purchase .eshop-checkout-confirmation input[type="submit"]:focus-visible,
.rws-purchase .eshop-checkout-review-link a:focus-visible {
    outline: 3px solid var(--cr-accent);
    outline-offset: 3px;
}

@media (max-width: 70rem) {
    .rws-purchase .eshop-checkout-review {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "products-title" "products" "commerce" "finish";
        grid-template-rows: auto;
        gap: .9rem;
    }
    .rws-purchase .eshop-checkout-review__commerce { margin-top: .55rem; }
}

@media (max-width: 40rem) {
    /* The four-column table becomes compact cards; the native headings
     * stay available to assistive technology and data-labels to sighted users. */
    .rws-purchase .eshop-checkout-review > .eshop-cart__table-wrap {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items,
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody {
        display: block;
        width: 100%;
    }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "product product"
            "quantity total"
            "unit unit";
        gap: .5rem .75rem;
        margin-bottom: .7rem;
        padding: 1rem;
        border: 1px solid var(--cr-line);
        border-radius: var(--radius-card-small, 1.375rem .5rem 1.375rem .5rem);
        background: linear-gradient(135deg, var(--cr-pale), var(--cr-soft));
        box-shadow: var(--cr-shadow);
    }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td {
        display: block;
        width: auto !important;
        min-width: 0;
        padding: 0;
        border: 0;
        grid-area: auto;
        white-space: normal !important;
    }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td:nth-child(1) { grid-area: product; }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td:nth-child(2) { grid-area: quantity; }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td:nth-child(3) { grid-area: unit; }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td:nth-child(4) { grid-area: total; }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td::before {
        display: block;
        margin-bottom: .15rem;
        color: var(--cr-muted);
        font-family: var(--font-body, system-ui, sans-serif);
        font-size: .73rem;
        font-weight: 600;
        line-height: 1.3;
        text-align: inherit;
    }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td:first-child::before { display: none; }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td:nth-child(2),
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td:nth-child(3) {
        text-align: left;
    }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td:nth-child(4) {
        align-self: start;
        text-align: right;
    }
    .rws-purchase .eshop-checkout-review .eshop-checkout-items tbody td:nth-child(3) {
        color: var(--cr-muted);
        font-size: .8rem;
    }
    .rws-purchase .eshop-checkout-review__commerce { padding: 1.15rem; }
    .rws-purchase .eshop-checkout-review__commerce > h2 { font-size: 1.45rem; }
    /* VAT breakdown: each existing table row stays one tax rate.
     * Mobile-only presentation gives each value its own Czech label while
     * the original table headers remain available to assistive technology.
     * More than one VAT rate produces multiple distinct groups. */
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table {
        display: block;
        width: 100%;
        max-width: 100%;
        margin-block: .8rem;
        overflow: visible;
        font-size: .86rem;
        font-variant-numeric: tabular-nums;
    }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody {
        display: block;
        width: 100%;
    }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody tr {
        display: block;
        margin: 0;
        padding: .35rem 0 .7rem;
        border-bottom: 1px solid var(--cr-line);
    }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody tr + tr {
        padding-top: .8rem;
    }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody tr:last-child {
        border-bottom: 0;
    }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody td {
        display: grid;
        grid-template-columns: minmax(0, 1fr) max-content;
        align-items: baseline;
        column-gap: .7rem;
        width: auto !important;
        max-width: 100%;
        padding: .42rem 0;
        border: 0;
        font-size: .84rem;
        line-height: 1.4;
        text-align: right;
        white-space: nowrap;
    }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody td::before {
        display: block;
        min-width: 0;
        color: var(--cr-muted);
        font-size: .79rem;
        font-weight: 500;
        line-height: 1.4;
        text-align: left;
        white-space: normal;
        content: '';
    }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody td:nth-child(1)::before { content: 'Sazba DPH'; }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody td:nth-child(2)::before { content: 'Základ včetně dopravy a platby'; }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody td:nth-child(3)::before { content: 'Daň'; }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody td:nth-child(4)::before { content: 'Celkem'; }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody td:first-child {
        margin-bottom: .25rem;
        padding-bottom: .65rem;
        border-bottom: 1px solid var(--cr-line);
        color: var(--cr-accent);
        font-weight: 700;
    }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody td:last-child {
        font-weight: 700;
    }
    .rws-purchase .eshop-checkout-confirmation {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.05rem;
    }
    .rws-purchase .eshop-checkout-confirmation input[type="submit"] {
        justify-self: start;
        width: 100%;
        min-width: 0;
    }
    .rws-purchase .eshop-checkout-review-link { text-align: left; }
}

@media (max-width: 25rem) {
    /* Keep long amounts intact even on narrow mobile screens; labels may
     * wrap without pushing the value outside the card. */
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody td {
        column-gap: .45rem;
        font-size: .8rem;
    }
    :is(.rws-purchase .eshop-checkout-review__commerce, .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)), :where(.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section)) table tbody td::before {
        font-size: .76rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rws-purchase .eshop-checkout-confirmation input[type="submit"] { transition: none; }
    .rws-purchase .eshop-checkout-confirmation input[type="submit"]:hover { transform: none; }
}

/* AFTER PURCHASE 1. Accepted order – a calm, single-column receipt rather than another
 * checkout task. The Eshop success.latte has no dedicated page class, so
 * scope only to its existing post-purchase navigation OR the distinctive
 * top-level allocation list. Only the shared page-width/tokens also apply
 * to the structurally distinct history view; its heading remains separate.
 * Shared orderCommerce values and bank-transfer instructions stay intact. */
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)),
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) {
    --sc-accent: var(--color-brand-strong, #177f77);
    --sc-ink: var(--color-ink, #17252d);
    --sc-copy: var(--color-copy, #35474e);
    --sc-muted: var(--color-muted, #5d6a70);
    --sc-line: var(--surface-line-strong, rgba(23, 82, 76, .14));
    --sc-soft: var(--color-brand-pale, #f6fbfa);
    /* The checkout-review mobile VAT rules are shared with success and history. */
    --cr-accent: var(--sc-accent);
    --cr-muted: var(--sc-muted);
    --cr-line: var(--sc-line);
    width: 100%;
    max-width: 55rem;
    margin-inline: auto;
    padding-block: clamp(.8rem, 2vw, 1.5rem) clamp(2rem, 5vw, 3.5rem);
    color: var(--sc-ink);
}

/* These remain links: no visual suggestion that another action is required. */
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > .eshop-link-group--meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 1.2rem;
    row-gap: .4rem;
    margin: 0 0 1.25rem;
    padding: 0;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > .eshop-link-group--meta a {
    color: var(--sc-accent);
    font-size: .9rem;
    font-weight: 550;
    text-decoration: underline;
    text-underline-offset: .16em;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > .eshop-link-group--meta a:hover {
    color: var(--sc-ink);
}

/* Quiet success emphasis, without a full-width celebratory card. */
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > h1 {
    margin: 0 0 .45rem;
    color: var(--sc-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.18;
    overflow-wrap: anywhere;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > h1::before {
    content: '✓';
    display: inline-grid;
    place-items: center;
    width: 1.85em;
    height: 1.85em;
    margin-inline-end: .48rem;
    border: 1px solid var(--sc-line);
    border-radius: 50%;
    background: #e3f5ef;
    color: var(--sc-accent);
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: .48em;
    line-height: 1;
    vertical-align: .25em;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > h1 + p {
    margin: 0 0 1.5rem;
    color: var(--sc-muted);
    font-size: .95rem;
    line-height: 1.55;
}

/* Native product-and-allocation list, now a compact receipt. */
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > ul {
    margin: 0 0 1.25rem;
    padding: 0;
    border-top: 1px solid var(--sc-line);
    list-style: none;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > ul > li {
    margin: 0;
    padding: .85rem .2rem;
    border-bottom: 1px solid var(--sc-line);
    font-size: .96rem;
    font-weight: 700;
    line-height: 1.45;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > ul > li > ul {
    margin: .3rem 0 0;
    padding: 0;
    color: var(--sc-muted);
    font-size: .88rem;
    font-weight: 400;
    list-style: none;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > ul > li > ul > li {
    margin: .1rem 0 0;
    padding: 0;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > ul > li > div {
    margin-top: .3rem;
    color: var(--sc-muted);
    font-size: .88rem;
    font-weight: 400;
}

/* Pending confirmation e-mail is informative, not a checkout error. */
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > ul + p {
    margin: 0 0 1.45rem;
    padding: .85rem 1rem;
    border: 1px solid var(--sc-line);
    border-radius: var(--radius-card-small, 1.375rem .5rem 1.375rem .5rem);
    background: var(--sc-soft);
    color: var(--sc-copy);
    font-size: .9rem;
    line-height: 1.6;
}

/* The shared commercial recap follows as ordinary document content. */
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > h2 {
    margin: 1.55rem 0 .6rem;
    color: var(--sc-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.35rem, 2vw, 1.6rem);
    line-height: 1.24;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > h3 {
    margin: 1.1rem 0 .4rem;
    color: var(--sc-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: 1.07rem;
    line-height: 1.3;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > p {
    margin-block: .55rem;
    color: var(--sc-copy);
    font-size: .9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) table {
    display: table;
    width: 100%;
    max-width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    overflow: visible;
    color: var(--sc-ink);
    font-size: .83rem;
    font-variant-numeric: tabular-nums;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) table :is(th, td) {
    padding: .65rem .45rem;
    border-bottom: 1px solid var(--sc-line);
    text-align: left;
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: normal;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) table th {
    color: var(--sc-copy);
    font-weight: 650;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) table :is(th, td):last-child { text-align: right; }
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > table + p:has(> strong) {
    margin-top: 1rem;
    color: var(--sc-accent);
    font-size: 1.06rem;
    font-weight: 700;
}
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > table + p > strong { color: inherit; }
.rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > p:last-child:not(:empty) {
    margin-top: 1rem;
    padding: .8rem 1rem;
    border: 1px solid var(--sc-line);
    border-radius: var(--radius-card-small, 1.375rem .5rem 1.375rem .5rem);
    background: var(--sc-soft);
    color: var(--sc-copy);
    font-size: .86rem;
}

@media (max-width: 40rem) {
    .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) > h1 {
        font-size: clamp(1.6rem, 6.5vw, 1.85rem);
    }
    /* The shared mobile VAT layout above applies to this same table. */
    .rws-purchase:is(:has(> nav[aria-label="Další kroky po objednávce"]), :has(> ul > li > ul)) table {
        display: block;
        margin-block: .8rem;
    }
}


/* AFTER PURCHASE 2. Orders in this browser – same quiet receipt language as acceptance.
 * No system template copy: the direct final cart link and standard history
 * heading/list structure identify this Eshop history view (also when empty).
 * Its selected detail is already rendered by the shared orderCommerce partial.
 * Do not suggest that another checkout step or payment is required. */
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > h1 {
    margin: 0 0 .45rem;
    color: var(--sc-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.2;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > h1 + p {
    margin: 0 0 1rem;
    color: var(--sc-muted);
    font-size: .93rem;
    line-height: 1.55;
}
/* Order numbers are navigation links, not another set of action buttons. */
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > ul {
    margin: .4rem 0 1.5rem;
    padding: 0;
    border-top: 1px solid var(--sc-line);
    list-style: none;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > ul > li {
    margin: 0;
    padding: .65rem .15rem;
    border-bottom: 1px solid var(--sc-line);
    font-size: .93rem;
    line-height: 1.45;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > ul > li > a {
    color: var(--sc-accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: .16em;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > ul > li > a:hover {
    color: var(--sc-ink);
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > ul:empty {
    display: none;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > ul:empty + p {
    margin-bottom: 1.2rem;
    padding: .8rem 1rem;
    border: 1px solid var(--sc-line);
    border-radius: var(--radius-card-small, 1.375rem .5rem 1.375rem .5rem);
    background: var(--sc-soft);
    color: var(--sc-copy);
}
/* The detail uses the same unboxed product/receipt rhythm as success. */
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section {
    min-width: 0;
    padding-top: .65rem;
    border-top: 1px solid var(--sc-line);
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > h2:first-child {
    margin: .75rem 0 1rem;
    color: var(--sc-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.5rem, 2.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.23;
    overflow-wrap: anywhere;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > ul {
    margin: 0 0 1.25rem;
    padding: 0;
    border-top: 1px solid var(--sc-line);
    list-style: none;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > ul > li {
    margin: 0;
    padding: .85rem .2rem;
    border-bottom: 1px solid var(--sc-line);
    color: var(--sc-copy);
    font-size: .93rem;
    line-height: 1.45;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > ul > li strong {
    color: var(--sc-ink);
    font-weight: 700;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > ul > li > ul {
    margin: .3rem 0 0;
    padding: 0;
    color: var(--sc-muted);
    font-size: .9rem;
    list-style: none;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > ul > li > ul > li {
    margin: .15rem 0 0;
    padding: 0;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > :is(h3, h2:not(:first-child)) {
    margin: 1.25rem 0 .45rem;
    color: var(--sc-ink);
    font-family: var(--font-heading, Georgia, serif);
    font-size: 1.15rem;
    line-height: 1.3;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > p {
    margin: .55rem 0;
    color: var(--sc-copy);
    font-size: .9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section table {
    width: 100%;
    max-width: 100%;
    margin-block: 1rem;
    border-collapse: collapse;
    color: var(--sc-ink);
    font-variant-numeric: tabular-nums;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > table + p:has(> strong) {
    margin-top: .85rem;
    color: var(--sc-accent);
    font-size: 1.08rem;
    font-weight: 700;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > table + p > strong {
    color: inherit;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > a:last-child {
    display: inline-block;
    margin-top: 1.1rem;
    color: var(--sc-accent);
    font-size: .9rem;
    font-weight: 550;
    text-decoration: underline;
    text-underline-offset: .16em;
}
.rws-purchase:has(> h1 + p + ul):has(> a:last-child) > a:last-child:hover {
    color: var(--sc-ink);
}
@media (min-width: 40.01rem) {
    .rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section table {
        display: table;
        overflow: visible;
        font-size: .85rem;
    }
    .rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section table :is(th, td) {
        padding: .65rem .45rem;
        border-bottom: 1px solid var(--sc-line);
        text-align: left;
        line-height: 1.4;
        white-space: normal;
        word-break: normal;
    }
    .rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section table :is(th, td):last-child {
        text-align: right;
    }
}
@media (max-width: 40rem) {
    .rws-purchase:has(> h1 + p + ul):has(> a:last-child) > section > h2:first-child {
        font-size: clamp(1.4rem, 6vw, 1.7rem);
    }
    /* Shared mobile VAT rules above already preserve all tax-rate rows. */
}
