/* Shared design for the native WooCommerce cart and checkout */
.fnt-shop-cart, .fnt-shop-checkout {
    --fnt-paper: #faf8f5;
    --fnt-ink: #192338;
    --fnt-muted: #5b606e;
    --fnt-line: #e2dcd6;
    --fnt-accent: #a93321;
    --fnt-lilac: #ebe1f1;
    --fnt-shop-width: min(1100px, calc(100% - 48px));
    background: var(--fnt-paper);
    color: var(--fnt-ink);
}

:is(.fnt-shop-cart, .fnt-shop-checkout):has(.fnt-shop-heading)
    :is(.entry-header > .entry-title, main > .wp-block-post-title, main > .wp-block-group > .wp-block-post-title) {
    display: none;
}

:is(.fnt-shop-cart, .fnt-shop-checkout-columns) .entry-content {
    max-width: none !important;
}

:is(.fnt-shop-cart, .fnt-shop-checkout-columns) main:has(.fnt-shop-heading) { padding-block-start: 24px !important; }

:is(.fnt-shop-cart, .fnt-shop-checkout-columns) .entry-content > :is(.woocommerce, .fnt-shop-heading, .wc-block-cart, .wc-block-checkout),
.fnt-shop-checkout .entry-content > .fnt-shop-heading {
    width: var(--fnt-shop-width);
    max-width: 1100px !important;
    margin-inline: auto !important;
}

.fnt-shop-cart :is(.wp-block-woocommerce-cart, .woocommerce:has(> .woocommerce-cart-form)),
.fnt-shop-checkout-columns :is(.wp-block-woocommerce-checkout, .woocommerce:has(> form.woocommerce-checkout)) {
    width: var(--fnt-shop-width);
    max-width: 1100px !important;
    margin-inline: auto !important;
}

.fnt-shop-cart .woocommerce > .fnt-shop-heading,
.fnt-shop-checkout .woocommerce > .fnt-shop-heading { width: auto; }

.fnt-shop-heading {
    font-size: 15px;
    line-height: 1.45;
    padding-block: 12px 32px;
}

.fnt-shop-heading h1 {
    color: var(--fnt-ink);
    font-size: clamp(38px, 5.8vw, 66px);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -.055em;
    margin: 0;
}

.fnt-shop-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--fnt-muted);
    text-decoration: none;
    min-height: 44px;
    font-size: 13px;
}

.fnt-shop-back:hover { text-decoration: underline; }

.fnt-shop-steps {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 26px 0;
    padding: 0;
    gap: 10px;
    color: var(--fnt-muted);
    font-size: 13px;
    font-weight: 650;
}

.fnt-shop-steps li { display: flex; align-items: center; gap: 8px; }
.fnt-shop-steps li + li::before { content: ""; width: 24px; height: 1px; background: var(--fnt-line); }
.fnt-shop-steps span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--fnt-lilac); }
.fnt-shop-steps [aria-current] { color: var(--fnt-ink); }
.fnt-shop-steps [aria-current] span { background: var(--fnt-ink); color: #fff; }
.fnt-shop-eyebrow { color: var(--fnt-accent); font-weight: 750; font-size: 11px; letter-spacing: .17em; text-transform: uppercase; margin: 0 0 10px; }
.fnt-shop-lead { color: var(--fnt-muted); font-size: 16px; margin: 12px 0 0; }

.fnt-shop-cart .woocommerce:has(> .woocommerce-cart-form) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(265px, 348px);
    column-gap: clamp(24px, 4vw, 56px);
    align-items: start;
}

.fnt-shop-cart .woocommerce:has(> .woocommerce-cart-form) > :not(.woocommerce-cart-form, .cart-collaterals) { grid-column: 1 / -1; }
.fnt-shop-cart .woocommerce:has(> .woocommerce-cart-form)::before,
.fnt-shop-cart .woocommerce:has(> .woocommerce-cart-form)::after { display: none; }
.fnt-shop-cart .woocommerce-cart-form { min-width: 0; margin: 0; }
.fnt-shop-cart .cart-collaterals { box-sizing: border-box; min-width: 0; border-left: 1px solid var(--fnt-line); padding-left: clamp(18px, 2.4vw, 30px); }
.fnt-shop-cart .woocommerce .cart-collaterals :is(.cart_totals, .cross-sells) { width: 100%; float: none; }

.fnt-shop-items-heading,
.fnt-shop-cart .cart_totals > h2,
.fnt-shop-cart .wc-block-components-totals-wrapper > h2,
.fnt-shop-checkout #order_review_heading,
.fnt-shop-checkout .wc-block-components-checkout-step__title {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -.035em;
    color: var(--fnt-ink);
    margin: 0 0 12px;
}

.fnt-shop-count {
    display: inline-block;
    vertical-align: middle;
    border-radius: 20px;
    background: var(--fnt-lilac);
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.fnt-shop-cart .woocommerce table.woocommerce-cart-form__contents,
.fnt-shop-cart .cart_totals table.shop_table {
    border: 0;
    border-radius: 0;
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
}

.fnt-shop-cart .woocommerce-cart-form__contents thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.fnt-shop-cart .woocommerce-cart-form__contents,
.fnt-shop-cart .woocommerce-cart-form__contents tbody { display: block; }

.fnt-shop-cart .woocommerce table.cart .woocommerce-cart-form__cart-item {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    gap: 5px 17px;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid var(--fnt-line);
}

.fnt-shop-cart .woocommerce table.cart .woocommerce-cart-form__cart-item td {
    display: block;
    padding: 0;
    border: 0;
    background: transparent !important;
    text-align: start !important;
}

.fnt-shop-cart .woocommerce table.cart .woocommerce-cart-form__cart-item td::before { display: none; }
.fnt-shop-cart .woocommerce table.cart .woocommerce-cart-form__cart-item td.product-thumbnail { display: block !important; grid-area: 1 / 1 / 4 / 2; }
.fnt-shop-cart .woocommerce-cart-form__cart-item td.product-name { grid-area: 1 / 2 / 4 / 3; min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.fnt-shop-cart .woocommerce table.cart .woocommerce-cart-form__cart-item td.product-price { display: none; }
.fnt-shop-cart .woocommerce-cart-form__cart-item td.product-subtotal { grid-area: 1 / 3; font-weight: 700; justify-self: end; white-space: nowrap; }
.fnt-shop-cart .woocommerce-cart-form__cart-item td.product-quantity { grid-area: 2 / 3; justify-self: end; }
.fnt-shop-cart .woocommerce-cart-form__cart-item td.product-remove { grid-area: 3 / 3; justify-self: end; }
.fnt-shop-cart .product-remove a.remove { font-size: 16px; }
.fnt-shop-cart .woocommerce-cart-form__cart-item dl.variation { margin: 5px 0 0; color: var(--fnt-muted); font-size: 13px; font-weight: 400; }
.fnt-shop-cart .woocommerce-cart-form__cart-item dl.variation dt,
.fnt-shop-cart .woocommerce-cart-form__cart-item dl.variation dd { margin-block: 0 3px; }
.fnt-shop-cart .woocommerce-cart-form__cart-item dl.variation dd p { margin: 0; }

.fnt-shop-cart .woocommerce table.cart .product-thumbnail img,
.fnt-shop-cart .wc-block-cart-item__image img {
    display: block;
    width: 90px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 12px;
    background: var(--fnt-lilac);
}

:is(.fnt-shop-cart, .fnt-shop-checkout) a:is(.fnt-cart-edit, .fnt-cart-view, [href*="fnt_edit="], [href*="wc-ajax=fnt_cart_preview"], [href*="/cart-preview/"]) {
    color: var(--fnt-accent);
    text-underline-offset: 4px;
}

.fnt-shop-cart .woocommerce-cart-form__contents tr:has(> td.actions),
.fnt-shop-cart .woocommerce-cart-form__contents td.actions { display: block; }
.fnt-shop-cart .woocommerce table.cart td.actions { border-top: 1px solid var(--fnt-line); padding: 12px 0; background: transparent; }
.fnt-shop-cart .woocommerce-cart-form:has(.fnt-shop-quantity) button[name="update_cart"]:disabled { display: none; }
.fnt-shop-cart .actions .coupon { display: flex; flex-wrap: wrap; gap: 8px; float: none !important; padding: 0; }
.fnt-shop-cart .actions .coupon input { min-width: 0; flex: 1 1 9rem; margin: 0; }
.fnt-shop-cart .actions .coupon label { width: 100%; }
.fnt-shop-cart .actions .fnt-shop-coupon { text-align: start; margin-bottom: 8px; }
.fnt-shop-coupon summary { cursor: pointer; min-height: 40px; padding-block: 9px; color: var(--fnt-muted); }
.fnt-shop-note { border-top: 1px solid var(--fnt-line); padding-top: 13px; color: var(--fnt-muted); font-size: 13px; line-height: 1.5; }
.fnt-shop-note span { color: var(--fnt-accent); margin-right: 6px; }

.fnt-shop-cart .quantity.fnt-shop-quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--fnt-line);
    border-radius: 8px;
}

.fnt-shop-quantity button {
    border: 0;
    background: transparent;
    color: var(--fnt-ink);
    min-width: 32px;
    min-height: 40px;
    font: inherit;
    cursor: pointer;
}

.fnt-shop-quantity button:hover { background: var(--fnt-lilac); }
.fnt-shop-cart .fnt-shop-quantity input.qty { width: 2.7em; border: 0; background: transparent; appearance: textfield; }
.fnt-shop-quantity input::-webkit-inner-spin-button, .fnt-shop-quantity input::-webkit-outer-spin-button { appearance: none; }

.fnt-shop-cart .cart_totals table.shop_table :is(th,td) { border: 0; border-top: 1px solid var(--fnt-line); background: transparent; padding: 9px 0; }
.fnt-shop-cart .cart_totals table.shop_table td { text-align: right; }
.fnt-shop-cart .woocommerce .wc-proceed-to-checkout a.checkout-button {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    margin-bottom: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}
.fnt-shop-cart .cart_totals .order-total .amount,
.fnt-shop-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: clamp(23px, 2.6vw, 31px);
    letter-spacing: -.045em;
    font-weight: 750;
}

:is(.fnt-shop-cart, .fnt-shop-checkout) :is(.checkout-button, .wc-block-cart__submit-button, #place_order, .wc-block-components-checkout-place-order-button) {
    background: var(--fnt-accent);
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    min-height: 52px;
    text-decoration: none;
}

:is(.fnt-shop-cart, .fnt-shop-checkout) :is(.checkout-button, .wc-block-cart__submit-button, #place_order, .wc-block-components-checkout-place-order-button):hover {
    background: #8d2b1d;
    color: #fff;
}

.fnt-shop-cart .wc-block-cart { font-size: 15px; line-height: 1.45; }
.fnt-shop-cart .wc-block-cart-items__row > td { border-color: var(--fnt-line); }
.fnt-shop-cart .wc-block-cart-item__image { width: 106px; }
.fnt-shop-cart .wc-block-cart-item__product .wc-block-components-product-name { font-weight: 700; color: var(--fnt-ink); }
.fnt-shop-cart .wc-block-components-sidebar { border-left: 1px solid var(--fnt-line); padding-left: clamp(18px, 2.4vw, 30px); }
.fnt-shop-cart .wc-block-cart__totals-title { color: var(--fnt-ink); font-size: 25px; font-weight: 500; line-height: 1.15; text-transform: none; }
.fnt-shop-cart .wc-block-cart .wc-block-cart__submit-container--sticky { display: block; position: static; padding: 0; }
.fnt-shop-cart .wc-block-cart .wc-block-cart__submit-container--sticky::before { display: none; }

.fnt-shop-checkout-columns form.woocommerce-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(265px, 348px);
    gap: 12px clamp(24px, 4vw, 56px);
    align-items: start;
}

.fnt-shop-checkout-columns form.woocommerce-checkout > :not(#customer_details,#order_review_heading,#order_review) { grid-column: 1 / -1; }
.fnt-shop-checkout-columns #customer_details { grid-column: 1; grid-row: 1 / 3; width: auto; float: none; }
.fnt-shop-checkout-columns #customer_details :is(.col-1,.col-2) { width: 100%; float: none; }
.fnt-shop-checkout-columns #order_review_heading,
.fnt-shop-checkout-columns #order_review { grid-column: 2; width: auto; float: none; }
.fnt-shop-checkout-columns #order_review_heading { grid-row: 1; margin: 0; }
.fnt-shop-checkout-columns #order_review { grid-row: 2; }
.fnt-shop-checkout #payment { background: var(--fnt-lilac); border-radius: 8px; }
.fnt-shop-checkout :is(.woocommerce-input-wrapper > input, .woocommerce-input-wrapper > textarea, .wc-block-components-text-input > input) {
    border-radius: 7px;
    border: 1px solid #a6a4a7;
    background: #fff;
    color: var(--fnt-ink);
}

.fnt-shop-preview-dialog {
    width: min(540px, calc(100% - 32px));
    max-height: 90vh;
    overflow: auto;
    box-sizing: border-box;
    padding: 17px;
    border: 0;
    border-radius: 14px;
    background: var(--fnt-paper);
    color: var(--fnt-ink);
}

.fnt-shop-preview-dialog::backdrop { background: #192338a6; }
.fnt-shop-preview-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fnt-shop-preview-dialog h2 { font-size: 28px; font-weight: 500; line-height: 1.15; margin: 0; }
.fnt-shop-preview-dialog img { display: block; width: 100%; max-height: 65vh; object-fit: contain; background: var(--fnt-lilac); }
.fnt-shop-preview-dialog button { border: 1px solid var(--fnt-line); border-radius: 8px; padding: 8px 13px; min-height: 44px; background: #fff; color: inherit; font-family: inherit; cursor: pointer; }

@media (max-width: 768px) {
    .fnt-shop-cart, .fnt-shop-checkout { --fnt-shop-width: calc(100% - 32px); }
    .fnt-shop-heading { padding-bottom: 24px; }
    .fnt-shop-steps { gap: 6px; margin-block: 14px 20px; }
    .fnt-shop-steps li { gap: 5px; }
    .fnt-shop-steps li + li::before { width: 9px; }
    .fnt-shop-cart .woocommerce:has(> .woocommerce-cart-form),
    .fnt-shop-checkout-columns form.woocommerce-checkout { display: block; }
    .fnt-shop-cart .cart-collaterals,
    .fnt-shop-cart .wc-block-components-sidebar { border-left: 0; padding-left: 0; }
    .fnt-shop-cart .cart-collaterals { border-top: 1px solid var(--fnt-line); margin-top: 20px; padding-top: 20px; }
    .fnt-shop-cart .woocommerce table.cart .woocommerce-cart-form__cart-item { grid-template-columns: 64px minmax(0, 1fr) auto; column-gap: 8px; }
    .fnt-shop-cart .woocommerce table.cart .product-thumbnail img,
    .fnt-shop-cart .wc-block-cart-item__image img { width: 64px; }
    .fnt-shop-cart .wc-block-cart-item__image { width: 76px; }
    .fnt-shop-cart .fnt-shop-quantity input.qty { width: 2.1em; }
    .fnt-shop-cart .fnt-shop-quantity button { min-width: 27px; }
}
