/*
 * PolaroidPillanatok – Cart & Checkout
 * Intentionally scoped to body.ppcc-cart and body.ppcc-checkout.
 */

body.ppcc-cart,
body.ppcc-checkout {
    --ppcc-primary: #885F38;
    --ppcc-primary-hover: #6F4B2D;
    --ppcc-text: #17120E;
    --ppcc-muted: #74675C;
    --ppcc-border: #E4D8CC;
    --ppcc-border-strong: #CDB9A6;
    --ppcc-surface: #FFFFFF;
    --ppcc-surface-soft: #FFF9F0;
    --ppcc-surface-tint: #F7EFE7;
    --ppcc-radius-sm: 8px;
    --ppcc-radius: 12px;
    --ppcc-radius-lg: 16px;
}

/* ---------- Shared typography / controls ---------- */
body.ppcc-cart :where(.wc-block-cart, .woocommerce-cart-form, .cart_totals),
body.ppcc-checkout :where(.wc-block-checkout, form.checkout) {
    color: var(--ppcc-text);
}

body.ppcc-cart :where(.wc-block-components-button, .button),
body.ppcc-checkout :where(.wc-block-components-button, .button) {
    font-weight: 700;
}

body.ppcc-cart :where(a, button, input, select, textarea):focus-visible,
body.ppcc-checkout :where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ppcc-primary) 23%, transparent);
    outline-offset: 2px;
}

body.ppcc-cart .ppcc-edit-design,
body.ppcc-checkout .ppcc-edit-design {
    display: inline-flex !important;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 6px 0 0;
    padding: 8px 14px !important;
    border: 1px solid var(--ppcc-primary) !important;
    border-radius: var(--ppcc-radius-sm) !important;
    background: var(--ppcc-primary) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

body.ppcc-cart .ppcc-edit-design:hover,
body.ppcc-cart .ppcc-edit-design:focus-visible,
body.ppcc-checkout .ppcc-edit-design:hover,
body.ppcc-checkout .ppcc-edit-design:focus-visible {
    border-color: var(--ppcc-primary-hover) !important;
    background: var(--ppcc-primary-hover) !important;
    color: #fff !important;
}

body.ppcc-cart .ppcc-saving,
body.ppcc-checkout .ppcc-saving {
    display: inline-flex;
    width: fit-content;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--ppcc-surface-tint);
    color: var(--ppcc-primary-hover);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

body.ppcc-cart .ppcc-express-heading,
body.ppcc-checkout .ppcc-express-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 14px;
    color: var(--ppcc-primary-hover);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

body.ppcc-cart .ppcc-express-heading::before,
body.ppcc-cart .ppcc-express-heading::after,
body.ppcc-checkout .ppcc-express-heading::before,
body.ppcc-checkout .ppcc-express-heading::after {
    content: "";
    height: 1px;
    flex: 1 1 auto;
    background: var(--ppcc-border);
}

/* Fallback for express-payment areas that do not provide their own heading.
 * Generated content changes no WooCommerce/React child nodes, avoiding checkout
 * reconciliation errors during navigation. */
body.ppcc-cart .ppcc-express-host::before,
body.ppcc-checkout .ppcc-express-host::before {
    content: "Expressz fizetés";
    display: block;
    width: 100%;
    margin: 8px 0 14px;
    color: var(--ppcc-primary-hover);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

/* ---------- Cart ---------- */
body.ppcc-cart .wc-block-cart {
    width: 100%;
    max-width: none;
}

body.ppcc-cart .wc-block-cart__main {
    min-width: 0;
}

body.ppcc-cart .wc-block-cart-items {
    border-spacing: 0;
}

body.ppcc-cart .wc-block-cart-items thead th {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ppcc-border);
    color: var(--ppcc-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

body.ppcc-cart .wc-block-cart-items tbody tr {
    border-bottom: 1px solid var(--ppcc-border);
}

body.ppcc-cart .wc-block-cart-items td {
    padding-top: 22px;
    padding-bottom: 22px;
    vertical-align: top;
}

body.ppcc-cart .wc-block-cart-item__image img,
body.ppcc-checkout .wc-block-components-order-summary-item__image img {
    border: 1px solid var(--ppcc-border);
    border-radius: 6px;
    background: #fff;
}

body.ppcc-cart .wc-block-components-product-name,
body.ppcc-checkout .wc-block-components-product-name {
    color: var(--ppcc-primary-hover);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

body.ppcc-cart .wc-block-components-product-metadata,
body.ppcc-cart .wc-block-components-product-details,
body.ppcc-checkout .wc-block-components-product-metadata,
body.ppcc-checkout .wc-block-components-product-details {
    margin-top: 8px;
    color: var(--ppcc-muted);
    font-size: 13px;
    line-height: 1.55;
}

body.ppcc-cart .wc-block-components-product-details__item,
body.ppcc-checkout .wc-block-components-product-details__item {
    margin: 2px 0;
}

body.ppcc-cart .wc-block-components-quantity-selector {
    min-height: 42px;
    border: 1px solid var(--ppcc-border-strong);
    border-radius: var(--ppcc-radius-sm);
    background: #fff;
    box-shadow: none;
}

body.ppcc-cart .wc-block-components-quantity-selector::after {
    border: 0;
}

body.ppcc-cart .wc-block-components-quantity-selector__button {
    color: var(--ppcc-primary-hover);
}

body.ppcc-cart .wc-block-cart-item__remove-link {
    min-height: 36px;
    padding: 6px 3px;
    color: var(--ppcc-muted);
    font-weight: 600;
    text-decoration: none;
}

body.ppcc-cart .wc-block-cart-item__remove-link:hover,
body.ppcc-cart .wc-block-cart-item__remove-link:focus-visible {
    color: var(--ppcc-primary-hover);
    text-decoration: underline;
}

body.ppcc-cart .wc-block-cart__sidebar {
    min-width: 0;
}

body.ppcc-cart .wc-block-components-sidebar-layout .wc-block-components-main,
body.ppcc-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar {
    margin-top: 0;
}

body.ppcc-cart .wc-block-components-totals-wrapper {
    border-color: var(--ppcc-border);
}

body.ppcc-cart .wc-block-components-totals-coupon,
body.ppcc-checkout .wc-block-components-totals-coupon {
    color: var(--ppcc-text);
}

body.ppcc-cart .wc-block-components-totals-coupon__button,
body.ppcc-checkout .wc-block-components-totals-coupon__button {
    color: var(--ppcc-primary-hover);
    font-weight: 700;
    text-decoration: none;
}

body.ppcc-cart .wc-block-components-totals-coupon__button:hover,
body.ppcc-checkout .wc-block-components-totals-coupon__button:hover {
    color: var(--ppcc-primary);
}

/* Coupon form submit button. Keep the empty/disabled state visibly lighter,
 * then use the normal brand colors once a coupon code can be submitted. */
body.ppcc-cart .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button,
body.ppcc-checkout .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button {
    border: 1px solid var(--ppcc-primary) !important;
    border-radius: var(--ppcc-radius-sm) !important;
    background: var(--ppcc-primary) !important;
    color: #fff !important;
    opacity: 1 !important;
    box-shadow: none !important;
    transition: background-color .16s ease, border-color .16s ease;
}

body.ppcc-cart .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:not(:disabled):hover,
body.ppcc-cart .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:not([aria-disabled="true"]):hover,
body.ppcc-checkout .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:not(:disabled):hover,
body.ppcc-checkout .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:not([aria-disabled="true"]):hover {
    border-color: var(--ppcc-primary-hover) !important;
    background: var(--ppcc-primary-hover) !important;
    color: #fff !important;
}

body.ppcc-cart .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:disabled,
body.ppcc-cart .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button[aria-disabled="true"],
body.ppcc-checkout .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:disabled,
body.ppcc-checkout .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button[aria-disabled="true"] {
    border-color: #CDBCAA !important;
    background: #CDBCAA !important;
    color: #fff !important;
    opacity: 1 !important;
    cursor: not-allowed;
}

body.ppcc-cart .wc-block-cart__submit-container {
    padding-top: 12px;
}

body.ppcc-cart .wc-block-cart__submit-button,
body.ppcc-cart a.wc-block-cart__submit-button,
body.ppcc-cart .wc-block-cart__submit-container .wc-block-components-button {
    min-height: 58px !important;
    border: 1px solid var(--ppcc-primary) !important;
    border-radius: var(--ppcc-radius-sm) !important;
    background: var(--ppcc-primary) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

body.ppcc-cart .wc-block-cart__submit-button:hover,
body.ppcc-cart .wc-block-cart__submit-button:focus-visible,
body.ppcc-cart .wc-block-cart__submit-container .wc-block-components-button:hover,
body.ppcc-cart .wc-block-cart__submit-container .wc-block-components-button:focus-visible {
    border-color: var(--ppcc-primary-hover) !important;
    background: var(--ppcc-primary-hover) !important;
    color: #fff !important;
}

/* Classic cart fallback */
body.ppcc-cart .woocommerce-cart-form table.shop_table,
body.ppcc-cart .cart_totals {
    border-color: var(--ppcc-border);
    border-radius: var(--ppcc-radius);
}

body.ppcc-cart .cart_totals .checkout-button {
    border: 1px solid var(--ppcc-primary) !important;
    border-radius: var(--ppcc-radius-sm) !important;
    background: var(--ppcc-primary) !important;
    color: #fff !important;
}

body.ppcc-cart .cart_totals .checkout-button:hover,
body.ppcc-cart .cart_totals .checkout-button:focus-visible {
    border-color: var(--ppcc-primary-hover) !important;
    background: var(--ppcc-primary-hover) !important;
}

/* ---------- Checkout ---------- */
body.ppcc-checkout .wc-block-checkout {
    width: 100%;
    max-width: none;
}

body.ppcc-checkout .wc-block-checkout__main,
body.ppcc-checkout .wc-block-checkout__sidebar {
    min-width: 0;
}

body.ppcc-checkout .wc-block-checkout__sidebar {
    border: 1px solid var(--ppcc-border);
    border-radius: var(--ppcc-radius);
    background: var(--ppcc-surface);
    overflow: hidden;
}

body.ppcc-checkout .wc-block-components-checkout-step {
    margin-bottom: 28px;
}

body.ppcc-checkout .wc-block-components-checkout-step__heading {
    margin-bottom: 12px;
}

body.ppcc-checkout :where(
    .wc-block-components-text-input input,
    .wc-block-components-combobox-control input,
    .wc-block-components-address-form input,
    .wc-block-components-address-form select,
    .wc-block-components-textarea
) {
    border-color: var(--ppcc-border-strong) !important;
    border-radius: var(--ppcc-radius-sm) !important;
    background: #fff !important;
    box-shadow: none !important;
}

body.ppcc-checkout :where(
    .wc-block-components-text-input input,
    .wc-block-components-combobox-control input,
    .wc-block-components-address-form input,
    .wc-block-components-address-form select,
    .wc-block-components-textarea
):focus {
    border-color: var(--ppcc-primary) !important;
    outline: 3px solid color-mix(in srgb, var(--ppcc-primary) 15%, transparent) !important;
    outline-offset: 0;
}

body.ppcc-checkout .wc-block-components-radio-control__option,
body.ppcc-checkout .wc-block-checkout__shipping-option,
body.ppcc-checkout .wc-block-checkout__payment-method {
    border-color: var(--ppcc-border) !important;
}

body.ppcc-checkout .wc-block-components-radio-control__option-checked,
body.ppcc-checkout .wc-block-components-radio-control__option[aria-checked="true"] {
    border-color: var(--ppcc-primary) !important;
    background: var(--ppcc-surface-soft);
}

body.ppcc-checkout .wc-block-components-radio-control__input:checked {
    accent-color: var(--ppcc-primary);
}

body.ppcc-checkout .wc-block-components-order-summary {
    color: var(--ppcc-text);
}

body.ppcc-checkout .wc-block-components-order-summary-item {
    padding-top: 16px;
    padding-bottom: 16px;
}

body.ppcc-checkout .wc-block-components-order-summary-item__quantity {
    background: var(--ppcc-text);
    color: #fff;
}

body.ppcc-checkout .wc-block-components-checkout-place-order-button,
body.ppcc-checkout button.wc-block-components-checkout-place-order-button,
body.ppcc-checkout .wc-block-checkout__actions_row .wc-block-components-button {
    min-height: 58px !important;
    border: 1px solid var(--ppcc-primary) !important;
    border-radius: var(--ppcc-radius-sm) !important;
    background: var(--ppcc-primary) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    transition: background-color .16s ease, border-color .16s ease;
}

body.ppcc-checkout .wc-block-components-checkout-place-order-button:hover,
body.ppcc-checkout .wc-block-components-checkout-place-order-button:focus-visible,
body.ppcc-checkout .wc-block-checkout__actions_row .wc-block-components-button:hover,
body.ppcc-checkout .wc-block-checkout__actions_row .wc-block-components-button:focus-visible {
    border-color: var(--ppcc-primary-hover) !important;
    background: var(--ppcc-primary-hover) !important;
    color: #fff !important;
}

/* Classic checkout fallback */
body.ppcc-checkout #place_order {
    min-height: 54px;
    border: 1px solid var(--ppcc-primary) !important;
    border-radius: var(--ppcc-radius-sm) !important;
    background: var(--ppcc-primary) !important;
    color: #fff !important;
}

body.ppcc-checkout #place_order:hover,
body.ppcc-checkout #place_order:focus-visible {
    border-color: var(--ppcc-primary-hover) !important;
    background: var(--ppcc-primary-hover) !important;
}

/* ---------- Provider-branded controls: deliberately preserved ----------
 * These selectors are listed explicitly so future generic button rules do not
 * accidentally recolor PayPal / Apple Pay / Google Pay surfaces.
 */
body.ppcc-cart :where(.ppcp-button-container, [class*="paypal"], [class*="apple-pay"], [class*="google-pay"]),
body.ppcc-checkout :where(.ppcp-button-container, [class*="paypal"], [class*="apple-pay"], [class*="google-pay"]) {
    --ppcc-provider-brand-preserved: 1;
}

body.ppcc-cart :where(.ppcp-button-container, [class*="apple-pay"], [class*="google-pay"]) :where(button, iframe),
body.ppcc-checkout :where(.ppcp-button-container, [class*="apple-pay"], [class*="google-pay"]) :where(button, iframe) {
    filter: none !important;
}

/* ---------- Responsive ---------- */
/* WooCommerce's sidebar layout uses percentage-width flex children. Adding a
 * root `gap` makes 65% + 35% + gap exceed 100%, which wraps the sidebar below
 * the main column on desktop. Keep the row explicit and put spacing inside the
 * main column instead. */
@media (min-width: 901px) {
    body.ppcc-cart .wc-block-components-sidebar-layout,
    body.ppcc-checkout .wc-block-components-sidebar-layout {
        display: flex;
        flex-wrap: nowrap !important;
        align-items: flex-start;
        width: 100%;
        max-width: none;
        column-gap: 0;
    }

    body.ppcc-cart .wc-block-components-sidebar-layout .wc-block-components-main,
    body.ppcc-checkout .wc-block-components-sidebar-layout .wc-block-components-main {
        flex: 0 0 65%;
        width: 65%;
        max-width: 65%;
        min-width: 0;
        padding-right: clamp(24px, 3vw, 52px);
        box-sizing: border-box;
    }

    body.ppcc-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar,
    body.ppcc-checkout .wc-block-components-sidebar-layout .wc-block-components-sidebar {
        flex: 0 0 35%;
        width: 35%;
        max-width: 35%;
        min-width: 0;
        margin-left: 0 !important;
        box-sizing: border-box;
    }
}

@media (max-width: 900px) {
    body.ppcc-cart .wc-block-components-sidebar-layout,
    body.ppcc-checkout .wc-block-components-sidebar-layout {
        display: block;
        width: 100%;
    }

    body.ppcc-cart .wc-block-components-sidebar-layout .wc-block-components-main,
    body.ppcc-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar,
    body.ppcc-checkout .wc-block-components-sidebar-layout .wc-block-components-main,
    body.ppcc-checkout .wc-block-components-sidebar-layout .wc-block-components-sidebar {
        width: 100%;
        max-width: none;
        padding-right: 0;
    }

    body.ppcc-cart .wc-block-cart__sidebar,
    body.ppcc-checkout .wc-block-checkout__sidebar {
        margin-top: 8px;
    }
}

@media (max-width: 600px) {
    body.ppcc-cart .wc-block-cart-items td {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    body.ppcc-cart .wc-block-components-product-metadata,
    body.ppcc-cart .wc-block-components-product-details,
    body.ppcc-checkout .wc-block-components-product-metadata,
    body.ppcc-checkout .wc-block-components-product-details {
        font-size: 12px;
    }

    body.ppcc-cart .wc-block-cart__submit-button,
    body.ppcc-checkout .wc-block-components-checkout-place-order-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ppcc-cart .ppcc-edit-design,
    body.ppcc-checkout .ppcc-edit-design,
    body.ppcc-cart .wc-block-cart__submit-button,
    body.ppcc-checkout .wc-block-components-checkout-place-order-button {
        transition: none;
    }
}

/* ---------- PPCC 1.0.2: simplified cart chrome ---------- */
/* Hide the storefront header/navigation on the Cart page only. Keep the WP admin
 * bar untouched for logged-in administrators. */
body.ppcc-cart #masthead,
body.ppcc-cart .site-header,
body.ppcc-cart .elementor-location-header,
body.ppcc-cart [data-elementor-type="header"],
body.ppcc-cart header#site-header,
body.ppcc-cart header.main-header,
body.ppcc-cart [role="banner"],
body.ppcc-cart .wp-site-blocks > header,
body.ppcc-cart header.wp-block-template-part {
    display: none !important;
}

/* Savings are intentionally not shown in the cart/checkout UI anymore. */
body.ppcc-cart .ppcc-saving,
body.ppcc-checkout .ppcc-saving,
body.ppcc-cart .ppcc-hidden-saving,
body.ppcc-checkout .ppcc-hidden-saving {
    display: none !important;
}

/* Tiered Pricing / Woo Blocks can render their own "megtakarítás" badge after
 * every Store API refresh. Keep the cart layout intentionally price-only. JS
 * removes late/dynamic variants too; these selectors are the CSS safety net. */
body.ppcc-cart .wc-block-components-sale-badge,
body.ppcc-checkout .wc-block-components-sale-badge,
body.ppcc-cart .wc-block-components-product-badge,
body.ppcc-checkout .wc-block-components-product-badge {
    display: none !important;
}

/* Lumise-generated customer preview, used by the classic cart fallback. */
body.ppcc-cart img.ppcc-lumise-cart-preview,
body.ppcc-checkout img.ppcc-lumise-cart-preview {
    width: 100%;
    height: auto;
    object-fit: contain;
}

@supports selector(header:has(nav)) {
    body.ppcc-cart header:has(nav) {
        display: none !important;
    }
}


/* ---------- PPCC 1.0.3: current price only ---------- */
/* WooCommerce Blocks renders sale prices as <del>regular</del><ins>current</ins>.
 * Keep the calculation untouched, but only show the amount the customer pays. */
body.ppcc-cart .wc-block-components-product-price > del,
body.ppcc-cart .wc-block-components-product-price__regular,
body.ppcc-checkout .wc-block-components-product-price > del,
body.ppcc-checkout .wc-block-components-product-price__regular {
    display: none !important;
}

body.ppcc-cart .wc-block-components-product-price > ins,
body.ppcc-cart .wc-block-components-product-price__value.is-discounted,
body.ppcc-checkout .wc-block-components-product-price > ins,
body.ppcc-checkout .wc-block-components-product-price__value.is-discounted {
    color: inherit !important;
    text-decoration: none !important;
}

/* The customized Lumise screenshot must win over theme/product-image sizing. */
body.ppcc-cart img.ppcc-lumise-cart-preview,
body.ppcc-checkout img.ppcc-lumise-cart-preview {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* ---------- PPCC 1.0.5: Lumise cart integration ---------- */
/* The separator is supplied by the existing cart metadata/Lumise markup.
 * Do not synthesize another slash with ::before; this prevents `/ /` before
 * the Minta szerkesztése button. */

/* ---------- PPCC 1.0.6: stable totals + cleaner Lumise metadata ---------- */
/* Lumise can add Design: again at a very late metadata priority. JS only marks
 * the row; it does not remove React-owned elements, so +/- refresh remains safe. */
body.ppcc-cart .ppcc-hidden-design-meta,
body.ppcc-checkout .ppcc-hidden-design-meta {
    display: none !important;
}

/* Always present one clean line total in the ÖSSZESEN column. The value comes
 * from WooCommerce Store API line_total after the server has finished quantity
 * and Lumise price calculations. Keep the <td> as a table-cell so every row
 * occupies exactly the same amount-column position. */
body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell {
    width: 112px;
    min-width: 96px;
    padding-left: 14px !important;
    padding-right: 0 !important;
    vertical-align: middle !important;
    text-align: right !important;
    white-space: nowrap;
}

body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell > * {
    display: none !important;
}

body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell::after {
    content: attr(data-ppcc-line-total);
    display: inline-block;
    width: 100%;
    margin: 0;
    padding: 0;
    color: var(--ppcc-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 600px) {
    body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell {
        width: auto;
        min-width: 0;
        padding-left: 8px !important;
    }
}

/* ---------- PPCC 1.0.8: aggregate tiers + stable row separators ---------- */
/* One physical 1px separator per table cell. Woo/theme borders on both the row
 * and the amount cell could overlap by a pixel and create the random thicker
 * short segment visible at the right side of some rows. */
body.ppcc-cart .wc-block-cart-items {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

body.ppcc-cart .wc-block-cart-items tbody tr {
    border: 0 !important;
    box-shadow: none !important;
}

body.ppcc-cart .wc-block-cart-items tbody td {
    border-top: 0 !important;
    border-right: 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid var(--ppcc-border) !important;
    box-shadow: none !important;
}

body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell,
body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell > * {
    border-top: 0 !important;
    border-right: 0 !important;
    border-left: 0 !important;
    box-shadow: none !important;
}

/* Leave enough room for at least two digits without the value getting clipped
 * between the minus and plus buttons. */
body.ppcc-cart .wc-block-components-quantity-selector {
    width: 124px !important;
    min-width: 124px !important;
    max-width: none !important;
}

body.ppcc-cart .wc-block-components-quantity-selector__input {
    width: 48px !important;
    min-width: 48px !important;
    max-width: none !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

body.ppcc-cart .wc-block-components-quantity-selector__button {
    min-width: 34px !important;
    flex: 0 0 34px !important;
}

/* ---------- PPCC 1.0.9: one full-width row separator ---------- */
/* Woo Blocks gives the amount cell a different internal height from the product
 * cell. A border on individual cells can therefore look vertically shifted.
 * Draw exactly one separator on the table row itself and none on the cells. */
body.ppcc-cart .wc-block-cart-items tbody tr {
    border: 0 !important;
    border-bottom: 1px solid var(--ppcc-border) !important;
    box-shadow: none !important;
}

body.ppcc-cart .wc-block-cart-items tbody td,
body.ppcc-cart .wc-block-cart-items tbody td.wc-block-cart-item__total,
body.ppcc-cart .wc-block-cart-items tbody td.wc-block-cart-item__total.ppcc-line-total-cell,
body.ppcc-cart .wc-block-cart-items tbody td.wc-block-cart-item__total.ppcc-line-total-cell > * {
    border-bottom: 0 !important;
}

/* Extra room for 10, 12, 99 etc. even if Woo's own selector CSS uses flex/grid. */
body.ppcc-cart .wc-block-components-quantity-selector {
    width: 144px !important;
    min-width: 144px !important;
    max-width: 144px !important;
}

body.ppcc-cart input.wc-block-components-quantity-selector__input {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    flex: 0 0 64px !important;
    padding-inline: 6px !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-variant-numeric: tabular-nums;
}

body.ppcc-cart .wc-block-components-quantity-selector__button {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    flex: 0 0 38px !important;
}

/* ---------- PPCC 1.0.12: native Store API totals, no index-based repaint ---------- */
/* Woo Blocks already owns and updates the line subtotal. Older PPCC builds hid
 * that markup and painted a ::after value from a parallel Store API array; while
 * React was reconciling, array order and DOM order could temporarily differ and
 * make a price appear to jump to another row. Always show Woo's native markup. */
body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell > * {
    display: initial !important;
}

body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell::after {
    content: none !important;
    display: none !important;
}

body.ppcc-cart td.wc-block-cart-item__total,
body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell {
    width: 112px;
    min-width: 96px;
    padding-left: 14px !important;
    padding-right: 0 !important;
    vertical-align: middle !important;
    text-align: right !important;
    white-space: nowrap;
}

body.ppcc-cart td.wc-block-cart-item__total .wc-block-cart-item__total-price-and-sale-badge-wrapper,
body.ppcc-cart td.wc-block-cart-item__total .wc-block-components-product-price,
body.ppcc-cart td.wc-block-cart-item__total .price {
    margin: 0 !important;
    padding: 0 !important;
    text-align: right !important;
    justify-content: flex-end !important;
}

/* ---------- PPCC 1.0.14: stable Blocks rows after quantity refresh ---------- */
/* Lumise only emits its classic-cart metadata/edit button on is_cart(). PPCC now
 * supplies the same data through Store API and renders one stable details strip.
 * Keep React's native metadata in the DOM as a layout/state fallback, but hide it
 * only after the PPCC replacement has been created. */
body.ppcc-cart .ppcc-native-lumise-meta-hidden,
body.ppcc-cart .ppcc-native-lumise-edit-hidden,
body.ppcc-checkout .ppcc-native-lumise-meta-hidden,
body.ppcc-checkout .ppcc-native-lumise-edit-hidden {
    display: none !important;
}

body.ppcc-cart .ppcc-lumise-details {
    display: flex;
    min-height: 40px;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 8px;
    color: var(--ppcc-muted);
    font-size: 13px;
    line-height: 1.45;
}

body.ppcc-cart .ppcc-lumise-details__meta {
    display: inline;
    min-width: 0;
}

body.ppcc-cart .ppcc-lumise-details__separator {
    display: inline-block;
    flex: 0 0 auto;
    margin: 0 1px;
    color: var(--ppcc-muted);
}

body.ppcc-cart .ppcc-lumise-details .ppcc-edit-design {
    min-height: 36px !important;
    margin: 0 !important;
    padding: 7px 12px !important;
    flex: 0 0 auto;
}

/* The Store API line_total is the authoritative per-row total. JS matches the
 * row by its design-specific image URL, never by array position, so React may
 * reorder/re-render without a total jumping onto another design. */
body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell {
    display: table-cell !important;
    width: 112px !important;
    min-width: 96px !important;
    padding-left: 14px !important;
    padding-right: 0 !important;
    vertical-align: middle !important;
    text-align: right !important;
    white-space: nowrap !important;
}

body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell > * {
    display: none !important;
}

body.ppcc-cart td.wc-block-cart-item__total.ppcc-line-total-cell::after {
    content: attr(data-ppcc-line-total) !important;
    display: inline-block !important;
    width: 100%;
    margin: 0;
    padding: 0;
    color: var(--ppcc-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-align: right;
    white-space: nowrap;
}

/* Do not let the row collapse to a compact product-only layout between Store API
 * state and DOM reconciliation. The metadata supplied server-side normally keeps
 * this height; this is only a visual floor for the brief transition frame. */
body.ppcc-cart .wc-block-cart-items__row.ppcc-lumise-row .wc-block-cart-item__product {
    min-height: 148px;
}

@media (max-width: 600px) {
    body.ppcc-cart .ppcc-lumise-details {
        font-size: 12px;
    }

    body.ppcc-cart .wc-block-cart-items__row.ppcc-lumise-row .wc-block-cart-item__product {
        min-height: 0;
    }
}


/* ---------- PPCC 1.0.15: stable row geometry + authoritative flexible pricing ---------- */
/* During a Cart Block quantity request React briefly replaces the row contents.
 * Keep the desktop table geometry fixed through that transition instead of letting
 * the whole cart jump to a shorter layout for one or two frames. */
@media (min-width: 601px) {
    body.ppcc-cart .wc-block-cart-items tbody tr.wc-block-cart-items__row {
        height: 192px !important;
    }

    body.ppcc-cart .wc-block-cart-items tbody tr.wc-block-cart-items__row > td {
        box-sizing: border-box !important;
    }

    body.ppcc-cart .wc-block-cart-items__row .wc-block-cart-item__product {
        min-height: 148px !important;
    }
}

/* When the canonical Tiered Pricing rule has loaded, paint the current unit
 * price without replacing React-owned child nodes. The data attribute is updated
 * after every Store API quantity change and uses the same flexible-price source
 * as the product/Lumise editor. */
body.ppcc-cart .wc-block-components-product-price.ppcc-authoritative-unit-price {
    font-size: 0 !important;
    line-height: 1.35 !important;
}

body.ppcc-cart .wc-block-components-product-price.ppcc-authoritative-unit-price::after {
    content: attr(data-ppcc-unit-price);
    display: inline;
    color: var(--ppcc-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}


/* WooCommerce Blocks groups parcel shops with pickup methods. Keep the native
   integration and label the two modes according to what customers can choose. */
body.ppcc-checkout #shipping-method .wc-block-checkout__shipping-method-option-title {
    font-size: 0;
}

body.ppcc-checkout #shipping-method .wc-block-checkout__shipping-method-option:first-child
.wc-block-checkout__shipping-method-option-title::after {
    content: 'Házhozszállítás';
    font-size: 16px;
}

body.ppcc-checkout #shipping-method .wc-block-checkout__shipping-method-option:nth-child(2)
.wc-block-checkout__shipping-method-option-title::after {
    content: 'Átvételi pontok';
    font-size: 16px;
}


/* ---------- PPCC 1.0.18: stable checkout navigation + header ---------- */
.ppcc-checkout #masthead,
.ppcc-checkout .site-header,
.ppcc-checkout .elementor-location-header,
.ppcc-checkout [data-elementor-type="header"],
.ppcc-checkout header#site-header,
.ppcc-checkout header.main-header,
.ppcc-checkout [role="banner"],
.ppcc-checkout .wp-site-blocks > header,
.ppcc-checkout header.wp-block-template-part {
    display: none !important;
}

/* Translate the Blocks CTA without replacing React-owned text nodes. */
.ppcc-cart .ppcc-cart-checkout-alt-label {
    font-size: 0 !important;
}
.ppcc-cart .ppcc-cart-checkout-alt-label::after {
    content: "Tovább az egyéb fizetési módokhoz";
    font-size: 16px;
}


/* ---------- PPCC 1.0.19: storefront-style empty cart ---------- */
body.ppcc-cart.ppcc-empty-cart #content.site-main {
    width: min(1140px, calc(100% - 48px));
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 0 88px;
}

body.ppcc-cart.ppcc-empty-cart #content > .page-header {
    margin: 0;
    padding: 72px 0 42px;
}

body.ppcc-cart.ppcc-empty-cart #content > .page-header .entry-title {
    margin: 0;
    color: #17120e;
    font-size: clamp(44px, 5vw, 58px);
    font-weight: 800;
    line-height: .98;
    letter-spacing: -.035em;
}

body.ppcc-cart.ppcc-empty-cart .page-content {
    margin: 0;
}

body.ppcc-cart.ppcc-empty-cart .wp-block-woocommerce-empty-cart-block {
    margin: 0;
    padding: clamp(28px, 5vw, 54px);
    border: 1px solid var(--ppcc-border);
    border-radius: 24px;
    background: linear-gradient(145deg, #fff 0%, var(--ppcc-surface-soft) 100%);
    box-shadow: 0 20px 55px rgba(80, 54, 33, .08);
}

body.ppcc-cart.ppcc-empty-cart .wc-block-cart__empty-cart__title {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding: 72px 0 0;
    color: var(--ppcc-text);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.025em;
}

body.ppcc-cart.ppcc-empty-cart .wc-block-cart__empty-cart__title::before {
    content: '♡';
    position: absolute;
    inset: 0 auto auto 50%;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    transform: translateX(-50%);
    border: 1px solid #d8c2ad;
    border-radius: 50%;
    background: #fff;
    color: var(--ppcc-primary);
    font: 400 30px/1 Georgia, serif;
    box-shadow: 0 9px 24px rgba(80, 54, 33, .09);
}


body.ppcc-cart.ppcc-empty-cart .wp-block-separator.is-style-dots {
    width: 72px;
    height: 1px;
    margin: 32px auto;
    border: 0;
    background: var(--ppcc-border-strong);
}

body.ppcc-cart.ppcc-empty-cart .wp-block-separator.is-style-dots::before {
    content: none;
}

body.ppcc-cart.ppcc-empty-cart .wp-block-woocommerce-empty-cart-block > .wp-block-heading:not(.wc-block-cart__empty-cart__title) {
    margin: 0 0 30px;
    color: var(--ppcc-text);
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    text-align: left !important;
}

body.ppcc-cart.ppcc-empty-cart .wc-block-grid__products {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0 !important;
}

body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16px 16px 18px !important;
    border: 1px solid var(--ppcc-border) !important;
    border-radius: 16px;
    background: #fff;
    text-align: left;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product:hover {
    transform: translateY(-3px);
    border-color: var(--ppcc-border-strong) !important;
    box-shadow: 0 14px 30px rgba(80, 54, 33, .1);
}

body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-image {
    margin: 0 0 18px !important;
    overflow: hidden;
    border-radius: 11px;
    background: #fbf7f2;
}

body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-image img {
    display: block;
    width: 100% !important;
    aspect-ratio: 1;
    object-fit: contain;
}

body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-title {
    min-height: 2.7em;
    margin: 0 !important;
    color: var(--ppcc-primary-hover);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.35;
}

body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-price {
    margin: 10px 0 16px !important;
    color: var(--ppcc-text);
    font-size: 15px;
    font-weight: 700;
}

body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-add-to-cart {
    margin: 0 !important;
}

body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-add-to-cart .wp-block-button__link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 10px 17px;
    border: 1px solid var(--ppcc-primary) !important;
    border-radius: 999px;
    background: var(--ppcc-primary) !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.15;
    text-decoration: none;
}

body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-add-to-cart .wp-block-button__link:hover,
body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-add-to-cart .wp-block-button__link:focus-visible {
    border-color: var(--ppcc-primary-hover) !important;
    background: var(--ppcc-primary-hover) !important;
}

@media (max-width: 760px) {
    body.ppcc-cart.ppcc-empty-cart #content.site-main {
        width: min(100% - 28px, 1140px);
        padding-bottom: 54px;
    }

    body.ppcc-cart.ppcc-empty-cart #content > .page-header {
        padding: 42px 0 28px;
    }

    body.ppcc-cart.ppcc-empty-cart .wp-block-woocommerce-empty-cart-block {
        padding: 24px 16px 28px;
        border-radius: 18px;
    }

    body.ppcc-cart.ppcc-empty-cart .wc-block-grid__products {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        column-gap: 16px;
        align-items: start;
    }

    body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-link {
        display: contents;
    }

    body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-image {
        grid-row: 1 / span 3;
        margin: 0 !important;
    }

    body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-title {
        min-height: 0;
    }

    body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-price,
    body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product-add-to-cart {
        grid-column: 2;
    }
}

@media (max-width: 390px) {
    body.ppcc-cart.ppcc-empty-cart .wc-block-grid__product {
        grid-template-columns: 88px minmax(0, 1fr);
        padding: 13px !important;
    }
}


/* Keep the WooCommerce alignwide wrapper inside the mobile page gutter. */
body.ppcc-cart.ppcc-empty-cart .wp-block-woocommerce-cart.alignwide {
    width: 100%;
    max-width: none;
    margin-right: 0 !important;
    margin-left: 0 !important;
}


/* ---------- PPCC 1.0.23: keep the filled cart inside the page gutters ---------- */
body.ppcc-cart:not(.ppcc-empty-cart) .wp-block-woocommerce-cart.alignwide {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

/* ---------- PPCC 1.0.25: cart copy and responsive Lumise details ---------- */
/* The row total already appears in the right-hand ÖSSZESEN column. Do not show
 * a second unit-price line under the product name. */
body.ppcc-cart .wc-block-cart-item__product .wc-block-components-product-price,
body.ppcc-cart .wc-block-cart-item__product .price {
    display: none !important;
}

/* Keep the metadata separator on desktop, but remove it on narrow phones. */
@media (max-width: 600px) {
    body.ppcc-cart .ppcc-lumise-details__separator {
        display: none !important;
    }
}

/* The cart has one clear primary action. Cancel the former alternative-label
 * pseudo-element and show WooCommerce's native Hungarian checkout label only. */
body.ppcc-cart .wc-block-cart__submit-button,
body.ppcc-cart .wc-block-cart__submit-button.ppcc-cart-checkout-alt-label {
    font-size: 16px !important;
}

body.ppcc-cart .wc-block-cart__submit-button.ppcc-cart-checkout-alt-label::after {
    content: none !important;
    display: none !important;
}

/* 1.0.28: native Blocks rows, compact summary and touch-safe controls. */
body.ppcc-cart .wc-block-components-product-metadata__description,
body.ppcc-checkout .wc-block-components-product-metadata__description {
    display: none;
}
body.ppcc-cart .wc-block-cart-item__remove-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    padding: 10px !important;
}
body.ppcc-cart .lumise-edit-design,
body.ppcc-cart .ppcc-edit-design {
    min-height: 44px !important;
    display: inline-flex;
    align-items: center;
    padding: 10px 12px !important;
    box-sizing: border-box;
}
.ppcc-continue-shopping { display: inline-flex; padding: 12px 0; font-size: 14px; }
.ppcc-design-information { padding: 12px 0; border-top: 1px solid var(--ppcc-border); }
.ppcc-design-information summary { cursor: pointer; min-height: 44px; display: list-item; padding-top: 10px; }
.ppcc-design-information__item { padding: 10px 0; font-size: 13px; }
.ppcc-design-information__item p { margin: 5px 0; }
body.ppcc-checkout .wc-block-components-order-summary-item { padding-block: 12px !important; margin: 0 !important; }
body.ppcc-checkout .wc-block-components-order-summary-item__description { min-width: 0; }
body.ppcc-checkout .wc-block-components-order-summary-item .wc-block-components-product-metadata,
body.ppcc-checkout .wc-block-components-order-summary-item__individual-prices { display: none !important; }
body.ppcc-checkout .wc-block-components-order-summary-item .wc-block-components-product-name { font-size: 14px; line-height: 1.35; }
body.ppcc-checkout .wc-block-components-order-summary-item__image { width: 56px !important; height: 56px !important; }
/* Hide only the redundant trailing currency code, retaining the native amount. */
body.ppcc-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
body.ppcc-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value { font-size: 0; }
body.ppcc-cart .wc-block-components-totals-footer-item .wc-block-formatted-money-amount,
body.ppcc-checkout .wc-block-components-totals-footer-item .wc-block-formatted-money-amount { font-size: 20px; }
@media (max-width: 600px) {
    body.ppcc-cart .wc-block-cart-items,
    body.ppcc-cart .wc-block-cart-items tbody { display: block !important; width: 100% !important; min-width: 0 !important; }
    body.ppcc-cart .wc-block-cart-items thead { display: none; }
    body.ppcc-cart .wc-block-cart-items tbody tr.wc-block-cart-items__row {
        display: grid !important;
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 10px 12px;
        width: 100% !important;
        padding: 18px 0 !important;
        box-sizing: border-box;
    }
    body.ppcc-cart .wc-block-cart-items tbody td.wc-block-cart-item__image { grid-column: 1; grid-row: 1 / 3; width: auto !important; padding: 0 !important; }
    body.ppcc-cart .wc-block-cart-items tbody td.wc-block-cart-item__product { grid-column: 2; grid-row: 1; width: auto !important; min-width: 0 !important; padding: 0 !important; }
    body.ppcc-cart .wc-block-cart-items tbody td.wc-block-cart-item__total { grid-column: 2; grid-row: 2; display: block !important; width: auto !important; min-width: 0 !important; padding: 0 !important; text-align: right !important; }
    body.ppcc-cart .wc-block-cart-item__wrap,
    body.ppcc-cart .wc-block-components-product-metadata { min-width: 0; width: 100%; }
    body.ppcc-cart .wc-block-components-product-name { overflow-wrap: anywhere; }
    body.ppcc-cart .wc-block-cart-item__quantity { display: flex !important; flex-wrap: wrap; gap: 8px; }
    body.ppcc-cart .wc-block-components-product-details [aria-hidden="true"] { display: none; }
    body.ppcc-cart .wc-block-components-product-details > span { display: block; }
    body.ppcc-cart .wc-block-components-quantity-selector { height: 44px !important; }
    body.ppcc-cart .wc-block-components-quantity-selector__button { height: 44px !important; }
    /* A real flow spacer leaves the fixed reCAPTCHA badge unobscured. Attribution
       stays visible: no hiding the badge or disabling CAPTCHA protection. */
    body.ppcc-cart .wc-block-cart__submit-container { margin-bottom: 90px !important; bottom: 80px !important; }
    body.ppcc-cart .wc-block-cart__submit-container--sticky { margin-bottom: 0 !important; }
    body.ppcc-checkout .wc-block-checkout__actions { margin-bottom: 90px !important; }
}
