/*
 * Copyright (c) 2026 Conscious Industries Irrevocable Trust.
 * All rights reserved.
 */

/* Organic Store compatibility adapter.
 *
 * The theme keeps ownership of the site shell. This adapter only repairs the
 * classic WooCommerce cart/checkout density and the Suite's final-submit
 * group when Organic Store (or an Organic Store child theme) is active. */

body.pma-theme-organic-store.woocommerce-checkout #payment .form-row.place-order {
    box-sizing: border-box;
    display: flow-root;
    padding-top: 14px;
}

body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-checkout-privacy,
body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-assent-card,
body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-returning-member-assent-card {
    float: none;
    margin: 0 0 12px;
}

body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-checkout-privacy {
    padding: 12px 14px;
    font-size: .9em;
    line-height: 1.45;
}

body.pma-theme-organic-store.woocommerce-checkout #payment #place_order {
    box-sizing: border-box;
    float: none;
    width: 100%;
    min-height: 48px;
    margin: 0;
}

@media (max-width: 767px) {
    /* Remove the theme's commerce-only spacer/padding without changing normal pages. */
    body.pma-theme-organic-store.woocommerce-cart .wp-site-blocks :where(main, div).wp-block-group.alignfull.has-global-padding:has(> .woocommerce),
    body.pma-theme-organic-store.woocommerce-checkout .wp-site-blocks :where(main, div).wp-block-group.alignfull.has-global-padding:has(> .woocommerce) {
        --wp--style--block-gap: 0px;
        padding-top: 18px !important;
        padding-bottom: 14px !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .wp-site-blocks :where(main, div).wp-block-group.alignfull.has-global-padding:has(> .woocommerce) > .wp-block-spacer:first-child,
    body.pma-theme-organic-store.woocommerce-checkout .wp-site-blocks :where(main, div).wp-block-group.alignfull.has-global-padding:has(> .woocommerce) > .wp-block-spacer:first-child {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
    }

    /* Cart items become compact, readable cards instead of six stacked rows. */
    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form table.shop_table_responsive tbody {
        display: grid;
        gap: 10px;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form table.shop_table_responsive tr.cart_item {
        box-sizing: border-box;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "name remove"
            "price subtotal"
            "quantity quantity";
        gap: 8px 12px;
        margin: 0;
        padding: 12px;
        border: 1px solid #a87845;
        border-top: 4px solid #74451f;
        border-radius: 12px;
        background:
            linear-gradient(90deg, rgba(116, 69, 31, .035) 0 18%, transparent 18% 52%, rgba(116, 69, 31, .025) 52% 76%, transparent 76%),
            linear-gradient(180deg, #fffdf5 0%, #fbf3df 100%);
        box-shadow: inset 0 1px 0 #f2d99f, 0 2px 8px rgba(57, 42, 19, .09);
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form table.shop_table_responsive tr.cart_item td {
        box-sizing: border-box;
        width: auto !important;
        min-height: 0;
        padding: 0 !important;
        border: 0 !important;
        text-align: left !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-thumbnail {
        display: none !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-name {
        grid-area: name;
        align-self: center;
        display: block !important;
        padding-right: 4px !important;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-name,
    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-name a {
        color: #173c2b;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-remove {
        grid-area: remove;
        align-self: start;
        display: flex !important;
        justify-content: flex-end;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-remove a.remove {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 1px solid rgba(116, 69, 31, .42);
        border-radius: 50%;
        color: #8e2f28 !important;
        background: #fffaf0;
        font-size: 24px;
        line-height: 1;
        text-decoration: none;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-price,
    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-subtotal,
    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-quantity {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-price {
        grid-area: price;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-subtotal {
        grid-area: subtotal;
        justify-content: flex-end;
        font-weight: 700;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-quantity {
        grid-area: quantity;
        justify-content: space-between;
        padding-top: 7px !important;
        border-top: 1px solid rgba(116, 69, 31, .28) !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form tr.cart_item td::before {
        float: none !important;
        margin: 0;
        color: #5c482f;
        font-size: 11px;
        font-weight: 800;
        line-height: 1.2;
        letter-spacing: .05em;
        text-transform: uppercase;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-remove::before,
    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-thumbnail::before,
    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-name::before {
        content: none !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-price::before {
        content: "Each" !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-quantity::before {
        content: "Quantity" !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-subtotal::before {
        content: "Total" !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-quantity .quantity {
        display: inline-flex;
        width: auto;
        margin: 0;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.product-quantity input.qty {
        box-sizing: border-box;
        width: 72px;
        min-height: 40px;
        margin: 0;
        padding: 6px 8px;
        text-align: center;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form table.shop_table_responsive tr.cart_item:has(.pma-membership-fee-required) {
        grid-template-areas:
            "name subtotal"
            "remove remove";
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form tr.cart_item:has(.pma-membership-fee-required) td.product-price,
    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form tr.cart_item:has(.pma-membership-fee-required) td.product-quantity {
        display: none !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form .pma-membership-fee-required {
        display: block;
        width: 100%;
        padding-top: 7px;
        border-top: 1px solid rgba(116, 69, 31, .28);
        color: #315f37;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.3;
        text-align: left;
    }

    /* Coupon and update controls stay touch-friendly without consuming a card. */
    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.actions {
        box-sizing: border-box;
        display: grid !important;
        gap: 8px;
        width: 100% !important;
        min-height: 0;
        padding: 10px 8px 0 !important;
        border: 0 !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.actions .coupon {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        width: 100%;
        margin: 0 !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.actions .coupon > .screen-reader-text {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        margin: -1px !important;
        padding: 0 !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.actions .coupon input.input-text,
    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.actions .coupon button,
    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.actions button[name="update_cart"] {
        box-sizing: border-box;
        width: 100% !important;
        min-height: 42px;
        margin: 0 !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.actions .coupon input[name="coupon_code"] {
        grid-row: 1;
        grid-column: 1;
        float: none !important;
        height: 42px;
        padding-right: 11px;
        padding-left: 11px;
        border-color: #a87845;
        border-radius: 8px;
        background: #fffdf5;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.actions .coupon button[name="apply_coupon"] {
        grid-row: 1;
        grid-column: 2;
        float: none !important;
        height: 42px;
    }

    body.pma-theme-organic-store.woocommerce-cart .woocommerce-cart-form td.actions button[name="update_cart"] {
        justify-self: stretch;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals {
        margin-top: 14px;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals {
        width: 100%;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals h2 {
        margin: 0 4px 9px;
        color: #173c2b;
        font-size: 22px;
        font-weight: 800;
        line-height: 1.2;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals table.shop_table {
        overflow: hidden;
        border: 1px solid #a87845 !important;
        border-top: 4px solid #74451f !important;
        border-radius: 12px;
        background: #fffaf0;
        border-collapse: separate;
        border-spacing: 0;
        box-shadow: inset 0 1px 0 #f2d99f, 0 2px 8px rgba(57, 42, 19, .08);
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr {
        display: grid !important;
        grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px;
        border-bottom: 1px solid rgba(116, 69, 31, .24);
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals table.shop_table th,
    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals table.shop_table td {
        display: block !important;
        width: auto !important;
        padding: 0 !important;
        border: 0 !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals table.shop_table td {
        text-align: right !important;
        color: #2f281e;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals table.shop_table th {
        color: #173c2b;
        font-weight: 800;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals table.shop_table td::before {
        content: none !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr.shipping {
        grid-template-columns: 1fr;
        gap: 5px;
        background: rgba(23, 60, 43, .035);
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr.shipping td {
        text-align: left !important;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .woocommerce-shipping-methods {
        margin: 0;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .woocommerce-shipping-methods li {
        margin: 0 0 6px;
        line-height: 1.35;
    }

    body.pma-theme-organic-store.woocommerce-cart .cart-collaterals .cart_totals table.shop_table tr.order-total {
        border-bottom: 0;
        background: linear-gradient(90deg, rgba(243, 201, 106, .16), rgba(23, 60, 43, .045));
    }

    body.pma-theme-organic-store.woocommerce-cart .wc-proceed-to-checkout {
        padding-top: 10px;
    }

    body.pma-theme-organic-store.woocommerce-cart .wc-proceed-to-checkout .rj-hvhc-cart-disclosure {
        margin: 0 0 10px;
        padding: 11px 12px;
        font-size: 13px;
        line-height: 1.42;
    }

    body.pma-theme-organic-store.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
        box-sizing: border-box;
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-height: 46px;
        margin: 0;
        padding: 11px 16px;
        font-size: 16px;
        line-height: 1.2 !important;
        text-align: center;
    }

    /* Checkout retains every field while carrying the cart's wood/parchment
       hierarchy through the final review. */
    body.pma-theme-organic-store.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info,
    body.pma-theme-organic-store.woocommerce-checkout form.checkout_coupon {
        box-sizing: border-box;
        border: 1px solid #a87845;
        border-top: 4px solid #74451f;
        border-radius: 12px;
        color: #173c2b;
        background:
            linear-gradient(90deg, rgba(116, 69, 31, .035) 0 18%, transparent 18% 52%, rgba(116, 69, 31, .025) 52% 76%, transparent 76%),
            linear-gradient(180deg, #fffdf5 0%, #fbf3df 100%);
        box-shadow: inset 0 1px 0 #f2d99f, 0 2px 8px rgba(57, 42, 19, .09);
    }

    body.pma-theme-organic-store.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info {
        margin-bottom: 12px;
        padding: 11px 12px;
        font-size: 13px;
        line-height: 1.42;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout_coupon {
        margin: 0 0 12px;
        padding: 12px;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout h3,
    body.pma-theme-organic-store.woocommerce-checkout form.checkout .woocommerce-billing-fields > h3,
    body.pma-theme-organic-store.woocommerce-checkout form.checkout .woocommerce-additional-fields > h3 {
        margin-top: 0;
        margin-bottom: 10px;
        color: #173c2b;
        font-size: 22px;
        line-height: 1.2;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details .col-1,
    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details .col-2 {
        box-sizing: border-box;
        margin-bottom: 14px;
        padding: 12px;
        border: 1px solid #a87845;
        border-top: 4px solid #74451f;
        border-radius: 12px;
        background:
            linear-gradient(90deg, rgba(116, 69, 31, .035) 0 18%, transparent 18% 52%, rgba(116, 69, 31, .025) 52% 76%, transparent 76%),
            linear-gradient(180deg, #fffdf5 0%, #fbf3df 100%);
        box-shadow: inset 0 1px 0 #f2d99f, 0 2px 8px rgba(57, 42, 19, .09);
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details .form-row {
        margin-bottom: 4px;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details .form-row > label {
        margin-bottom: 3px;
        font-size: 13px;
        line-height: 1.25;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details input.input-text,
    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details select,
    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details textarea {
        box-sizing: border-box;
        min-height: 42px;
        padding: 8px 10px;
        font-size: 15px;
        line-height: 1.3;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details textarea {
        min-height: 72px;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details .select2-container .select2-selection--single {
        min-height: 42px;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details .select2-container .select2-selection--single .select2-selection__rendered {
        line-height: 40px;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #customer_details .select2-container .select2-selection--single .select2-selection__arrow {
        height: 40px;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #order_review_heading {
        margin: 8px 0 10px;
        color: #173c2b;
        font-size: 22px;
        font-weight: 800;
        line-height: 1.2;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #order_review table.shop_table {
        overflow: hidden;
        margin-bottom: 14px;
        border: 1px solid #a87845 !important;
        border-top: 4px solid #74451f !important;
        border-radius: 12px;
        background: #fffaf0;
        border-collapse: separate;
        border-spacing: 0;
        box-shadow: inset 0 1px 0 #f2d99f, 0 2px 8px rgba(57, 42, 19, .08);
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #order_review table.shop_table th,
    body.pma-theme-organic-store.woocommerce-checkout form.checkout #order_review table.shop_table td {
        padding: 7px 8px;
        border-color: rgba(116, 69, 31, .24);
        font-size: 13px;
        line-height: 1.35;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #order_review table.shop_table thead th {
        color: #173c2b;
        background: rgba(243, 201, 106, .14);
        font-weight: 800;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #order_review table.shop_table tbody tr:nth-child(even) td {
        background: rgba(23, 60, 43, .035);
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #order_review table.shop_table tfoot tr.order-total th,
    body.pma-theme-organic-store.woocommerce-checkout form.checkout #order_review table.shop_table tfoot tr.order-total td {
        color: #173c2b;
        background: linear-gradient(90deg, rgba(243, 201, 106, .16), rgba(23, 60, 43, .045));
        font-weight: 800;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #payment {
        overflow: hidden;
        margin: 0 0 8px;
        border: 1px solid #a87845;
        border-top: 4px solid #74451f;
        border-radius: 12px;
        background: #fffaf0 !important;
        box-shadow: inset 0 1px 0 #f2d99f, 0 2px 8px rgba(57, 42, 19, .09);
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #payment ul.payment_methods {
        margin: 0;
        padding: 12px;
        border-bottom-color: rgba(116, 69, 31, .28);
        background: rgba(23, 60, 43, .035);
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #payment ul.payment_methods li {
        margin: 0 0 8px;
        line-height: 1.35;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #payment ul.payment_methods li + li {
        padding-top: 8px;
        border-top: 1px solid rgba(116, 69, 31, .2);
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #payment .payment_box {
        margin: 7px 0 10px;
        padding: 10px 12px;
        border: 1px solid rgba(116, 69, 31, .2);
        border-radius: 8px;
        color: #384238;
        background: #f5f1e6;
        font-size: 13px;
        line-height: 1.4;
    }

    body.pma-theme-organic-store.woocommerce-checkout form.checkout #payment .payment_box::before {
        border-bottom-color: #f5f1e6;
    }

    body.pma-theme-organic-store.woocommerce-checkout #payment .form-row.place-order {
        padding: 12px;
        background: #fffaf0;
    }

    body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-checkout-privacy,
    body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-assent-card,
    body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-returning-member-assent-card {
        padding: 11px 12px;
        border: 1px solid rgba(116, 69, 31, .3);
        border-left: 4px solid #318f43;
        border-radius: 8px;
        background: linear-gradient(180deg, #fffdf5, #fbf3df);
        box-shadow: 0 1px 4px rgba(57, 42, 19, .06);
        font-size: 13px;
        line-height: 1.42;
    }

    body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-assent-heading {
        margin-bottom: 6px;
        font-size: 14px;
        line-height: 1.3;
    }

    body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-assent-row label,
    body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-returning-member-assent-row label {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: start;
        gap: 0 7px;
        font-weight: 400;
        line-height: 1.42;
    }

    body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-assent-row input[type="checkbox"],
    body.pma-theme-organic-store.woocommerce-checkout #payment .rj-hvhc-returning-member-assent-row input[type="checkbox"] {
        margin: 3px 0 0 !important;
    }

    body.pma-theme-organic-store.woocommerce-checkout #payment #place_order {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 11px 16px;
        line-height: 1.2 !important;
        text-align: center;
    }
}
