/* 2.2.2. Activate only after recognizing a supported component. */
body.csp-side-cart-ready .csp-owned-legacy-cart-panel { display: none !important; }
.csp-product-gallery-enhanced { position: relative; min-width: 0; }
.csp-gallery-button-only .woocommerce-product-gallery__trigger { display: none !important; }
.csp-gallery-button-only .csp-native-gallery-nav { display: none !important; }
.csp-gallery-button-only a[data-csp-image-url] { cursor: default; }
.csp-product-gallery-enhanced > .csp-gallery-thumbs {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
    gap: 10px; width: 100%; max-width: 100%; min-width: 0;
    margin: 16px 0 0; padding: 4px; grid-column: 1 / -1; flex-basis: 100%; box-sizing: border-box;
}
.csp-gallery-thumbs .csp-gallery-thumb {
    display: block; padding: 4px; margin: 0; width: 100%; min-width: 0; height: 80px;
    border: 1px solid #d9cce0; border-radius: 8px; background: #fff; cursor: pointer;
    box-sizing: border-box; overflow: hidden; box-shadow: none; opacity: 1;
}
.csp-gallery-thumbs .csp-gallery-thumb img {
    display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%;
    object-fit: contain; opacity: 1; pointer-events: none;
}
.csp-gallery-thumbs .csp-gallery-thumb[aria-pressed="true"] { border: 2px solid #5a1f70; }
.csp-gallery-thumbs .csp-gallery-thumb:focus-visible { outline: 2px solid #5a1f70; outline-offset: 2px; }
#csp-fn-modal .csp-fn-counter { direction: ltr; unicode-bidi: isolate; }
#csp-fn-modal .csp-fn-thumbs-inner { overflow-x: hidden; }
.csp-btn-view-cart-page { display: block; text-align: center; margin-top: 10px; font-size: 13px; text-decoration: underline; }

/* The ID in :is also matches Bricks' main element; the marked scope covers standard WooCommerce.
   Specificity intentionally beats CSS from the old supplied Bricks cart template, without editing it. */
body.woocommerce-cart.csp-cart-layout-fixed .csp-cart-scope {
    display: block !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important;
}
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) .woocommerce-cart-form,
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) .cart-collaterals {
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    float: none !important; position: static !important; margin: 0 0 24px !important;
    box-sizing: border-box !important;
}
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table {
    table-layout: auto !important; width: 100% !important; border-collapse: separate !important;
    border-spacing: 0 !important; background: #fff !important; border: 1px solid #eadfeb !important;
    border-radius: 12px !important; margin: 0 0 20px !important; max-width: 100% !important;
}
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table th,
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td {
    padding: 14px 10px !important; min-width: 0 !important; max-width: none !important;
    width: auto !important; border: 0 !important; border-bottom: 1px solid #eee5ef !important;
    vertical-align: middle !important; white-space: normal !important; text-align: start !important;
    box-sizing: border-box !important;
}
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.product-name {
    overflow-wrap: anywhere !important; word-break: normal !important; line-height: 1.6 !important;
}
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.product-name a {
    color: #302036 !important; font-size: 14px !important; white-space: normal !important; overflow-wrap: anywhere !important;
}
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table .product-thumbnail img {
    display: block !important; width: 64px !important; height: 64px !important;
    min-width: 0 !important; object-fit: contain !important; border-radius: 8px !important;
}
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table input.qty {
    width: 56px !important; min-width: 0 !important; height: 40px !important; text-align: center !important;
}
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table .quantity { display: inline-flex; align-items: center; max-width: 100%; }
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.actions .coupon {
    display: flex !important; gap: 8px !important; flex-wrap: wrap !important; align-items: center !important; float: none !important;
}
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table .coupon input.input-text { min-width: 0 !important; width: auto !important; max-width: 100% !important; flex: 1 1 150px; }
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) .cart_totals {
    width: 100% !important; max-width: 560px !important; min-width: 0 !important;
    margin-inline-start: auto !important; padding: 20px !important; background: #fff !important;
    border: 1px solid #eadfeb !important; border-radius: 12px !important; box-sizing: border-box !important;
}
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) .cart_totals table { width: 100% !important; table-layout: auto !important; }
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) .cart_totals th,
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) .cart_totals td { padding: 10px 6px !important; min-width: 0 !important; overflow-wrap: anywhere; }
body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) .checkout-button {
    display: block !important; width: 100% !important; padding: 14px !important;
    color: #fff !important; background: #5a1f70 !important; border-radius: 10px !important;
    text-align: center !important; box-sizing: border-box !important;
}
@media (max-width: 767px) {
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table,
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table tbody { display: block !important; width: 100% !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table thead { display: none !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table tr.cart_item {
        display: grid !important; grid-template-columns: 56px minmax(0,1fr) 28px !important;
        grid-template-rows: auto auto auto !important; gap: 8px !important;
        padding: 12px !important; margin: 0 !important; width: 100% !important;
        box-sizing: border-box !important; align-items: start !important; border-bottom: 1px solid #eadfeb !important;
    }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td {
        display: block !important; padding: 0 !important; border: 0 !important; margin: 0 !important;
        min-width: 0 !important; width: auto !important; white-space: normal !important;
    }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td::before { display: none !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.product-thumbnail { grid-column: 1 !important; grid-row: 1 / 3 !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table .product-thumbnail img { width: 56px !important; height: 56px !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.product-name { grid-column: 2 !important; grid-row: 1 !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.product-remove { grid-column: 3 !important; grid-row: 1 !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.product-remove a { width: 26px !important; height: 26px !important; display: inline-flex !important; align-items: center; justify-content: center; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.product-price { display: none !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.product-quantity { grid-column: 2 / 4 !important; grid-row: 2 !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.product-subtotal { grid-column: 1 / 4 !important; grid-row: 3 !important; text-align: end !important; overflow-wrap: anywhere !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table tr:not(.cart_item) { display: block !important; padding: 12px !important; box-sizing: border-box !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.actions { width: 100% !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.actions .coupon { flex-direction: column !important; }
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.actions input.input-text,
    body.woocommerce-cart.csp-cart-layout-fixed :is(#brx-content, .csp-cart-scope) table.csp-cart-table td.actions button { width: 100% !important; max-width: 100% !important; min-width: 0 !important; flex: none !important; min-height: 42px !important; margin: 4px 0 !important; }
}
.csp-registration-verification { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; width: 100%; margin: 10px 0 18px; }
.csp-registration-verification .csp-registration-send { background: #5a1f70; color: #fff; border: 0; padding: 10px 16px; border-radius: 8px; cursor: pointer; }
.csp-registration-verification .csp-registration-send:disabled { opacity: .6; cursor: wait; }
.csp-registration-status { display: block; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#csp-otp-modal .csp-otp-inputs-row { direction: ltr; }
#csp-otp-modal .csp-otp-feedback { overflow-wrap: anywhere; }
@media (max-width: 400px) {
    #csp-otp-modal .csp-otp-dialog { padding: 18px 12px; max-width: calc(100vw - 24px); box-sizing: border-box; }
    #csp-otp-modal .csp-otp-inputs-row { gap: 5px; }
    #csp-otp-modal .csp-otp-digit { min-width: 0; width: 36px; height: 44px; padding: 0; }
}
