/* Cofactor - simple cart and checkout layout (body.cf-co-cart / cf-co-checkout / cf-co-success) */
.cf-co-cart, .cf-co-checkout, .cf-co-success { --cf-blue: #234D9C; --cf-sky: #229AC8; --cf-text: #1d2433; --cf-muted: #6b7280; --cf-line: #e5e7eb; --cf-bg: #f6f7f9; --cf-green: #16a34a; --cf-red: #d61f26; }
.cf-hide { display: none !important; }
.cf-co-cart .breadcrumb, .cf-co-checkout .breadcrumb, .cf-co-success .breadcrumb { display: none; }

/* Steps */
.cf-steps { display: flex; gap: 8px; list-style: none; margin: 16px 0 24px; padding: 0; counter-reset: none; }
.cf-steps li { flex: 1 1 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--cf-bg); color: var(--cf-muted); font-weight: 600; font-size: 15px; min-width: 0; }
.cf-steps li a { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.cf-steps li a:hover .cf-steps-label { text-decoration: underline; }
.cf-steps-n { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 2px solid currentColor; font-size: 14px; }
.cf-steps-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-steps li.is-active { background: var(--cf-blue); color: #fff; }
.cf-steps li.is-active .cf-steps-n { background: #fff; color: var(--cf-blue); border-color: #fff; }
.cf-steps li.is-done { color: var(--cf-green); background: #ecfdf3; }
.cf-steps li.is-done .cf-steps-n { background: var(--cf-green); border-color: var(--cf-green); color: #fff; }

/* Buttons */
.cf-btn { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 10px 20px; border-radius: 8px; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; border: 2px solid transparent; text-align: center; }
.cf-btn-primary { background: var(--cf-blue); border-color: var(--cf-blue); color: #fff; }
.cf-btn-primary:hover, .cf-btn-primary:focus { background: #1a3b7a; border-color: #1a3b7a; color: #fff; }
.cf-btn-primary.is-loading { opacity: .7; cursor: progress; }
.cf-btn-ghost { background: #fff; border-color: var(--cf-line); color: var(--cf-text); }
.cf-btn-ghost:hover, .cf-btn-ghost:focus { border-color: var(--cf-blue); color: var(--cf-blue); }
.cf-link { background: none; border: 0; padding: 0; color: var(--cf-blue); font-weight: 600; cursor: pointer; text-decoration: underline; }
.cf-co-muted { color: var(--cf-muted); font-weight: 400; }

/* ---------- 1. Cart ---------- */
.cf-co-cart #shopping-cart > h1 { font-size: 26px; margin-bottom: 16px; }
.cf-cart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "items summary" "share summary"; gap: 20px 24px; align-items: start; }
.cf-cart-items { grid-area: items; min-width: 0; padding: 6px 18px; border: 1px solid #c9d1de; border-top: 4px solid var(--cf-blue); border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(16, 24, 40, .07); }
.cf-cart-share { grid-area: share; min-width: 0; }
.cf-cart-items #output-cart { overflow: visible; }
.cf-co-cart #output-cart table { border: 0; margin: 0; }
.cf-co-cart #output-cart thead, .cf-co-cart #output-cart tfoot { display: none; }
.cf-co-cart #output-cart tbody { display: flex; flex-direction: column; gap: 0; }
.cf-co-cart #output-cart tbody tr { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; grid-template-areas: "img name qty total"; gap: 16px; align-items: center; padding: 14px 0; border: 0; border-bottom: 1px solid var(--cf-line); border-radius: 0; background: #fff; }
.cf-co-cart #output-cart tbody tr:last-child { border-bottom: 0; }
.cf-co-cart #output-cart tbody td { border: 0; padding: 0; background: none; }
.cf-co-cart #output-cart tbody td:nth-child(1) { grid-area: img; }
.cf-co-cart #output-cart tbody td:nth-child(2) { grid-area: name; }
.cf-co-cart #output-cart tbody td:nth-child(3) { grid-area: qty; }
.cf-co-cart #output-cart tbody td:nth-child(4) { display: none; }
.cf-co-cart #output-cart tbody td:nth-child(5) { grid-area: total; font-weight: 700; font-size: 17px; white-space: nowrap; min-width: 90px; }
.cf-co-cart #output-cart .img-thumbnail { width: 96px; height: 96px; object-fit: contain; border: 0; padding: 0; }
.cf-co-cart #output-cart td:nth-child(2) > a { color: var(--cf-text); font-weight: 600; text-decoration: none; line-height: 1.35; }
.cf-co-cart #output-cart td:nth-child(2) > a:hover { color: var(--cf-blue); text-decoration: underline; }
.cf-co-cart #output-cart td:nth-child(2) small { color: var(--cf-muted); }
.cf-unit { color: var(--cf-muted); font-size: 13px; margin-top: 4px; }
.cf-qty { display: flex; align-items: center; gap: 0; max-width: none !important; width: auto !important; }
.cf-qty .btn.cf-qty-minus, .cf-qty .btn.cf-qty-plus { width: 38px; height: 38px; padding: 0; border: 1px solid var(--cf-line); background: #fff; font-size: 18px; line-height: 1; color: var(--cf-text); border-radius: 8px; }
.cf-qty .btn.cf-qty-minus { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cf-qty .btn.cf-qty-plus { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cf-qty .btn.cf-qty-minus:hover, .cf-qty .btn.cf-qty-plus:hover { border-color: var(--cf-blue); color: var(--cf-blue); }
.cf-qty input.form-control { width: 46px !important; max-width: 46px !important; height: 38px; text-align: center; border-radius: 0 !important; border-left: 0; border-right: 0; flex: 0 0 46px; }
.cf-qty .cf-qty-update { display: none !important; }
.cf-qty .btn.cf-qty-remove { margin-left: 10px; border: 0; background: none; color: var(--cf-muted); font-size: 17px; border-radius: 8px !important; }
.cf-qty .btn.cf-qty-remove:hover { color: var(--cf-red); background: #fef2f2; }
.cf-co-cart .cf-share-hint { margin: 14px 0 0; font-size: 14px; }
.cf-co-cart #shopping-cart > h2, .cf-co-cart #shopping-cart > h2 + p, .cf-co-cart #shopping-cart > #accordion, .cf-co-cart #shopping-cart > br, .cf-co-cart #shopping-cart > .row { display: none; }
.cf-cart-summary { grid-area: summary; position: sticky; top: 16px; padding: 20px; border: 1px solid #c9d1de; border-top: 4px solid var(--cf-blue); border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(16, 24, 40, .07); display: flex; flex-direction: column; gap: 10px; }
.cf-sum-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.cf-sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.cf-sum-row span:last-child { white-space: nowrap; font-weight: 600; }
.cf-sum-row.is-save span:last-child { color: var(--cf-green); }
.cf-sum-row.is-total { padding-top: 10px; border-top: 1px solid var(--cf-line); font-size: 19px; font-weight: 700; }
.cf-cart-summary .cf-btn-primary { margin-top: 8px; }
.cf-sum-extra:empty { display: none; }

/* ---------- 2. Checkout ---------- */
.cf-co { max-width: 820px; margin: 0 auto 40px; }
.cf-co-sec { margin-bottom: 20px; padding: 22px; border: 1px solid #c9d1de; border-top: 4px solid var(--cf-blue); border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(16, 24, 40, .07); }
.cf-co-h { font-size: 20px; font-weight: 700; margin: 0 0 16px; text-transform: none; }
.cf-co-h3 { font-size: 16px; font-weight: 700; margin: 18px 0 12px; }
.cf-co #form-register fieldset { margin: 0; }
.cf-co .cf-wide { flex: 0 0 100%; max-width: 100%; }
.cf-co .form-label { font-size: 14px; margin-bottom: 4px; }
.cf-co .form-control, .cf-co .form-select { min-height: 46px; border-radius: 8px; }
.cf-co .form-check { display: flex; align-items: flex-start; gap: 10px; padding-left: 0; min-height: 0; margin-bottom: 8px; }
.cf-co .form-check .form-check-input { float: none; flex: 0 0 20px; width: 20px; height: 20px; margin: 1px 0 0; }
.cf-co .form-check-label { flex: 1 1 auto; width: auto; padding-left: 0; line-height: 1.4; }
.cf-login-line { margin: -8px 0 16px; color: var(--cf-muted); }
.cf-co #section-login { margin-bottom: 18px !important; }
.cf-register-check { margin-top: 4px; }
.cf-co .cf-password-row { margin-top: 12px; }
.cf-co .cf-password-row legend { font-size: 16px; font-weight: 700; }
.cf-co .custom-field-3 .form-text { font-size: 13px; }

/* Options (delivery, payment) */
.cf-opts { display: flex; flex-direction: column; gap: 10px; }
.cf-opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 2px solid var(--cf-line); border-radius: 10px; cursor: pointer; background: #fff; margin: 0; }
.cf-opt:hover { border-color: #b6c3dd; }
.cf-opt.is-checked { border-color: var(--cf-blue); background: #f4f7fd; }
.cf-opt input[type="radio"] { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; accent-color: var(--cf-blue); }
.cf-opt-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.cf-opt-title { font-weight: 700; }
.cf-opt-note { font-size: 13px; color: var(--cf-muted); }
.cf-opt-price { font-weight: 700; white-space: nowrap; }
.cf-opt-wrap { display: flex; flex-direction: column; }
.cf-terminal { display: grid; gap: 8px; padding: 10px 0 0 34px; }
.cf-terminal[hidden] { display: none; }
.cf-terminal select { min-height: 0; height: auto; padding: 4px; }
.cf-terminal select option { padding: 6px 8px; white-space: normal; }
.cf-terminal select option:checked { background: #e8eef8 linear-gradient(#e8eef8, #e8eef8); color: #10233f; font-weight: 600; }
.cf-terminal-chosen { padding: 8px 10px; border-radius: 6px; background: #eef6ee; color: #1f5f2a; font-size: 14px; }
.cf-terminal-chosen[hidden] { display: none; }
.cf-terminal-chosen span { font-weight: 600; }
.cf-co-loading { height: 56px; border-radius: 10px; background: linear-gradient(90deg, #f3f4f6 25%, #e9ebef 50%, #f3f4f6 75%); background-size: 200% 100%; animation: cf-co-shine 1.2s infinite linear; }
@keyframes cf-co-shine { to { background-position: -200% 0; } }
.cf-co-error { margin-top: 10px; padding: 10px 14px; border-radius: 8px; background: #fef2f2; color: #991b1b; font-weight: 600; }
.cf-co-error[hidden] { display: none; }
#cf-ship-address[hidden] { display: none; }
.cf-co .cf-comment { margin-top: 6px; }
.cf-co .cf-comment .form-label { font-weight: 600; }

/* Summary */
.cf-co #checkout-confirm .table-responsive { margin: 0; overflow-x: visible; }
.cf-co #checkout-confirm table { table-layout: fixed; width: 100%; }
.cf-co #checkout-confirm td:first-child { overflow-wrap: anywhere; word-break: break-word; }
.cf-co #checkout-confirm td:last-child { width: 104px; }
.cf-co #checkout-confirm table { margin: 0; border: 0; font-size: 14px; }
.cf-co #checkout-confirm thead { display: none; }
.cf-co #checkout-confirm tr, .cf-co #checkout-confirm tbody, .cf-co #checkout-confirm tfoot { border: 0 !important; }
.cf-co #checkout-confirm tfoot td:last-child { white-space: nowrap; padding-left: 12px; }
.cf-co #checkout-confirm td { border: 0; border-bottom: 1px solid var(--cf-line); padding: 8px 0; background: none; }
.cf-co #checkout-confirm tbody a { color: var(--cf-text); text-decoration: none; }
.cf-co #checkout-confirm tbody small { color: var(--cf-muted); }
.cf-co #checkout-confirm tbody td.text-end { white-space: nowrap; padding-left: 12px; }
.cf-co #checkout-confirm tfoot td { border-bottom: 0; padding: 5px 0; font-size: 15px; }
.cf-co #checkout-confirm tfoot td:first-child { text-align: left !important; }
.cf-co #checkout-confirm tfoot strong { font-weight: 400; }
.cf-co #checkout-confirm tfoot tr:first-child td { padding-top: 14px; }
.cf-co #checkout-confirm tfoot tr:last-child td { padding-top: 10px; border-top: 1px solid var(--cf-line); font-size: 20px; font-weight: 700; }
.cf-co #checkout-confirm tfoot tr:last-child strong { font-weight: 700; }
.cf-co #checkout-confirm .cf-item { display: flex; align-items: flex-start; gap: 12px; }
.cf-co #checkout-confirm .cf-item-img { flex: 0 0 56px; width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--cf-line); border-radius: 8px; background: #fff; }
.cf-co #checkout-confirm .cf-item-text { min-width: 0; }
.cf-co #checkout-confirm .cf-save-row td:last-child { color: var(--cf-green); font-weight: 600; }
.cf-co #checkout-confirm #checkout-payment { display: none; }
.cf-coupon { margin: 14px 0 6px; }
.cf-coupon-box { margin-top: 10px; }
.cf-coupon-box .accordion-item { border: 0; }
.cf-coupon-box .accordion-header { display: none; }
.cf-coupon-box .accordion-body { padding: 0; }
.cf-coupon-box .collapse:not(.show) { display: none; }
.cf-coupon-box .row { --bs-gutter-x: 0; }
.cf-coupon-box .col-form-label { display: none; }
.cf-coupon-box .col-md-8 { width: 100%; }
.cf-co .cf-agree { margin: 14px 0 0; padding: 12px 14px; border-radius: 8px; background: var(--cf-bg); }
.cf-agree.is-invalid { outline: 2px solid var(--cf-red); }
.cf-co .cf-agree .form-check-input { order: -1; }
.cf-co-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; margin-top: 18px; }
.cf-co-actions .cf-btn-primary { font-size: 18px; min-height: 56px; }

/* Phones */
@media (max-width: 767.98px) {
	.cf-steps { gap: 6px; margin: 10px 0 16px; }
	.cf-steps li { padding: 8px; font-size: 13px; gap: 6px; justify-content: center; }
	.cf-steps-n { flex-basis: 24px; width: 24px; height: 24px; font-size: 12px; }
	.cf-cart-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "items" "summary" "share"; gap: 16px; }
	.cf-cart-items { padding: 2px 12px; border-radius: 10px; }
	.cf-cart-summary { position: static; }
	.cf-co-cart #output-cart tbody tr { grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "img name name" "img qty total"; gap: 10px 12px; padding: 12px 0; }
	.cf-co-cart #output-cart .img-thumbnail { width: 72px; height: 72px; }
	.cf-co-cart #output-cart tbody td:nth-child(5) { text-align: right; min-width: 0; }
	.cf-co-sec { padding: 16px; border-radius: 10px; }
	.cf-co-h { font-size: 18px; }
	.cf-opt { padding: 12px; gap: 10px; }
	.cf-terminal { padding-left: 0; }
	.cf-co-actions { grid-template-columns: 1fr; }
	.cf-co-actions .cf-btn-primary { order: -1; }
}
@media (max-width: 400px) {
	.cf-steps-label { font-size: 12px; }
}
.cf-pay-note { margin: 10px 0 0; font-size: 13px; }
