/* Legacy checkout presentation only. Desktop and checkout state remain unchanged. */
@media (max-width: 768px) {
    #checkout-page { color: #303640; font-size: 14px; line-height: 1.5; }
    #checkout-page .entry-content { width: auto; max-width: 100%; margin: 0 12px; }
    #checkout-page .checkout-container { width: 100%; max-width: 100%; margin: 20px 0 32px; }
    #checkout-page *, #checkout-page *::before, #checkout-page *::after { box-sizing: border-box; }
    #checkout-page #cart-list h2.top-title { margin: 0 0 14px; padding: 0; text-align: left; font-size: 23px; }
    #checkout-page .cart-table, #checkout-page .cart-table tbody, #checkout-page .cart-table tfoot { display: block; width: 100%; border-spacing: 0; }
    #checkout-page .cart-table thead { display: none; }
    /* Respect rows hidden by the existing shipping/mounting/payment controls. */
    #checkout-page #cart-list .cart-table tr:not([hidden]):not([style*="display: none"]):not([style*="display:none"]) { display: grid !important; }
    #checkout-page #cart-list .cart-table td { width: auto; min-width: 0; padding: 8px 0; border: 0; white-space: normal !important; overflow-wrap: anywhere; text-align: left; }
    #checkout-page .cart-table td::before { position: static; display: block; float: none; width: auto; margin: 0 0 4px; padding: 0; content: attr(data-th); color: #68707c; font-size: 11px; font-weight: 500; }
    #checkout-page #cart-list [data-checkout-product] { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; margin: 14px 0 0; padding: 12px; border: 1px solid #e1e5eb; border-radius: 12px; background: #fff; }
    #checkout-page #cart-list [data-checkout-product] > .cart-list-table { display: grid !important; grid-template-columns: 70px minmax(0, 1fr); align-items: start; gap: 12px; grid-column: 1 / -1; padding: 0 0 8px; border-bottom: 1px solid #edf0f4; }
    #checkout-page .cart-list-table::before { display: none !important; }
    #checkout-page .cart-list-table > div:first-child { grid-column: 2; grid-row: 1; min-width: 0; }
    #checkout-page .cart-list-table > div:nth-child(2) { grid-column: 1; grid-row: 1; }
    #checkout-page #cart-list .cart-list-table h2 { margin: 0; padding: 0; font-size: 14px; line-height: 1.45; font-weight: 600; }
    #checkout-page #cart-list .cart-list-table h2 a { color: #252c38; }
    #checkout-page #cart-list .product-datas-list-img { display: block; float: none; width: 70px; height: 88px; max-width: 100%; margin: 0; object-fit: contain; }
    #checkout-page .bw-cart-identity { margin: 8px 0 0; padding: 6px; border-radius: 6px; }
    #checkout-page .bw-cart-heading { gap: 4px 6px; margin: 0; }
    #checkout-page .bw-cart-identity .bw-cart-badge { width: 40px; height: 29px; }
    #checkout-page .bw-cart-label, #checkout-page .bw-cart-dot { font-size: 10px; }
    #checkout-page .bw-cart-dot { padding: 2px 5px; }
    #checkout-page #cart-list [data-checkout-product] > td:nth-child(2) { display: block !important; grid-column: 1; grid-row: 2; }
    #checkout-page #cart-list [data-checkout-product] > td:nth-child(3),
    #checkout-page #cart-list [data-checkout-product] > td:nth-child(4),
    #checkout-page #cart-list [data-checkout-product] > td:nth-child(6) { display: none !important; }
    #checkout-page #cart-list [data-checkout-product] > td:nth-child(5) { display: block !important; grid-column: 2; grid-row: 2; text-align: right; }
    #checkout-page #cart-list [data-checkout-product] > td:nth-child(7) { display: block !important; grid-column: 1; grid-row: 3; border-top: 1px solid #edf0f4; }
    #checkout-page #cart-list [data-checkout-product] > td:last-child { display: flex !important; grid-column: 2; grid-row: 3; justify-content: flex-end; align-items: center; border-top: 1px solid #edf0f4; }
    #checkout-page .cart-table td:last-child::before { display: none; }
    #checkout-page #cart-list .product-stock-nr { height: auto; min-height: 44px; justify-content: flex-start; margin: 0; }
    #checkout-page #cart-list .product-stock-nr > label:empty { display: none; }
    #checkout-page #cart-list .product-stock-nr .myselect-style { width: 76px; height: 44px; line-height: normal; margin: 0; }
    #checkout-page #cart-list .stock-nr-to-sum { width: 100%; height: 44px; min-height: 44px; padding: 8px 10px !important; line-height: normal; font-size: 16px; }
    #checkout-page #cart-list .product-unit-tva { font-size: 18px; font-weight: 700; color: #c71920; }
    #checkout-page #cart-list .product-price-w-vat { font-size: 19px; font-weight: 700; color: #18218c; }
    #checkout-page .bw-cart-prices { margin-bottom: 4px; }
    #checkout-page .bw-cart-prices .bw-cart-price-caption { font-size: 10px; }
    #checkout-page .cart-product-delete { width: 24px; height: 24px; object-fit: contain; margin: 8px; }
    #checkout-page .cart-table :is(.delivery-row, .montaj-row) { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 8px 12px; background: #f7f8fb; border-radius: 8px; font-size: 12px; }
    #checkout-page #cart-list .cart-table :is(.delivery-row, .montaj-row) > td { display: block !important; padding: 4px 0 !important; }
    #checkout-page #cart-list .cart-table :is(.delivery-row, .montaj-row) > td:first-child { grid-column: 1 / -1; }
    #checkout-page #cart-list .cart-table :is(.delivery-row, .montaj-row) > td[data-th]::before { display: block; }
    #checkout-page #cart-list .cart-table .montaj-row > td:nth-child(2),
    #checkout-page #cart-list .cart-table .montaj-row > td:nth-child(3),
    #checkout-page #cart-list .cart-table .montaj-row > td:nth-child(4),
    #checkout-page #cart-list .cart-table .montaj-row > td:nth-child(6),
    #checkout-page #cart-list .cart-table .montaj-row > td:nth-child(8) { display: none !important; }
    #checkout-page #cart-list .cart-table .montaj-row > td:nth-child(7) { text-align: right; }
    #checkout-page #cart-list .cart-table .montaj-row[data-has-montaj="0"] { opacity: .75 !important; }
    #checkout-page .cart-table .global-options-row { margin-top: 16px; }
    #checkout-page .global-options { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 12px !important; padding: 14px; border: 1px solid #e1e5eb; border-radius: 10px; background: #f7f8fb; }
    #checkout-page .global-options > * { width: 100%; min-width: 0; max-width: 100%; float: none; }
    #checkout-page .global-options > div { flex-direction: column; align-items: stretch !important; }
    #checkout-page .global-options > label { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
    #checkout-page .global-options input { flex: 0 0 auto; margin-top: 3px; }
    #checkout-page .service-location-select { flex-direction: column !important; margin: 0; align-items: stretch !important; gap: 6px !important; }
    #checkout-page .service-location-select :is(.myselect-style, form, select) { width: 100%; max-width: 100%; min-width: 0; }
    #checkout-page #cart-list .cart-table tfoot tr { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #e6e9ef; }
    #checkout-page #cart-list .cart-table tfoot td { grid-column: auto !important; font-size: 14px; padding: 0; }
    #checkout-page #cart-list .cart-table tfoot td:not(:first-child):not(:last-child) { display: none !important; }
    #checkout-page #cart-list .cart-table tfoot td:last-child { display: block !important; grid-column: auto !important; text-align: right; font-weight: 600; }
    #checkout-page .cart-table tfoot td::before { display: none; }
    #checkout-page #cart-list .cart-table .subtotal-row { margin-top: 8px; border-radius: 8px; border: 0; background: #edf3fa; }
    #checkout-page #cart-list .cart-table .subtotal-row td { font-size: 19px; font-weight: 700; color: #18218c; }
    #checkout-page #checkout-form { margin-top: 24px; }
    #checkout-page #checkout-form .checkout-steps-cont { width: 100%; margin: 0; padding: 0; }
    #checkout-page #checkout-form :is(.checkout-step1-cont, .checkout-step2-cont, .checkout-step3-cont) { float: none; width: 100%; margin: 0 0 16px; }
    #checkout-page #checkout-form :is(.checkout-box-white, .checkout-step1-cont-active, .checkout-step2-cont-active, .checkout-step3-cont-active, .checkout-step3-cont-inactive) { padding: 14px; border-radius: 10px; }
    #checkout-page #checkout-form .row { margin-left: 0; margin-right: 0; }
    #checkout-page #checkout-form :is(.col-15, .col-25) { float: none; width: 100% !important; padding: 0 !important; }
    #checkout-page #checkout-form :is(.general-info-line, .step1-form-inputs-line) { margin-bottom: 12px; }
    #checkout-page #checkout-form .general-info-label-address-popup { display: block; float: none; width: 100%; margin: 0 0 5px; }
    #checkout-page #checkout-form label { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
    #checkout-page #checkout-form :is(input[type=text], input[type=tel], input[type=email], input[type=password], select, textarea) { width: 100%; max-width: 100%; min-width: 0; min-height: 44px; padding: 10px; font-size: 16px; border-radius: 6px; }
    #checkout-page #checkout-step3 .checkout-inputs-list { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; }
    #checkout-page #checkout-step3 .checkout-inputs-list input { flex: 0 0 auto; margin-top: 4px; }
    #checkout-page #checkout-form .mysubmit-myaccount { max-width: 100%; min-height: 44px; padding: 10px 14px; white-space: normal; font-size: 15px; }
    #checkout-page #checkout-step3 .checkout-shipping-address:has(> #TermeniSiConditii) { display: block; line-height: 1.6; }
    #checkout-page #checkout-step3 label[for="TermeniSiConditii"], #checkout-page #checkout-step3 #termsCondLink { display: inline; width: auto; margin: 0; }
    #checkout-page #finalizeaza { width: 100% !important; min-height: 48px; }
    /* Keep the consent-controlled chat usable below the page, never over a form control. */
    body:has(#checkout-page) > div:has(iframe[title="chat widget"]) { position: relative !important; inset: auto !important; width: 100% !important; height: auto !important; min-height: 90px; margin: 12px 0 !important; z-index: auto !important; }
    body:has(#checkout-page) iframe[title="chat widget"] { position: relative !important; inset: auto !important; display: block !important; margin-left: auto !important; max-width: calc(100vw - 16px) !important; transform: none !important; }
}
