/* =========================================================
   BanglaNest — checkout
   ========================================================= */

/* Page frame: full width, no Astra title, no stray boxed/error-page styling */
.woocommerce-checkout .entry-header { display: none; }
body.woocommerce-checkout { background: var(--bn-bg) !important; }
.woocommerce-checkout #page,
.woocommerce-checkout .hfeed.site { width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: var(--bn-bg) !important; }
.woocommerce-checkout .site-content > .ast-container {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}
.woocommerce-checkout #primary,
.woocommerce-checkout .content-area,
.woocommerce-checkout .ast-article-single,
.woocommerce-checkout article.page,
.woocommerce-checkout .entry-content {
    float: none !important; width: 100% !important; max-width: none !important;
    margin-left: 0 !important; margin-right: 0 !important;
    padding-left: 0 !important; padding-right: 0 !important;
    border: 0 !important; box-shadow: none !important; background: transparent !important;
}
.woocommerce-checkout #primary { margin-top: 28px !important; margin-bottom: 64px !important; }
.woocommerce-checkout #secondary { display: none !important; }
html:has(body#error-page.bn-site) { background: var(--bn-bg) !important; }
body#error-page.bn-site { max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: var(--bn-bg) !important; color: var(--bn-ink) !important; font-family: var(--bn-sans) !important; }
body#error-page.bn-site h1 { border-bottom: 0 !important; margin: 0 !important; padding: 0 !important; }
body#error-page.bn-site p { font-size: inherit; line-height: inherit; margin: 0; }

.bn-co, .bn-co * { box-sizing: border-box; }
.bn-co { color: var(--bn-ink); }

/* ---------- Heading ---------- */
.bn-co-head { text-align: center; margin-bottom: 34px; }
.bn-site .bn-co-title { margin: 0; font: 400 clamp(34px, 4vw, 46px)/1.1 var(--bn-serif); color: var(--bn-ink); }
.bn-co-head i { display: block; width: 52px; height: 2px; margin: 14px auto; background: var(--bn-accent); }
.bn-co-head p { margin: 0; font-size: 12.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--bn-muted); }

/* Notices above the form */
.woocommerce-checkout .woocommerce-NoticeGroup,
.woocommerce-checkout .bn-co > .woocommerce-error,
.woocommerce-checkout .bn-co > .woocommerce-message,
.woocommerce-checkout .bn-co > .woocommerce-info { max-width: 1060px; margin-left: auto; margin-right: auto; }

/* ---------- Layout ---------- */
.bn-co-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 44px;
    align-items: start;
    max-width: 1060px;
    margin: 0 auto;
}
.bn-co-side { position: sticky; top: 24px; }

/* ---------- Fields ---------- */
.bn-co #customer_details { width: auto; float: none; }
.bn-co #customer_details::before, .bn-co #customer_details::after { display: none; }
.bn-co .woocommerce-billing-fields > h3 { display: none; } /* "Billing details" */
.bn-co .woocommerce-billing-fields__field-wrapper { display: grid; gap: 18px; }
.bn-co .woocommerce-additional-fields,
.bn-co .woocommerce-shipping-fields { display: none; }
.bn-co .bn-hidden-field { display: none !important; }

.bn-co .form-row {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.bn-co .form-row label,
.bn-co-label {
    display: block;
    margin: 0 0 8px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--bn-ink-2);
    line-height: 1.3;
}
.bn-co .form-row label .optional { display: none; }
.bn-co .required { color: var(--bn-accent); text-decoration: none; border: 0; font-weight: 600; }
.bn-co .woocommerce-input-wrapper { display: block; }

.bn-site .bn-co .form-row input.input-text,
.bn-site .bn-co .form-row textarea,
.bn-site .bn-co .form-row select {
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid #d9d2ca;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    font: 400 15px var(--bn-sans);
    color: var(--bn-ink);
    transition: border-color .15s, box-shadow .15s;
}
.bn-site .bn-co .form-row textarea { height: 104px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.bn-site .bn-co .form-row input.input-text:focus,
.bn-site .bn-co .form-row textarea:focus {
    outline: none;
    border-color: var(--bn-accent);
    box-shadow: 0 0 0 3px rgba(185, 85, 27, .12);
}
.bn-co .form-row input::placeholder,
.bn-co .form-row textarea::placeholder { color: #a39b93; }
.bn-site .bn-co .form-row.woocommerce-invalid input.input-text,
.bn-site .bn-co .form-row.woocommerce-invalid textarea { border-color: var(--bn-hot); }
.bn-co .form-row.woocommerce-validated input.input-text { border-color: #d9d2ca; }

/* ---------- Delivery area cards ---------- */
.bn-co-delivery { margin-top: 22px; }
.bn-co-delivery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bn-co-dcard {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    min-height: 64px;
    padding: 12px 16px;
    border: 1px solid #d9d2ca;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.bn-co-dcard:hover { border-color: #bfb4a8; }
.bn-co-dcard input { position: absolute; opacity: 0; pointer-events: none; }
.bn-co-dcard-dot {
    grid-row: 1 / span 2;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 1.5px solid #bfb4a8;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.bn-co-dcard-name { font-size: 15px; font-weight: 600; color: var(--bn-ink); }
.bn-co-dcard-price { font-size: 13.5px; color: var(--bn-muted); }
.bn-co-dcard-price.is-free { color: #1d6b43; font-weight: 700; }
.bn-co-dcard.is-checked,
.bn-co-dcard:has(input:checked) {
    border-color: var(--bn-accent);
    background: #fdf7f2;
    box-shadow: 0 0 0 3px rgba(185, 85, 27, .10);
}
.bn-co-dcard.is-checked .bn-co-dcard-dot,
.bn-co-dcard:has(input:checked) .bn-co-dcard-dot { border: 6px solid var(--bn-accent); }
.bn-co-dcard input:focus-visible + .bn-co-dcard-dot { box-shadow: 0 0 0 3px rgba(185, 85, 27, .25); }
.bn-co-delivery-empty { margin: 0; padding: 14px 16px; border-radius: 10px; background: #fdecea; color: #b42318; font-size: 14px; }

/* ---------- Order card ---------- */
.bn-co-card {
    padding: 24px;
    border: 1px solid var(--bn-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(28, 26, 24, .05);
}
.bn-site .bn-co-card-title { margin: 0 0 16px; font: 400 24px/1.2 var(--bn-serif); color: var(--bn-ink); }
.bn-co #order_review { width: auto; float: none; padding: 0; }

.bn-co-review { border: 0 !important; margin: 0 !important; }
.bn-co-items { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 12px; }
.bn-co-items li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 0; }
.bn-co-item-img { position: relative; width: 52px; height: 52px; border-radius: 8px; background: var(--bn-card-media); }
.bn-co-item-img img { width: 100% !important; height: 100% !important; object-fit: cover; border-radius: 8px; display: block; }
.bn-co-item-img b {
    position: absolute; top: -6px; right: -6px;
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px;
    background: var(--bn-ink); color: #fff;
    font-size: 11px; line-height: 20px; text-align: center;
}
.bn-co-item-name { font-size: 13.5px; line-height: 1.35; color: var(--bn-ink); }
.bn-co-item-name .bn-deal-tag { margin-left: 4px; }
.bn-co-item-name dl.variation { margin: 2px 0 0; font-size: 12px; color: var(--bn-muted); }
.bn-co-item-name dl.variation dt, .bn-co-item-name dl.variation dd { display: inline; margin: 0; float: none; }
.bn-co-item-name dl.variation dd p { display: inline; margin: 0; }
.bn-co-item-total { font-size: 14px; font-weight: 600; white-space: nowrap; }
.bn-co-item-total del { color: #9a938c; font-weight: 400; font-size: 12px; }
.bn-co-item-total ins { text-decoration: none; }

.bn-co-coupon { display: flex; gap: 8px; padding: 16px 0; border-top: 1px solid var(--bn-line); }
.bn-site .bn-co-coupon input {
    flex: 1; min-width: 0;
    height: 44px; margin: 0; padding: 0 14px;
    border: 1px solid #d9d2ca; border-radius: 8px; background: #fff;
    font: 400 14px var(--bn-sans); text-transform: uppercase; letter-spacing: .06em;
}
.bn-site .bn-co-coupon input::placeholder { text-transform: uppercase; }
.bn-site .bn-co-coupon input:focus { outline: none; border-color: var(--bn-accent); }
.bn-site .bn-co-coupon-btn {
    height: 44px; padding: 0 18px;
    border: 1.5px solid var(--bn-ink); border-radius: 8px;
    background: #fff; color: var(--bn-ink);
    font: 600 12px var(--bn-sans); letter-spacing: .12em; text-transform: uppercase;
    cursor: pointer;
}
.bn-site .bn-co-coupon-btn:hover { background: var(--bn-ink); color: #fff; }

.bn-co-totals { padding-top: 6px; border-top: 1px solid var(--bn-line); }
.bn-co-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14.5px; color: var(--bn-ink-2); }
.bn-co-row .is-free { color: #1d6b43; font-weight: 700; }
.bn-co-row.is-saving span:last-child { color: #b42318; }
.bn-co-row a.woocommerce-remove-coupon { margin-left: 6px; font-size: 12px; color: var(--bn-muted); }
.bn-co-row.is-total { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--bn-line); color: var(--bn-ink); }
.bn-site .bn-co-row.is-total span { font: 400 22px/1 var(--bn-serif); }
.bn-co-row.is-total strong { font-size: 22px; font-weight: 700; }
.bn-co-row.is-total small { display: block; font-size: 11px; font-weight: 400; color: var(--bn-muted); }

.bn-co-progress { margin-top: 14px; }
.bn-co-progress p { margin: 0 0 8px; font-size: 13px; color: var(--bn-ink-2); }
.bn-co-progress b { color: var(--bn-accent); }
.bn-co-bar { display: block; height: 5px; border-radius: 999px; background: #efe8e0; overflow: hidden; }
.bn-co-bar i { display: block; height: 100%; border-radius: inherit; background: var(--bn-accent); transition: width .3s ease; }
.bn-co-progress.is-done b { color: #1d6b43; }
.bn-co-progress.is-done .bn-co-bar i { background: #1d6b43; }
.bn-site .bn-co-addmore { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--bn-accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Payment + Place order ---------- */
.bn-co #payment { margin-top: 18px; background: transparent !important; border-radius: 0; }
.bn-co #payment ul.payment_methods { padding: 0 0 12px !important; margin: 0 !important; border: 0 !important; list-style: none; }
.bn-co #payment ul.payment_methods:has(> li.wc_payment_method:only-child) { display: none; } /* only Cash on Delivery: nothing to choose */
.bn-co #payment ul.payment_methods li { margin: 0 0 8px; padding: 12px 14px; border: 1px solid #d9d2ca; border-radius: 8px; background: #fff; }
.bn-co #payment div.payment_box { margin: 8px 0 0; padding: 10px 12px; border-radius: 6px; background: var(--bn-cream); font-size: 13px; color: var(--bn-ink-2); }
.bn-co #payment div.payment_box::before { display: none; }
.bn-co #payment div.form-row.place-order { padding: 0 !important; margin: 0 !important; }
.bn-co .woocommerce-privacy-policy-text p,
.bn-co .woocommerce-terms-and-conditions-wrapper { font-size: 12px; color: var(--bn-muted); margin: 0 0 12px; }
.bn-site .bn-co #place_order {
    float: none;
    display: block;
    width: 100%;
    height: 56px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--bn-accent) !important;
    color: #fff !important;
    font: 700 14px var(--bn-sans);
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s;
}
.bn-site .bn-co #place_order:hover { background: var(--bn-accent-dark) !important; }
.bn-co-paynote { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--bn-muted); }

.bn-co .blockUI.blockOverlay { background: rgba(255, 255, 255, .6) !important; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .bn-co-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .bn-co-side { position: static; }
}
@media (max-width: 520px) {
    .woocommerce-checkout #primary { margin-top: 18px !important; }
    .bn-co-head { margin-bottom: 24px; }
    .bn-co-head p { font-size: 11px; letter-spacing: .1em; }
    .bn-co-delivery-grid { grid-template-columns: 1fr; }
    .bn-co-card { padding: 18px; }
    .bn-site .bn-co #place_order { font-size: 13px; letter-spacing: .06em; padding: 0 10px; white-space: nowrap; }
}

/* =========================================================
   Undo Astra's two-column checkout styles (it floats #order_review
   at ~40% width with its own border/padding, and does the same to
   #customer_details and #order_review_heading).
   ========================================================= */
.woocommerce-page.woocommerce-checkout form.bn-co-form #customer_details,
.woocommerce.woocommerce-checkout form.bn-co-form #customer_details,
.woocommerce-page.woocommerce-checkout form.bn-co-form #order_review,
.woocommerce.woocommerce-checkout form.bn-co-form #order_review,
.woocommerce-page.woocommerce-checkout form.bn-co-form #order_review_heading,
.woocommerce.woocommerce-checkout form.bn-co-form #order_review_heading,
.bn-co-form #customer_details,
.bn-co-form #order_review,
.bn-co-form #order_review_heading {
    float: none !important;
    clear: none !important;
    width: 100% !important;
    max-width: none !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}
.bn-co-form #order_review_heading { margin: 0 0 16px !important; }
.bn-co-form #order_review .shop_table,
.bn-co-form #order_review .bn-co-review {
    width: 100% !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}
.bn-co-form .bn-co-items li,
.bn-co-form .bn-co-item-name { word-break: normal !important; overflow-wrap: anywhere; }
.bn-co-form #payment,
.bn-co-form #payment .place-order { width: 100% !important; float: none !important; }
.bn-co-grid > .bn-co-main,
.bn-co-grid > .bn-co-side { min-width: 0; width: auto !important; float: none !important; }

/* Deal explanation */
.bn-co-item-total del { display: block; text-align: right; }
.bn-co-row del,
.bn-co-dcard-price del { margin-right: 6px; color: #9a938c; font-weight: 400; }
.bn-co-row.bn-deal-row span:last-child { color: #b42318; font-weight: 600; }
.bn-co-saved {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #edf6f0;
    border: 1px solid #cfe6d7;
    color: #1d6b43;
    font-size: 13.5px;
    line-height: 1.4;
}
.bn-co-saved svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.bn-co-saved b { font-weight: 700; }
.bn-co-saved small { display: block; font-size: 12px; opacity: .85; }

/* Address + special instructions: start one line tall (same as Name/Mobile), grow with text */
.bn-site .bn-co .form-row textarea {
    height: 52px;
    min-height: 52px;
    padding: 14px 16px;
    line-height: 22px;
    resize: none;
    overflow: hidden;
    field-sizing: content; /* modern browsers grow natively; JS covers the rest */
}
.bn-co-notes { margin-top: 22px; }

/* Place order: arrow right after the text (CSS, so WooCommerce's text updates keep it) */
.bn-co #place_order::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 12px;
    vertical-align: -5px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h15m-6-6 6 6-6 6' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h15m-6-6 6 6-6 6' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform .15s;
}
.bn-co #place_order:hover::after { transform: translateX(4px); }
.bn-co-payment { margin-top: 22px; }
.bn-co-payment .payment_box { grid-column: 1 / -1; padding: 12px 14px; border-radius: 8px; background: var(--bn-cream); font-size: 13px; }
.bn-site .bn-co #place_order { display: flex !important; align-items: center; justify-content: center; white-space: nowrap; }
.bn-co #place_order::after { flex-shrink: 0; vertical-align: 0; }
@media (max-width: 420px) { .bn-site .bn-co #place_order { font-size: 12.5px; letter-spacing: .05em; } }

/* Delivery + payment cards: one line, same 52px height as the text fields */
.bn-co-dcard {
    grid-template-columns: auto auto 1fr;
    grid-template-rows: none;
    column-gap: 12px;
    min-height: 0;
    height: 52px;
    padding: 0 16px;
}
.bn-co-dcard-dot { grid-row: auto; width: 18px; height: 18px; }
.bn-co-dcard.is-checked .bn-co-dcard-dot,
.bn-co-dcard:has(input:checked) .bn-co-dcard-dot { border-width: 5px; }
.bn-co-dcard-name { font-size: 14.5px; white-space: nowrap; }
.bn-co-dcard-price {
    justify-self: end;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bn-co-dcard.is-checked,
.bn-co-dcard:has(input:checked) { box-shadow: none; }

/* Payment method: one full-width card */
.bn-co-payment .bn-co-delivery-grid { grid-template-columns: 1fr; }

@media (max-width: 520px) {
    .bn-co-dcard-price { font-size: 12.5px; }
}
/* Long sub-text never runs into the name */
.bn-co-dcard-price { min-width: 0; max-width: 100%; }
@media (max-width: 420px) {
    .bn-co-payment .bn-co-dcard-price { display: none; } /* "Pay when you receive…" is repeated under the button */
}

/* Mobile fixes (v2.6.5): payment card shows just "Cash on Delivery" */
@media (max-width: 520px) {
    .bn-co-payment .bn-co-dcard-price { display: none; }
}
