/* Mortex Deposit — front-end styling */

.mortex-deposit-notice {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 40px 0 32px;
    padding: 20px 24px;
    background: #f7f3ec;
    border-left: 3px solid #b89b6c;
    border-radius: 2px;
}

/* When the notice sits as the first child of a page wrapper (no page title above), keep it pushed down from the header */
.wp-block-woocommerce-cart > .mortex-deposit-notice:first-child,
.wp-block-woocommerce-checkout > .mortex-deposit-notice:first-child,
.entry-content > .mortex-deposit-notice:first-child {
    margin-top: 48px;
}

.mortex-deposit-notice__icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    background: #b89b6c;
    color: #fff;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 14px;
}

.mortex-deposit-notice__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #3a3a3a;
}

/* Balance row in cart/checkout totals */
.mortex-deposit-balance th,
.mortex-deposit-balance td {
    color: #6a6a6a;
    font-size: 13px;
    font-style: italic;
    font-weight: 400;
}

.mortex-deposit-balance .mortex-deposit-balance__value {
    color: #6a6a6a;
}

/* Deposit pill next to cart line price */
.mortex-deposit-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    background: #b89b6c;
    color: #fff;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
    border-radius: 999px;
    vertical-align: middle;
    line-height: 1.6;
}

/* Hide any "you save" / regular price strikethrough on cart/checkout (deposit context only) */
.woocommerce-cart .product-price del,
.woocommerce-checkout .product-price del,
.woocommerce-cart .product-subtotal del,
.woocommerce-checkout .product-subtotal del {
    display: none;
}

/* Place-order button — keep Mortex CTA feel */
.woocommerce-checkout #place_order {
    letter-spacing: 0.04em;
}

/* Balance row injected by JS into the WC Blocks totals area.
   Reuses .wc-block-components-totals-item so it inherits the alignment + typography rhythm
   of the totals around it; we only override color, weight, and add a separator above. */
.wc-block-components-totals-item.mortex-deposit-balance--block {
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    margin-top: 6px;
    padding-top: 12px;
    color: #6a6a6a;
    font-style: italic;
    font-size: 13px;
    font-weight: 400;
}

.wc-block-components-totals-item.mortex-deposit-balance--block .wc-block-components-totals-item__label,
.wc-block-components-totals-item.mortex-deposit-balance--block .wc-block-components-totals-item__value {
    color: #6a6a6a;
    font-weight: 400;
}

.wc-block-components-totals-item.mortex-deposit-balance--block .wc-block-components-totals-item__value {
    font-style: normal;
    white-space: nowrap;
}

/* PDP deposit hint — appears under the full product price */
.mortex-product__prijs .mortex-pdp-deposit-hint {
    display: block;
    margin-top: 6px;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #6a6a6a;
}

.mortex-product__prijs .mortex-pdp-deposit-hint .woocommerce-Price-amount {
    color: #b89b6c;
    font-weight: 500;
}

.mortex-product__prijs .mortex-pdp-deposit-hint__pct {
    color: #9a9a9a;
    font-size: 12px;
}

/* ---------------------------------------------------------------------------
 * [mortex_quote_confirmation] — bedankpagina
 * ------------------------------------------------------------------------- */

.mortex-quote-confirmation {
    max-width: 720px;
    margin: 80px auto 100px;
    padding: 0 24px;
    font-family: 'Jost', system-ui, sans-serif;
    color: #3a3a3a;
}

/* ---- Hero ---- */
.mortex-qc__hero {
    text-align: center;
    padding: 0 0 56px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 56px;
}

.mortex-qc__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 32px;
    border: 1.5px solid #b89b6c;
    border-radius: 50%;
    color: #b89b6c;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.mortex-qc__title {
    margin: 0 0 16px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 42px;
    font-weight: 400;
    line-height: 1.15;
    color: #1a1a1a;
    letter-spacing: 0.01em;
}

.mortex-qc__lede {
    max-width: 540px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.7;
    color: #6a6a6a;
    font-weight: 300;
}

/* ---- Reference card ---- */
.mortex-qc__refcard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0 0 64px;
    padding: 24px 32px;
    background: #f7f3ec;
    border-left: 3px solid #b89b6c;
    border-radius: 2px;
}

.mortex-qc__refcell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mortex-qc__refcell + .mortex-qc__refcell {
    padding-left: 32px;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.mortex-qc__refcell-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a8a8a;
    font-weight: 400;
}

.mortex-qc__refcell-value {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 22px;
    font-weight: 500;
    color: #1a1a1a;
    letter-spacing: 0.01em;
}

/* ---- Section title (shared) ---- */
.mortex-qc__section-title {
    margin: 0 0 28px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 24px;
    font-weight: 400;
    color: #1a1a1a;
    text-align: center;
    letter-spacing: 0.01em;
}

/* ---- Steps ---- */
.mortex-qc__steps {
    margin-bottom: 72px;
}

.mortex-qc__steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: mortex-step;
}

.mortex-qc__steps-list li {
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: start;
    gap: 24px;
    padding: 18px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.mortex-qc__steps-list li:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mortex-qc__step-num {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 24px;
    font-weight: 300;
    font-style: italic;
    color: #b89b6c;
    line-height: 1;
    padding-top: 4px;
}

.mortex-qc__step-text {
    font-size: 15px;
    line-height: 1.65;
    color: #3a3a3a;
    font-weight: 300;
}

/* ---- Items recap ---- */
.mortex-qc__items {
    margin-bottom: 72px;
}

.mortex-qc__items-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mortex-qc__item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 28px;
    padding: 24px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.mortex-qc__item:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mortex-qc__item-image {
    width: 120px;
    height: 120px;
    overflow: hidden;
    background: #f7f3ec;
    border-radius: 2px;
}

.mortex-qc__item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mortex-qc__item-name {
    margin: 0 0 14px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 22px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.2;
}

.mortex-qc__item-config {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 18px;
    margin: 0 0 14px;
}

.mortex-qc__item-config dt {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8a8a8a;
    font-weight: 400;
    align-self: center;
}

.mortex-qc__item-config dd {
    margin: 0;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.5;
}

.mortex-qc__item-attachment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 6px 12px;
    background: #f7f3ec;
    border: 1px solid rgba(184, 155, 108, 0.25);
    border-radius: 999px;
    color: #b89b6c;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.mortex-qc__item-attachment:hover {
    background: #efe7d6;
    border-color: #b89b6c;
}

.mortex-qc__item-attachment img {
    width: 22px;
    height: 22px;
    border-radius: 2px;
    object-fit: cover;
    margin-left: -4px;
}

/* ---- Contact ---- */
.mortex-qc__contact {
    margin-bottom: 56px;
    padding: 36px 32px;
    background: #fafafa;
    border-radius: 2px;
    text-align: center;
}

.mortex-qc__contact-title {
    margin: 0 0 8px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    color: #1a1a1a;
}

.mortex-qc__contact-intro {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.6;
    color: #6a6a6a;
    font-weight: 300;
}

.mortex-qc__contact-links {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
}

.mortex-qc__contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    color: #1a1a1a;
    font-size: 13px;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.mortex-qc__contact-link:hover {
    border-color: #b89b6c;
    color: #b89b6c;
}

.mortex-qc__contact-link svg {
    color: #b89b6c;
}

/* ---- Back-to-collection CTA ---- */
.mortex-qc__cta {
    text-align: center;
}

.mortex-qc__cta-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.2s;
}

.mortex-qc__cta-link:hover {
    background: #333;
    color: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .mortex-quote-confirmation {
        margin: 56px auto 72px;
    }
    .mortex-qc__title {
        font-size: 32px;
    }
    .mortex-qc__refcard {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px 24px;
    }
    .mortex-qc__refcell + .mortex-qc__refcell {
        padding-left: 0;
        padding-top: 18px;
        border-left: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }
    .mortex-qc__steps-list li {
        grid-template-columns: 40px 1fr;
        gap: 16px;
    }
    .mortex-qc__step-num {
        font-size: 20px;
    }
    .mortex-qc__item {
        grid-template-columns: 80px 1fr;
        gap: 18px;
    }
    .mortex-qc__item-image {
        width: 80px;
        height: 80px;
    }
    .mortex-qc__item-name {
        font-size: 18px;
    }
}

/* Layout overrides */
.wp-block-woocommerce-cart {
    container-type: inline-size;
    width: 100%;
    margin: 0 auto;
}

.wc-block-components-button__text {
    color: #fff;
}

/* Neutralise theme's .alignwide negative inline margin on cart/checkout blocks
   (Hello Elementor / theme.json sets margin-inline: -80px which pushes the cart
   outside its container). */
.wp-block-woocommerce-cart.alignwide,
.wp-block-woocommerce-checkout.alignwide {
    margin-inline: 0 !important;
    max-width: 100%;
}

.wc-block-components-checkout-place-order-button {
    background: #333 !important;
    border: 1px solid #333 !important;
}

.mortex-site a {
    color: #fff;
}

/* Contact pills on the bedankpagina need readable text — the global .mortex-site a
   rule above forces white, so we win it back here with class-level specificity. */
.mortex-site .mortex-qc__contact-link,
.mortex-site .mortex-qc__contact-link span {
    color: #333;
}

.mortex-site .mortex-qc__contact-link:hover,
.mortex-site .mortex-qc__contact-link:hover span {
    color: #b89b6c;
}

/* ---------------------------------------------------------------------------
 * WC Blocks button text overrides via CSS variables
 *
 * We don't mutate the React-managed text node — that triggers an insertBefore
 * crash inside checkout-actions-block. Instead, JS sets --mortex-place-order-cta
 * and --mortex-cart-cta on <html>, and we render that text via a pseudo-element
 * laid over the (visibility:hidden) original. The original keeps its size so
 * the button width stays correct.
 * ------------------------------------------------------------------------- */

.wc-block-components-checkout-place-order-button .wc-block-components-button__text {
    visibility: hidden;
    position: relative;
}

.wc-block-components-checkout-place-order-button .wc-block-components-button__text::before {
    content: var(--mortex-place-order-cta, "");
    visibility: visible;
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    white-space: nowrap;
}

/* Cart "Doorgaan naar afrekenen" -> configured cart CTA */
.wc-block-cart__submit-button .wc-block-components-button__text,
a.wc-block-cart__submit-button .wc-block-components-button__text {
    visibility: hidden;
    position: relative;
}

.wc-block-cart__submit-button .wc-block-components-button__text::before,
a.wc-block-cart__submit-button .wc-block-components-button__text::before {
    content: var(--mortex-cart-cta, "");
    visibility: visible;
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    white-space: nowrap;
}

/* If the CSS variable is empty (e.g. plugin disabled), restore original visibility */
:root:not([style*="--mortex-place-order-cta"]) .wc-block-components-checkout-place-order-button .wc-block-components-button__text {
    visibility: visible;
}
:root:not([style*="--mortex-place-order-cta"]) .wc-block-components-checkout-place-order-button .wc-block-components-button__text::before {
    content: none;
}
:root:not([style*="--mortex-cart-cta"]) .wc-block-cart__submit-button .wc-block-components-button__text {
    visibility: visible;
}
:root:not([style*="--mortex-cart-cta"]) .wc-block-cart__submit-button .wc-block-components-button__text::before {
    content: none;
}

/* ---------------------------------------------------------------------------
 * "Geschat totaal" / "Estimated total" -> "Prijsindicatie" (Price indication)
 *
 * The label is inside the React-managed totals footer item, so we don't mutate
 * its text node — instead we hide the original visually and overlay our text
 * via a CSS variable + ::before pseudo-element. Same pattern as the buttons.
 * ------------------------------------------------------------------------- */

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
    visibility: hidden;
    position: relative;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label::before {
    content: var(--mortex-price-indication, "");
    visibility: visible;
    position: absolute;
    left: 0;
    top: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    white-space: nowrap;
}

/* Fallback: if the variable isn't set (plugin disabled), show original text */
:root:not([style*="--mortex-price-indication"]) .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
    visibility: visible;
}
:root:not([style*="--mortex-price-indication"]) .wc-block-components-totals-footer-item .wc-block-components-totals-item__label::before {
    content: none;
}


/* ==========================================================================
   Cart intent toggle — bovenaan cart, kies offerte of direct afrekenen
   ========================================================================== */

.mortex-cart-intent {
    margin: 0 0 32px;
    padding: 24px 28px;
    background: #fafaf7;
    border: 1px solid #ece8df;
    border-radius: 4px;
    transition: opacity 200ms ease;
}

.mortex-cart-intent.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.mortex-cart-intent__title {
    font-family: var(--mortex-font-heading, 'Cormorant Garamond', serif);
    font-size: 22px;
    font-weight: 400;
    color: var(--mortex-black, #1a1a1a);
    margin: 0 0 14px;
    letter-spacing: 0.01em;
}

.mortex-cart-intent__toggle {
    display: inline-flex;
    background: #fff;
    border: 1px solid #d8d4ca;
    border-radius: 3px;
    padding: 3px;
    overflow: hidden;
}

.mortex-cart-intent__btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 11px 24px;
    font-family: var(--mortex-font-body, 'Jost', sans-serif);
    font-size: 14px;
    font-weight: 500;
    color: #6b6b6b;
    cursor: pointer;
    border-radius: 2px;
    letter-spacing: 0.02em;
    transition: background 180ms ease, color 180ms ease;
}

.mortex-cart-intent__btn:hover:not(.is-active):not(.is-disabled):not(:disabled) {
    color: var(--mortex-black, #1a1a1a);
}

.mortex-cart-intent__btn.is-active {
    background: var(--mortex-black, #1a1a1a);
    color: #fff;
    cursor: default;
}

.mortex-cart-intent__btn.is-disabled,
.mortex-cart-intent__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mortex-cart-intent__hint {
    margin: 12px 0 0;
    font-family: var(--mortex-font-body, 'Jost', sans-serif);
    font-size: 13px;
    color: #8a8a8a;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .mortex-cart-intent {
        padding: 18px 18px;
    }
    .mortex-cart-intent__toggle {
        display: flex;
        width: 100%;
    }
    .mortex-cart-intent__btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 13px;
    }
}
