/*
 * Made Lore production storefront framework.
 *
 * This layer styles Astra and WooCommerce without copying parent templates.
 * Product data, pricing, stock, taxonomies and MPS Creator rendering remain
 * authoritative in WordPress, WooCommerce and MPS Creator Core.
 */

/* ----------------------------------------------------------
   GENERAL COMMERCE SHELL
   ---------------------------------------------------------- */

.made-lore-commerce .site-content {
    padding-block: clamp(1.25rem, 3vw, 3rem);
}

/* Archive pages sit directly beneath Astra's breadcrumb strip. */
.made-lore-shop-archive .site-content {
    padding-block: clamp(0.3rem, 0.7vw, 0.6rem) clamp(1.5rem, 3vw, 2.5rem);
}

.made-lore-shop-archive #primary {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.made-lore-commerce .ast-woocommerce-container,
.made-lore-commerce .woocommerce-page .site-main,
.made-lore-commerce .woocommerce {
    min-width: 0;
}

.made-lore-commerce .woocommerce-message,
.made-lore-commerce .woocommerce-info,
.made-lore-commerce .woocommerce-error {
    margin-bottom: 1.25rem;
    border: 1px solid var(--ml-color-border);
    border-top: 4px solid var(--ml-color-gold);
    border-radius: var(--ml-radius-md);
    color: var(--ml-color-ink);
    background: var(--ml-color-paper-strong);
    box-shadow: var(--ml-shadow-sm);
}

.made-lore-commerce .woocommerce-error {
    border-top-color: var(--ml-color-error);
}

.made-lore-commerce .woocommerce-info {
    border-top-color: var(--ml-color-teal);
}

.made-lore-commerce .woocommerce a.button,
.made-lore-commerce .woocommerce button.button,
.made-lore-commerce .woocommerce input.button,
.made-lore-commerce .woocommerce #respond input#submit {
    min-height: 46px;
    padding: 0.75rem 1.1rem;
    border: 1px solid var(--ml-color-gold);
    border-radius: var(--ml-radius-sm);
    color: var(--ml-color-parchment);
    background: var(--ml-color-navy);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.made-lore-commerce .woocommerce a.button:hover,
.made-lore-commerce .woocommerce button.button:hover,
.made-lore-commerce .woocommerce input.button:hover,
.made-lore-commerce .woocommerce #respond input#submit:hover,
.made-lore-commerce .woocommerce a.button:focus-visible,
.made-lore-commerce .woocommerce button.button:focus-visible,
.made-lore-commerce .woocommerce input.button:focus-visible {
    color: var(--ml-color-navy);
    background: var(--ml-color-gold);
}

/* ----------------------------------------------------------
   SHOP AND TAXONOMY HERO
   ---------------------------------------------------------- */

.ml-shop-hero {
    position: relative;
    margin: 0 0 clamp(1rem, 2vw, 1.5rem);
    padding: clamp(1rem, 2vw, 1.6rem);
    overflow: hidden;
    border: 1px solid rgba(200, 155, 60, 0.55);
    border-radius: var(--ml-radius-lg);
    color: var(--ml-color-parchment);
    background:
        linear-gradient(105deg, rgba(11, 16, 38, 0.98), rgba(17, 26, 58, 0.92)),
        var(--ml-color-navy);
    box-shadow: var(--ml-shadow-md);
}

.ml-shop-hero::after {
    position: absolute;
    top: -7rem;
    right: -5rem;
    width: 20rem;
    height: 20rem;
    border: 1px solid rgba(200, 155, 60, 0.28);
    border-radius: 50%;
    box-shadow:
        0 0 0 2.8rem rgba(200, 155, 60, 0.045),
        0 0 0 5.6rem rgba(14, 165, 181, 0.035);
    content: "";
}

.ml-shop-hero__layout {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: clamp(1rem, 2vw, 1.5rem);
}

.ml-shop-hero__copy {
    min-width: 0;
    max-width: 760px;
}

.ml-shop-hero__category-icon {
    display: flex;
    flex: 0 0 104px;
    align-items: flex-start;
    justify-content: center;
    width: 104px;
    height: 104px;
    margin-top: 1.7rem;
}

.ml-shop-hero__category-icon-image {
    display: block;
    width: 104px;
    height: 104px;
    margin: 0;
    object-fit: contain;
}

.ml-shop-hero__eyebrow {
    margin: 0 0 0.45rem;
    color: var(--ml-color-gold);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.ml-shop-hero h1 {
    margin: 0 0 0.5rem;
    color: var(--ml-color-parchment);
    font-size: clamp(2rem, 5vw, 3.75rem);
    line-height: 1.08;
}

.ml-shop-hero p:last-child {
    margin-bottom: 0;
    color: rgba(243, 233, 210, 0.88);
    font-size: clamp(1rem, 1.8vw, 1.16rem);
}

/* ----------------------------------------------------------
   CATEGORY AND GENRE NAVIGATION
   ---------------------------------------------------------- */

.ml-storefront-nav {
    margin: 0 0 clamp(1.5rem, 4vw, 2.8rem);
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid var(--ml-color-border);
    border-radius: var(--ml-radius-lg);
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--ml-shadow-sm);
}

.ml-storefront-nav__head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.ml-storefront-nav__head h2 {
    margin: 0;
    font-family: var(--ml-font-body);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 700;
}

.ml-storefront-nav__list {
    display: flex;
    gap: 0.7rem;
    margin: 0;
    padding: 0 0 0.25rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    list-style: none;
    scroll-snap-type: inline proximity;
}

.ml-storefront-nav__list > li {
    flex: 0 0 min(13.25rem, 72vw);
    margin: 0;
    scroll-snap-align: start;
}

.ml-storefront-nav__link {
    display: flex;
    min-height: 76px;
    flex-direction: column;
    justify-content: center;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(11, 16, 38, 0.14);
    border-radius: var(--ml-radius-md);
    color: var(--ml-color-navy);
    background: var(--ml-color-paper-strong);
    text-decoration: none;
}

.ml-storefront-nav__link span {
    font-weight: 700;
    line-height: 1.25;
}

.ml-storefront-nav__link small {
    margin-top: 0.2rem;
    color: var(--ml-color-muted);
    font-size: 0.78rem;
}

.ml-storefront-nav__link:hover,
.ml-storefront-nav__link:focus-visible,
.ml-storefront-nav__link.is-current {
    border-color: var(--ml-color-gold);
    color: var(--ml-color-navy);
    background: rgba(200, 155, 60, 0.13);
}

.ml-storefront-nav.is-scrollable {
    position: relative;
}

/* ----------------------------------------------------------
   SHOP CATEGORY CARDS
   ---------------------------------------------------------- */

/*
 * The shop category card markup is now made deterministic by functions.php:
 * WooCommerce still owns the category loop and link, while Made Lore supplies
 * an image wrapper and count-free title. Scope is the main shop archive only.
 */
body.post-type-archive-product .woocommerce ul.products li.product-category {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
}

body.post-type-archive-product .woocommerce ul.products li.product-category:hover {
    border-color: transparent;
    box-shadow: none;
}

body.post-type-archive-product .woocommerce ul.products li.product-category > a {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: stretch;
    color: inherit;
    text-decoration: none;
}

body.post-type-archive-product .ml-shop-category-card__image {
    display: flex;
    min-height: 230px;
    align-items: flex-end;
    justify-content: center;
    margin: 0 0 1rem;
}

body.post-type-archive-product .ml-shop-category-card__image img {
    display: block;
    width: min(100%, 220px);
    max-height: 220px;
    height: auto;
    margin: 0 auto;
    border-radius: 0;
    object-fit: contain;
    object-position: center bottom;
}

body.post-type-archive-product .ml-shop-category-card__title {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--ml-color-navy) !important;
    background: transparent !important;
    font-family: var(--ml-font-body);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

/* Defensive fallback. rc.8 also removes the count in PHP on the shop page. */
body.post-type-archive-product .woocommerce ul.products li.product-category .count,
body.post-type-archive-product .woocommerce ul.products li.product-category mark.count {
    display: none !important;
}

@media (max-width: 768px) {
    body.post-type-archive-product .ml-shop-category-card__image {
        min-height: 190px;
        margin-bottom: 0.8rem;
    }

    body.post-type-archive-product .ml-shop-category-card__image img {
        max-height: 180px;
    }
}

/* ----------------------------------------------------------
   ARCHIVE TOOLBAR
   ---------------------------------------------------------- */

.made-lore-shop-archive .woocommerce-result-count,
.made-lore-shop-archive .woocommerce-ordering {
    margin-block: 0 1.25rem;
}

.made-lore-shop-archive .woocommerce-result-count {
    color: var(--ml-color-muted);
    font-size: 0.92rem;
}

.made-lore-shop-archive .woocommerce-ordering select {
    min-width: 14rem;
    max-width: 100%;
}

/* ----------------------------------------------------------
   PRODUCT GRID AND PRODUCT CARDS
   ---------------------------------------------------------- */

.made-lore-shop-archive .woocommerce ul.products,
.made-lore-commerce .related.products ul.products,
.made-lore-commerce .upsells.products ul.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1rem, 2.4vw, 1.7rem);
    margin: 0;
}

.made-lore-shop-archive .woocommerce ul.products::before,
.made-lore-shop-archive .woocommerce ul.products::after,
.made-lore-commerce .related.products ul.products::before,
.made-lore-commerce .related.products ul.products::after,
.made-lore-commerce .upsells.products ul.products::before,
.made-lore-commerce .upsells.products ul.products::after {
    display: none;
}

.made-lore-shop-archive .woocommerce ul.products li.product,
.made-lore-commerce .related.products ul.products li.product,
.made-lore-commerce .upsells.products ul.products li.product {
    display: flex;
    width: auto !important;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    float: none !important;
    margin: 0 !important;
    overflow: hidden;
    border: 1px solid var(--ml-color-border);
    border-radius: var(--ml-radius-lg);
    background: rgba(255, 253, 248, 0.96);
    box-shadow: var(--ml-shadow-sm);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.made-lore-shop-archive .woocommerce ul.products li.product:hover,
.made-lore-commerce .related.products ul.products li.product:hover,
.made-lore-commerce .upsells.products ul.products li.product:hover {
    border-color: rgba(200, 155, 60, 0.68);
    box-shadow: var(--ml-shadow-md);
    transform: none;
}

.made-lore-shop-archive .woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
.made-lore-commerce .related.products li.product .astra-shop-thumbnail-wrap,
.made-lore-commerce .upsells.products li.product .astra-shop-thumbnail-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #fff;
}

.made-lore-shop-archive .woocommerce ul.products li.product a img,
.made-lore-commerce .related.products li.product a img,
.made-lore-commerce .upsells.products li.product a img {
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    background: #fff;
}

.made-lore-shop-archive .woocommerce ul.products li.product .astra-shop-summary-wrap,
.made-lore-commerce .related.products li.product .astra-shop-summary-wrap,
.made-lore-commerce .upsells.products li.product .astra-shop-summary-wrap {
    display: flex;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    padding: 1rem;
}

.ml-product-card__eyebrow {
    margin: 0 0 0.3rem;
    color: var(--ml-color-gold-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    line-height: 1.25;
    text-transform: uppercase;
}

.made-lore-shop-archive .woocommerce ul.products li.product .woocommerce-loop-product__title,
.made-lore-commerce .related.products li.product .woocommerce-loop-product__title,
.made-lore-commerce .upsells.products li.product .woocommerce-loop-product__title {
    margin: 0 0 0.5rem;
    padding: 0;
    color: var(--ml-color-navy);
    font-family: var(--ml-font-body);
    font-size: clamp(1rem, 1.4vw, 1.14rem);
    font-weight: 700;
    line-height: 1.3;
}

.made-lore-shop-archive .woocommerce ul.products li.product .price,
.made-lore-commerce .related.products li.product .price,
.made-lore-commerce .upsells.products li.product .price {
    margin: auto 0 0.8rem;
    color: var(--ml-color-navy);
    font-size: 1rem;
    font-weight: 700;
}

.made-lore-shop-archive .woocommerce ul.products li.product .price del,
.made-lore-commerce .related.products li.product .price del,
.made-lore-commerce .upsells.products li.product .price del {
    color: var(--ml-color-muted);
    font-weight: 500;
}

.made-lore-shop-archive .woocommerce ul.products li.product .button,
.made-lore-commerce .related.products li.product .button,
.made-lore-commerce .upsells.products li.product .button {
    width: 100%;
    margin: 0;
}

.made-lore-shop-archive .woocommerce span.onsale,
.made-lore-product-page .woocommerce span.onsale {
    min-width: 0;
    min-height: 0;
    padding: 0.42rem 0.65rem;
    border-radius: 0 0 0 var(--ml-radius-md);
    color: var(--ml-color-parchment);
    background: var(--ml-color-magenta);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

/* ----------------------------------------------------------
   SINGLE PRODUCT
   ---------------------------------------------------------- */

.made-lore-product-page .ast-woocommerce-container {
    padding: clamp(1rem, 3vw, 2.25rem);
}

.made-lore-product-page .woocommerce div.product {
    display: flow-root;
}

.made-lore-product-page .woocommerce div.product div.images,
.made-lore-product-page .woocommerce div.product div.summary {
    margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

.made-lore-product-page .woocommerce div.product div.images {
    padding: clamp(0.6rem, 1.8vw, 1rem);
    border: 1px solid var(--ml-color-border);
    border-radius: var(--ml-radius-lg);
    background: #fff;
    box-shadow: var(--ml-shadow-sm);
}

.made-lore-product-page .woocommerce-product-gallery__image a {
    display: block;
}

.made-lore-product-page .woocommerce-product-gallery__image img {
    background: #fff;
    object-fit: contain;
}

.made-lore-product-page .flex-control-thumbs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 0.7rem !important;
}

.made-lore-product-page .flex-control-thumbs li {
    width: auto !important;
    margin: 0 !important;
}

.made-lore-product-page .flex-control-thumbs img {
    border: 1px solid transparent;
    border-radius: var(--ml-radius-sm);
}

.made-lore-product-page .flex-control-thumbs img.flex-active,
.made-lore-product-page .flex-control-thumbs img:hover {
    border-color: var(--ml-color-gold);
}

.ml-product-summary__eyebrow {
    margin: 0 0 0.35rem;
    color: var(--ml-color-gold-dark);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.made-lore-product-page .product_title {
    margin-bottom: 0.65rem;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.08;
}

.made-lore-product-page .woocommerce-product-rating {
    margin-bottom: 0.75rem;
}

.made-lore-product-page .woocommerce div.product p.price,
.made-lore-product-page .woocommerce div.product span.price {
    color: var(--ml-color-navy);
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    font-weight: 700;
}

.made-lore-product-page .woocommerce-product-details__short-description {
    color: var(--ml-color-muted);
}

/* Keep WooCommerce's native variation and purchase structure intact. The
 * MPS Creator route chooser and approval controls are rendered inside this
 * form and must not be re-laid out by the storefront theme. */
.made-lore-product-page .woocommerce div.product form.cart {
    margin-top: 1.3rem;
}

.made-lore-product-page .woocommerce div.product form.cart .variations {
    margin-bottom: 1rem;
}

.made-lore-product-page .woocommerce div.product form.cart .variations select {
    width: 100%;
    max-width: none;
}

.made-lore-product-page .woocommerce div.product form.cart .reset_variations {
    display: inline-block;
    margin-top: 0.45rem;
    color: var(--ml-color-blue);
    font-size: 0.85rem;
}

.made-lore-product-page .woocommerce-variation-price {
    margin: 0.65rem 0;
}

.made-lore-product-page .woocommerce div.product form.cart div.quantity {
    margin-right: 0.65rem;
}

.made-lore-product-page .quantity .qty {
    min-width: 5rem;
}

.made-lore-product-page .single_add_to_cart_button {
    min-width: min(100%, 15rem);
}

.made-lore-product-page .product_meta {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--ml-color-border);
    color: var(--ml-color-muted);
    font-size: 0.86rem;
}

.made-lore-product-page .product_meta > span {
    display: block;
    margin-top: 0.25rem;
}

/* MPS Creator embedded in a WooCommerce product form. */

.made-lore-product-page .mps-product-editor,
.made-lore-product-page [data-mps-product-editor],
.made-lore-product-page .mps-creator-product-editor {
    margin-top: 1rem;
    border-color: rgba(200, 155, 60, 0.55);
    background: var(--ml-color-paper-strong);
}

/* ----------------------------------------------------------
   MPS CREATOR PRODUCT-CONTROL COMPATIBILITY
   ---------------------------------------------------------- */

/* Core owns the visibility and layout of these controls. The storefront may
 * frame the product page, but it must never hide or replace them. */
.made-lore-product-page .mpsc-personalisation {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    visibility: visible;
    opacity: 1;
}

.made-lore-product-page .mpsc-customer-routes:not([hidden]),
.made-lore-product-page .mpsc-rights-confirmation:not([hidden]) {
    display: block;
    visibility: visible;
    opacity: 1;
}

.made-lore-product-page .mpsc-customer-route-grid {
    display: grid;
}

.made-lore-product-page .mpsc-customer-route-card {
    display: flex;
}

.made-lore-product-page .mpsc-personalisation [hidden] {
    display: none !important;
}

.made-lore-product-page .woocommerce-variation-add-to-cart,
.made-lore-product-page .single_variation_wrap {
    max-width: 100%;
    overflow: visible;
}

.made-lore-product-page .single_add_to_cart_button {
    visibility: visible;
    opacity: 1;
}

/* ----------------------------------------------------------
   REASSURANCE
   ---------------------------------------------------------- */

.ml-product-reassurance {
    clear: both;
    margin: clamp(1.5rem, 4vw, 3rem) 0;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid var(--ml-color-border);
    border-radius: var(--ml-radius-lg);
    background: rgba(255, 253, 248, 0.94);
    box-shadow: var(--ml-shadow-sm);
}

.ml-product-reassurance__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.ml-product-reassurance__item {
    position: relative;
    min-width: 0;
    padding: 0.85rem 0.9rem 0.85rem 1rem;
    border-left: 3px solid var(--ml-color-gold);
    background: rgba(243, 233, 210, 0.25);
}

.ml-product-reassurance__item h3 {
    margin: 0 0 0.25rem;
    font-size: 0.98rem;
}

.ml-product-reassurance__item p {
    margin: 0;
    color: var(--ml-color-muted);
    font-size: 0.83rem;
    line-height: 1.45;
}

/* ----------------------------------------------------------
   PRODUCT TABS, RELATED AND UPSELLS
   ---------------------------------------------------------- */

.made-lore-product-page .woocommerce-tabs {
    clear: both;
    margin-top: clamp(1.5rem, 4vw, 3rem);
}

.made-lore-product-page .woocommerce-tabs ul.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding: 0;
}

.made-lore-product-page .woocommerce-tabs ul.tabs::before,
.made-lore-product-page .woocommerce-tabs ul.tabs::after {
    display: none;
}

.made-lore-product-page .woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
    border: 1px solid var(--ml-color-border);
    border-radius: var(--ml-radius-sm);
    background: var(--ml-color-paper-strong);
}

.made-lore-product-page .woocommerce-tabs ul.tabs li::before,
.made-lore-product-page .woocommerce-tabs ul.tabs li::after {
    display: none;
}

.made-lore-product-page .woocommerce-tabs ul.tabs li a {
    padding: 0.65rem 0.9rem;
    color: var(--ml-color-navy);
}

.made-lore-product-page .woocommerce-tabs ul.tabs li.active {
    border-color: var(--ml-color-gold);
    background: rgba(200, 155, 60, 0.13);
}

.made-lore-product-page .woocommerce-Tabs-panel {
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid var(--ml-color-border);
    border-radius: var(--ml-radius-lg);
    background: rgba(255, 253, 248, 0.94);
}

.made-lore-product-page .related.products,
.made-lore-product-page .upsells.products {
    clear: both;
    margin-top: clamp(2rem, 5vw, 4rem);
}

.made-lore-product-page .related.products > h2,
.made-lore-product-page .upsells.products > h2 {
    margin-bottom: 1.2rem;
    font-family: var(--ml-font-body);
    font-size: clamp(1.35rem, 3vw, 1.85rem);
}

/* ----------------------------------------------------------
   CART AND CHECKOUT
   ---------------------------------------------------------- */

.made-lore-commerce .woocommerce-cart-form,
.made-lore-commerce .cart-collaterals,
.made-lore-commerce .woocommerce-checkout-review-order,
.made-lore-commerce .woocommerce-billing-fields,
.made-lore-commerce .woocommerce-shipping-fields,
.made-lore-commerce .woocommerce-additional-fields {
    min-width: 0;
}

.made-lore-commerce table.shop_table {
    border: 1px solid var(--ml-color-border);
    border-radius: var(--ml-radius-md);
    background: rgba(255, 253, 248, 0.95);
}

.made-lore-commerce table.shop_table th {
    color: var(--ml-color-navy);
    background: rgba(243, 233, 210, 0.42);
}

.made-lore-commerce table.shop_table td,
.made-lore-commerce table.shop_table th {
    border-color: var(--ml-color-border);
}

.made-lore-commerce .cart_totals,
.made-lore-commerce #order_review,
.made-lore-commerce #payment {
    padding: clamp(1rem, 2.5vw, 1.4rem);
    border: 1px solid var(--ml-color-border);
    border-radius: var(--ml-radius-lg);
    background: rgba(255, 253, 248, 0.95);
    box-shadow: var(--ml-shadow-sm);
}

.made-lore-commerce #payment ul.payment_methods {
    border-bottom-color: var(--ml-color-border);
}

.made-lore-commerce #payment div.payment_box {
    color: var(--ml-color-ink);
    background: rgba(243, 233, 210, 0.52);
}

.made-lore-commerce #payment div.payment_box::before {
    border-bottom-color: rgba(243, 233, 210, 0.52);
}

/* ----------------------------------------------------------
   MY ACCOUNT
   ---------------------------------------------------------- */

.made-lore-commerce .woocommerce-MyAccount-navigation {
    margin-bottom: 1.25rem;
}

.made-lore-commerce .woocommerce-MyAccount-navigation ul {
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--ml-color-border);
    border-radius: var(--ml-radius-lg);
    background: var(--ml-color-paper-strong);
    list-style: none;
}

.made-lore-commerce .woocommerce-MyAccount-navigation li {
    margin: 0;
    border-bottom: 1px solid var(--ml-color-border);
}

.made-lore-commerce .woocommerce-MyAccount-navigation li:last-child {
    border-bottom: 0;
}

.made-lore-commerce .woocommerce-MyAccount-navigation a {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--ml-color-navy);
    text-decoration: none;
}

.made-lore-commerce .woocommerce-MyAccount-navigation .is-active a,
.made-lore-commerce .woocommerce-MyAccount-navigation a:hover,
.made-lore-commerce .woocommerce-MyAccount-navigation a:focus-visible {
    color: var(--ml-color-navy);
    background: rgba(200, 155, 60, 0.16);
}

.made-lore-commerce .woocommerce-MyAccount-content {
    min-width: 0;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid var(--ml-color-border);
    border-radius: var(--ml-radius-lg);
    background: rgba(255, 253, 248, 0.94);
    box-shadow: var(--ml-shadow-sm);
}

/* ----------------------------------------------------------
   RESPONSIVE LAYOUT
   ---------------------------------------------------------- */

@media (max-width: 1100px) {
    .made-lore-shop-archive .woocommerce ul.products,
    .made-lore-commerce .related.products ul.products,
    .made-lore-commerce .upsells.products ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ml-product-reassurance__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .made-lore-commerce .site-content {
        padding-block: 0.75rem 1.5rem;
    }

    .ml-shop-hero {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .ml-shop-hero__category-icon {
        flex-basis: 82px;
        width: 82px;
        height: 82px;
        margin-top: 1.55rem;
    }

    .ml-shop-hero__category-icon-image {
        width: 82px;
        height: 82px;
    }

    .ml-storefront-nav {
        margin-inline: -0.15rem;
        padding-inline: 0.85rem;
    }

    .made-lore-shop-archive .woocommerce ul.products,
    .made-lore-commerce .related.products ul.products,
    .made-lore-commerce .upsells.products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .made-lore-product-page .ast-woocommerce-container {
        padding: 0.8rem;
    }

    .made-lore-product-page .woocommerce-tabs ul.tabs {
        flex-direction: column;
    }

    .made-lore-product-page .woocommerce-tabs ul.tabs li,
    .made-lore-product-page .woocommerce-tabs ul.tabs li a {
        width: 100%;
    }

    .made-lore-commerce table.shop_table_responsive tr,
    .made-lore-commerce .woocommerce-page table.shop_table_responsive tr {
        margin-bottom: 0.85rem;
        border: 1px solid var(--ml-color-border);
        border-radius: var(--ml-radius-md);
        background: var(--ml-color-paper-strong);
    }

    .made-lore-commerce table.shop_table_responsive tr td,
    .made-lore-commerce .woocommerce-page table.shop_table_responsive tr td {
        border-bottom: 1px solid var(--ml-color-border);
    }
}

@media (max-width: 520px) {

    .ml-shop-hero {
        margin-inline: calc((100vw - 100%) / -2);
        padding: 1.25rem max(1rem, calc((100vw - var(--ml-content-width)) / 2));
    }

    .ml-shop-hero__layout {
        align-items: flex-start;
        gap: 0.85rem;
    }

    .ml-shop-hero__category-icon {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
        margin-top: 1.45rem;
    }

    .ml-shop-hero__category-icon-image {
        width: 64px;
        height: 64px;
    }

    .ml-shop-hero::after {
        opacity: 0.55;
    }

    .ml-storefront-nav__list > li {
        flex-basis: min(11.5rem, 78vw);
    }

    .made-lore-shop-archive .woocommerce-result-count,
    .made-lore-shop-archive .woocommerce-ordering {
        float: none;
        width: 100%;
    }

    .made-lore-shop-archive .woocommerce-ordering select {
        width: 100%;
    }

    .made-lore-shop-archive .woocommerce ul.products,
    .made-lore-commerce .related.products ul.products,
    .made-lore-commerce .upsells.products ul.products {
        grid-template-columns: 1fr;
    }

    .made-lore-shop-archive .woocommerce ul.products li.product,
    .made-lore-commerce .related.products ul.products li.product,
    .made-lore-commerce .upsells.products ul.products li.product {
        display: grid;
        grid-template-columns: minmax(115px, 38%) minmax(0, 1fr);
    }

    .made-lore-shop-archive .woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
    .made-lore-commerce .related.products li.product .astra-shop-thumbnail-wrap,
    .made-lore-commerce .upsells.products li.product .astra-shop-thumbnail-wrap {
        height: 100%;
        aspect-ratio: auto;
    }

    .made-lore-shop-archive .woocommerce ul.products li.product .astra-shop-summary-wrap,
    .made-lore-commerce .related.products li.product .astra-shop-summary-wrap,
    .made-lore-commerce .upsells.products li.product .astra-shop-summary-wrap {
        padding: 0.85rem;
    }

    .made-lore-shop-archive .woocommerce ul.products li.product .woocommerce-loop-product__title,
    .made-lore-commerce .related.products li.product .woocommerce-loop-product__title,
    .made-lore-commerce .upsells.products li.product .woocommerce-loop-product__title {
        font-size: 1rem;
    }

    .made-lore-product-page .flex-control-thumbs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .made-lore-product-page .single_add_to_cart_button,
    .made-lore-product-page .woocommerce div.product form.cart div.quantity {
        width: 100%;
        margin: 0 0 0.65rem;
    }

    .made-lore-product-page .quantity .qty {
        width: 100%;
    }

    .ml-product-reassurance__grid {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------------
   RC.9 PRODUCTS GATEWAY + MOBILE CATEGORY HERO
   ---------------------------------------------------------- */

/* The main Products archive is a branded gateway rather than a white
 * catalogue page. Category archives remain white shopping surfaces. */
body.post-type-archive-product .site-content {
    color: #fff;
    background: var(--ml-color-navy);
    padding-block: clamp(0.9rem, 1.8vw, 1.35rem) clamp(2.4rem, 4vw, 3.5rem);
}

body.post-type-archive-product #primary,
body.post-type-archive-product .ast-woocommerce-container,
body.post-type-archive-product main.site-main,
body.post-type-archive-product .woocommerce {
    background: transparent;
}

/* Integrate the shop hero into the midnight page instead of displaying it as
 * a separate card. Product-category heroes retain the rc.8 panel treatment. */
body.post-type-archive-product .ml-shop-hero {
    margin: 0 0 clamp(1.6rem, 3vw, 2.3rem);
    padding: clamp(0.9rem, 1.8vw, 1.25rem) 0 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.post-type-archive-product .ml-shop-hero::after {
    display: none;
}

body.post-type-archive-product .ml-shop-hero h1 {
    color: #fff;
}

body.post-type-archive-product .ml-shop-hero p:last-child {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.88);
}

/* Gold illustrations remain the visual anchor; category names become white so
 * the complete gateway reads as one coherent Made Lore surface. */
body.post-type-archive-product .ml-shop-category-card__title {
    color: #fff !important;
}

body.post-type-archive-product .woocommerce ul.products li.product-category > a:focus-visible {
    outline: 2px solid var(--ml-color-gold);
    outline-offset: 6px;
    border-radius: var(--ml-radius-sm);
}

@media (max-width: 520px) {
    /* Keep the Products gateway inside the normal mobile content gutter; the
     * page background itself supplies the full-width midnight treatment. */
    body.post-type-archive-product .ml-shop-hero {
        margin-inline: 0;
        padding-inline: 0;
    }

    /* Product-category hero only: stack the existing category icon above the
     * heading block on phones. Desktop/tablet remain left-aligned as in rc.8. */
    body.tax-product_cat .ml-shop-hero__layout {
        flex-direction: column;
        gap: 0.65rem;
    }

    body.tax-product_cat .ml-shop-hero__category-icon {
        flex: 0 0 auto;
        width: 72px;
        height: 72px;
        margin: 0;
        align-self: flex-start;
    }

    body.tax-product_cat .ml-shop-hero__category-icon-image {
        width: 72px;
        height: 72px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .made-lore-shop-archive .woocommerce ul.products li.product,
    .made-lore-commerce .related.products ul.products li.product,
    .made-lore-commerce .upsells.products ul.products li.product {
        transition: none;
    }
}

/* ----------------------------------------------------------
   RC.12 CONTROLLED STOREFRONT PURCHASE UX
   ----------------------------------------------------------

   Presentation only. Built from exact rc.9 after rc.11 staging evidence.
   Owns PS-01, CO-02B and CO-03A only. It does not hide page-content
   Spacer blocks, patch MPS Creator/Roster internals, replace WooCommerce
   templates or change shipping/payment behaviour.
*/

@media (max-width: 768px) {
    /* CO-02B: Astra adds 22px left padding plus -22px text-indent to classic
       shipping-method rows. Reset those presentation offsets explicitly, then
       use the native WooCommerce radio + label as a contained two-column row. */
    .made-lore-commerce #shipping_method.woocommerce-shipping-methods {
        width: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
        text-align: left;
    }

    .made-lore-commerce #shipping_method.woocommerce-shipping-methods > li {
        display: grid;
        grid-template-columns: 1rem minmax(0, 1fr);
        align-items: start;
        column-gap: 0.55rem;
        row-gap: 0.2rem;
        width: 100%;
        min-width: 0;
        margin: 0 0 0.75rem !important;
        padding: 0 !important;
        text-align: left;
        text-indent: 0 !important;
        list-style: none;
    }

    .made-lore-commerce #shipping_method.woocommerce-shipping-methods > li:last-child {
        margin-bottom: 0 !important;
    }

    .made-lore-commerce #shipping_method.woocommerce-shipping-methods > li > input.shipping_method:not([type="hidden"]) {
        position: static !important;
        inset: auto !important;
        float: none !important;
        transform: none !important;
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        width: 1rem !important;
        height: 1rem !important;
        min-width: 1rem;
        max-width: 1rem;
        margin: 0.18rem 0 0 !important;
        padding: 0 !important;
    }

    .made-lore-commerce #shipping_method.woocommerce-shipping-methods > li > input.shipping_method[type="hidden"] {
        display: none;
    }

    .made-lore-commerce #shipping_method.woocommerce-shipping-methods > li > label {
        display: block;
        grid-column: 2;
        min-width: 0;
        width: auto;
        margin: 0;
        padding: 0;
        line-height: 1.4;
        text-align: left;
        text-indent: 0;
        word-break: normal;
        overflow-wrap: break-word;
        hyphens: none;
    }

    .made-lore-commerce #shipping_method.woocommerce-shipping-methods > li > :not(input):not(label) {
        grid-column: 2;
        min-width: 0;
        margin-top: 0;
        text-align: left;
        text-indent: 0;
        word-break: normal;
        overflow-wrap: break-word;
    }

    /* CO-03A: contain the WooCommerce Stripe presentation surface. Stripe
       remains authoritative for the secure fields inside its iframe. */
    .made-lore-commerce #payment,
    .made-lore-commerce #payment .payment_methods,
    .made-lore-commerce #payment .payment_methods > li,
    .made-lore-commerce #payment .payment_method_stripe,
    .made-lore-commerce #payment .payment_method_stripe .payment_box,
    .made-lore-commerce #payment .payment_method_stripe #wc-stripe-upe-form,
    .made-lore-commerce #payment .payment_method_stripe .wc-stripe-upe-element,
    .made-lore-commerce #payment .payment_method_stripe .stripe-card-group,
    .made-lore-commerce #payment .payment_method_stripe .wc-stripe-elements-field {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .made-lore-commerce #payment .payment_method_stripe .payment_box {
        margin-right: 0;
        margin-left: 0;
    }

    .made-lore-commerce #payment .payment_method_stripe iframe {
        max-width: 100% !important;
    }
}

@media (max-width: 520px) {
    /* PS-01: compact the native WooCommerce gallery chrome while retaining
       uncropped main imagery and native thumbnail behaviour. */
    .made-lore-product-page .woocommerce div.product div.images {
        margin-bottom: 1rem;
        padding: 0.45rem;
    }

    .made-lore-product-page .flex-control-thumbs {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.35rem;
        margin-top: 0.45rem !important;
    }

    /* CO-02B: classic Cart and Checkout totals are table-based. On phones,
       make the totals container responsive as a grid while preserving ordinary
       two-column rows; the shipping row alone stacks to full width. This avoids
       forcing postal methods into WooCommerce's narrow totals column. */
    .made-lore-commerce .cart_totals table.shop_table,
    .made-lore-commerce table.woocommerce-checkout-review-order-table {
        display: block;
        width: 100%;
    }

    .made-lore-commerce .cart_totals table.shop_table > tbody,
    .made-lore-commerce table.woocommerce-checkout-review-order-table > thead,
    .made-lore-commerce table.woocommerce-checkout-review-order-table > tbody,
    .made-lore-commerce table.woocommerce-checkout-review-order-table > tfoot {
        display: block;
        width: 100%;
    }

    .made-lore-commerce .cart_totals table.shop_table tr,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    .made-lore-commerce .cart_totals table.shop_table tr > th,
    .made-lore-commerce .cart_totals table.shop_table tr > td,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr > th,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr > td {
        display: block;
        width: auto !important;
        min-width: 0;
    }

    .made-lore-commerce .cart_totals table.shop_table tr > td,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr > td:last-child,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr > th:last-child {
        text-align: right;
    }

    .made-lore-commerce .cart_totals table.shop_table td::before {
        display: none !important;
        content: none !important;
    }

    .made-lore-commerce .cart_totals table.shop_table tr.woocommerce-shipping-totals.shipping,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping {
        grid-template-columns: minmax(0, 1fr);
    }

    .made-lore-commerce .cart_totals table.shop_table tr.woocommerce-shipping-totals.shipping > th,
    .made-lore-commerce .cart_totals table.shop_table tr.woocommerce-shipping-totals.shipping > td,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > th,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > td {
        grid-column: 1;
        width: 100% !important;
        min-width: 0;
        max-width: none;
        text-align: left !important;
    }

    .made-lore-commerce .cart_totals table.shop_table tr.woocommerce-shipping-totals.shipping > th,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > th {
        padding-bottom: 0.3rem;
    }

    .made-lore-commerce .cart_totals table.shop_table tr.woocommerce-shipping-totals.shipping > td,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > td {
        padding-top: 0.3rem;
    }

    .made-lore-commerce .cart_totals table.shop_table tr.woocommerce-shipping-totals.shipping > td::before,
    .made-lore-commerce table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > td::before {
        display: none !important;
        content: none !important;
    }

}


/* ----------------------------------------------------------
   RC.15 CHECKOUT PRESENTATION CONSOLIDATION
   ----------------------------------------------------------

   Checkout only. This tranche deliberately starts from rc.12 because its
   Cart presentation passed real staging. It does not carry rc.13/rc.14
   checkout experiments forward. No Cart, footer, header, navigation,
   shipping-rate, payment-logic, WooCommerce-template or MPS Creator changes.
*/

/* Keep the native checkout flow. Do not turn the whole form into a grid: Stripe
   express-payment surfaces and third-party checkout notices must remain in the
   positions chosen by WooCommerce/the gateway. */
body.woocommerce-checkout form.checkout.woocommerce-checkout {
    display: block !important;
}

/* Give the order summary enough desktop room without disturbing the billing
   column or express-payment surfaces that sit outside these three elements. */
@media (min-width: 922px) {
    body.woocommerce-checkout form.checkout.woocommerce-checkout #customer_details {
        float: left !important;
        clear: none !important;
        width: 52% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    body.woocommerce-checkout form.checkout.woocommerce-checkout #order_review_heading,
    body.woocommerce-checkout form.checkout.woocommerce-checkout #order_review {
        float: right !important;
        clear: right !important;
        width: 44% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
}

/* One visual card: heading forms the cap, review/payment forms the body. */
body.woocommerce-checkout form.checkout.woocommerce-checkout #order_review_heading {
    margin: 0 !important;
    padding: 1rem 1.15rem !important;
    border: 1px solid var(--ml-color-border) !important;
    border-bottom: 0 !important;
    border-radius: var(--ml-radius-lg) var(--ml-radius-lg) 0 0 !important;
    background: rgba(255, 253, 248, 0.97) !important;
    box-shadow: none !important;
}

body.woocommerce-checkout form.checkout.woocommerce-checkout #order_review {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--ml-color-border) !important;
    border-top: 0 !important;
    border-radius: 0 0 var(--ml-radius-lg) var(--ml-radius-lg) !important;
    background: rgba(255, 253, 248, 0.97) !important;
    box-shadow: var(--ml-shadow-sm) !important;
}

/* Remove the second box drawn by the review table. Keep ordinary WooCommerce
   table semantics for product/subtotal/total rows. */
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    table-layout: auto !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > thead,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > tbody,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table > tfoot {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr:not(.woocommerce-shipping-totals) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(5.5rem, auto) !important;
    width: 100% !important;
    max-width: 100% !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr:not(.woocommerce-shipping-totals) > th,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr:not(.woocommerce-shipping-totals) > td {
    display: block !important;
    width: auto !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table th,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table td {
    box-sizing: border-box !important;
    min-width: 0 !important;
    padding: 0.8rem 0.95rem !important;
    vertical-align: top !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table .product-name {
    width: auto !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table .product-total {
    width: 6.5rem !important;
    min-width: 6.5rem !important;
    text-align: right !important;
    white-space: nowrap !important;
}

/* Shipping is content, not a price cell. Break it out of the two-column table
   presentation at every viewport size so long Royal Mail descriptions always
   have the complete width of the order card. */
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    border-top: 1px solid var(--ml-color-border) !important;
    border-bottom: 1px solid var(--ml-color-border) !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > th,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > td {
    display: block !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    text-align: left !important;
    border: 0 !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > th {
    padding: 0.9rem 0.95rem 0.35rem !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > td {
    padding: 0.25rem 0.95rem 0.95rem !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > td::before {
    display: none !important;
    content: none !important;
}

/* Explicitly defeat Astra's classic 22px/-22px shipping indentation and any
   inherited narrow label sizing. Flex is used here rather than a nested grid so
   the label is guaranteed to receive the remaining row width. */
body.woocommerce-checkout #order_review ul#shipping_method.woocommerce-shipping-methods {
    display: block !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review ul#shipping_method.woocommerce-shipping-methods > li {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: flex-start !important;
    gap: 0.6rem !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 0.85rem !important;
    padding: 0 !important;
    text-align: left !important;
    text-indent: 0 !important;
    list-style: none !important;
    white-space: normal !important;
}

body.woocommerce-checkout #order_review ul#shipping_method.woocommerce-shipping-methods > li:last-child {
    margin-bottom: 0 !important;
}

body.woocommerce-checkout #order_review ul#shipping_method.woocommerce-shipping-methods > li > input.shipping_method:not([type="hidden"]) {
    position: static !important;
    inset: auto !important;
    float: none !important;
    flex: 0 0 1rem !important;
    width: 1rem !important;
    min-width: 1rem !important;
    max-width: 1rem !important;
    height: 1rem !important;
    margin: 0.2rem 0 0 !important;
    padding: 0 !important;
    transform: none !important;
}

body.woocommerce-checkout #order_review ul#shipping_method.woocommerce-shipping-methods > li > input.shipping_method[type="hidden"] {
    display: none !important;
}

body.woocommerce-checkout #order_review ul#shipping_method.woocommerce-shipping-methods > li > label,
body.woocommerce-checkout #order_review ul#shipping_method.woocommerce-shipping-methods > li > label * {
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
    text-indent: 0 !important;
}

body.woocommerce-checkout #order_review ul#shipping_method.woocommerce-shipping-methods > li > label {
    display: block !important;
    flex: 1 1 calc(100% - 1.6rem) !important;
    width: calc(100% - 1.6rem) !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.45 !important;
    text-align: left !important;
}

body.woocommerce-checkout #order_review ul#shipping_method.woocommerce-shipping-methods > li > label br + span,
body.woocommerce-checkout #order_review ul#shipping_method.woocommerce-shipping-methods > li > label > span {
    display: inline !important;
}

/* Payment is part of the same order-summary card. No nested outer panel and no
   stray right-side border; only a deliberate separator above payment. */
body.woocommerce-checkout #order_review #payment {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-top: 1px solid var(--ml-color-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.woocommerce-checkout #order_review #payment ul.payment_methods,
body.woocommerce-checkout #order_review #payment .payment_methods > li,
body.woocommerce-checkout #order_review #payment .payment_method_stripe,
body.woocommerce-checkout #order_review #payment .payment_method_stripe .payment_box,
body.woocommerce-checkout #order_review #payment .payment_method_stripe #wc-stripe-upe-form,
body.woocommerce-checkout #order_review #payment .payment_method_stripe .wc-stripe-upe-element,
body.woocommerce-checkout #order_review #payment .payment_method_stripe .stripe-card-group,
body.woocommerce-checkout #order_review #payment .payment_method_stripe .wc-stripe-elements-field {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body.woocommerce-checkout #order_review #payment .payment_method_stripe .payment_box {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

body.woocommerce-checkout #order_review #payment .payment_method_stripe iframe {
    width: 100% !important;
    max-width: 100% !important;
}

/* Laptop/tablet/mobile: do not squeeze Billing and Your order side by side. */
@media (max-width: 921px) {
    body.woocommerce-checkout form.checkout.woocommerce-checkout #customer_details,
    body.woocommerce-checkout form.checkout.woocommerce-checkout #order_review_heading,
    body.woocommerce-checkout form.checkout.woocommerce-checkout #order_review {
        float: none !important;
        clear: both !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    body.woocommerce-checkout form.checkout.woocommerce-checkout #order_review_heading {
        margin-top: 1.75rem !important;
    }
}

@media (max-width: 544px) {
    body.woocommerce-checkout form.checkout.woocommerce-checkout #order_review_heading {
        padding: 0.85rem 0.9rem !important;
    }

    body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table th,
    body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table td {
        padding: 0.7rem 0.75rem !important;
    }

    body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table .product-total {
        width: 5.3rem !important;
        min-width: 5.3rem !important;
    }

    body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > th {
        padding: 0.8rem 0.75rem 0.3rem !important;
    }

    body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > td {
        padding: 0.25rem 0.75rem 0.85rem !important;
    }

    body.woocommerce-checkout #order_review #payment {
        padding: 0.85rem !important;
    }
}
