:root {
    --bntc-blue: #3695f6;
    --bntc-blue-dark: #1f7fe2;
    --bntc-green: #36d925;
    --bntc-text: #3a3a3a;
    --bntc-muted: #777;
    --bntc-border: #e2e5ea;
    --bntc-soft: #f7f9fc;
}

/* Keep the official API/locker logic, replace only its legacy checkout UI. */
.woocommerce-checkout #box_now_delivery_button,
.woocommerce-checkout #box_now_delivery_embedded_map,
.woocommerce-checkout #box_now_selected_locker_details,
.woocommerce-checkout .boxnow-iframe-window,
.woocommerce-checkout .plugin-boxnow-map,
.woocommerce-checkout .plugin-boxnowmap {
    display: none !important;
}

.bntc-rate-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    vertical-align: middle;
    min-width: 0;
}

.bntc-rate-brand img {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 5px;
    flex: 0 0 30px;
}

/* Porto (.porto-radio) rows and any theme markup: force the logo size even
   when the theme ships higher-specificity image rules. */
.porto-radio .bntc-rate-brand img,
.porto-control-label .bntc-rate-brand img,
ul#shipping_method .bntc-rate-brand img,
.woocommerce-shipping-methods .bntc-rate-brand img,
.shipping_method + label .bntc-rate-brand img {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    min-width: 30px !important;
    object-fit: cover !important;
    border-radius: 5px !important;
    display: inline-block;
    vertical-align: middle;
}

.porto-radio .porto-control-label .bntc-rate-brand,
.porto-control-label .bntc-rate-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    vertical-align: middle;
    min-width: 0;
}

.woocommerce-shipping-methods li.bntc-rate-row label {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    line-height: 1.35;
}

.bntc-visual-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #b7bec8;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    background: #fff;
}

.bntc-visual-radio::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bntc-blue);
}

.bntc-panel {
    width: 100%;
    margin: 20px 0 24px;
    padding: 22px;
    border: 1px solid var(--bntc-border);
    border-radius: 12px;
    background: #fff;
    color: var(--bntc-text);
    box-shadow: none;
    box-sizing: border-box;
}

.bntc-panel[hidden] {
    display: none !important;
}

.bntc-panel__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #edf0f4;
}

.bntc-panel__logo {
    display: block;
    width: 58px;
    height: 58px;
    border-radius: 9px;
    object-fit: cover;
    flex: 0 0 58px;
}

.bntc-panel__header h3 {
    margin: 0 0 4px !important;
    color: var(--bntc-text);
    font-size: 20px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
    white-space: nowrap;
}

.bntc-panel__header p {
    margin: 0;
    color: var(--bntc-muted);
    font-size: 14px;
    line-height: 1.45;
}

.bntc-step__editor,
.bntc-step__complete {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.bntc-step__editor[hidden],
.bntc-step__complete[hidden] {
    display: none !important;
}

.bntc-step__number,
.bntc-step__check {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    color: #fff;
    background: var(--bntc-blue);
    font-size: 16px;
    font-weight: 700;
}

.bntc-step__check {
    background: var(--bntc-green);
}

.bntc-step__content,
.bntc-step__summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1 1 auto;
}

.bntc-step__content strong {
    margin-top: 2px;
    color: var(--bntc-text);
    font-size: 16px;
    line-height: 1.35;
}

.bntc-step__content > span {
    margin: 4px 0 14px;
    color: var(--bntc-muted);
    font-size: 14px;
    line-height: 1.45;
}

.bntc-open-map,
.woocommerce .bntc-open-map,
.woocommerce-checkout .bntc-open-map {
    min-height: 44px;
    padding: 10px 20px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: var(--bntc-blue) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-transform: none !important;
    box-shadow: none !important;
    cursor: pointer;
}

.bntc-open-map:hover,
.bntc-open-map:focus {
    background: var(--bntc-blue-dark) !important;
    color: #fff !important;
}

.bntc-step__complete {
    align-items: center;
    padding: 14px;
    border: 1px solid #dce7f5;
    border-radius: 9px;
    background: var(--bntc-soft);
}

.bntc-step__complete[hidden] {
    display: none !important;
}

.bntc-step__summary small {
    margin-bottom: 3px;
    color: #66758a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .04em;
}

.bntc-step__summary strong {
    color: var(--bntc-text);
    font-size: 15px;
    line-height: 1.4;
    word-break: break-word;
}

.bntc-step__summary span {
    margin-top: 2px;
    color: var(--bntc-muted);
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.bntc-edit-locker,
.woocommerce .bntc-edit-locker {
    margin-left: auto;
    padding: 4px 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--bntc-blue) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
}

.bntc-feedback {
    display: none;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}

.bntc-feedback.is-success {
    display: block;
    background: #effbf0;
    color: #26752b;
}

.bntc-feedback.is-error {
    display: block;
    background: #fff0f0;
    color: #bb2020;
}

.bntc-map-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: transparent;
    box-sizing: border-box;
}

.bntc-map-dialog {
    position: relative;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.bntc-map-dialog iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.bntc-map-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 42px;
    height: 42px;
    padding: 0 !important;
    border: 2px solid #fff !important;
    border-radius: 50% !important;
    background: var(--bntc-blue) !important;
    color: #fff !important;
    font-family: Arial, sans-serif !important;
    font-size: 29px !important;
    font-weight: 400 !important;
    line-height: 36px !important;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .2) !important;
}

.bntc-map-close:hover,
.bntc-map-close:focus {
    background: #17488f !important;
    outline: 2px solid rgba(255,255,255,.9) !important;
    outline-offset: 2px;
}

body.bntc-map-open {
    overflow: hidden !important;
}

.bntc-order-locker {
    margin-top: 24px;
}

@media (max-width: 767px) {
    .bntc-panel {
        margin: 16px 0 20px;
        padding: 16px;
        border-radius: 9px;
    }

    .bntc-panel__header {
        gap: 11px;
        padding-bottom: 14px;
        margin-bottom: 15px;
    }

    .bntc-panel__logo {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .bntc-panel__header h3 {
        font-size: 17px !important;
        white-space: normal;
    }

    .bntc-panel__header p {
        font-size: 13px;
    }

    .bntc-step__editor {
        gap: 10px;
    }

    .bntc-step__number,
    .bntc-step__check {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        font-size: 14px;
    }

    .bntc-open-map {
        width: 100%;
    }

    .bntc-step__complete {
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }

    .bntc-edit-locker {
        margin-left: 6px;
    }

    .bntc-map-overlay {
        padding: 0;
    }

    .bntc-map-dialog {
        width: 100vw;
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }
}

/* TopCase/Porto layout hardening. */
.woocommerce-checkout #bntc-checkout-panel{clear:both;float:none!important;grid-column:1/-1;width:100%!important;max-width:100%;position:relative;z-index:1}
.bntc-rate-label{width:100%;min-width:0}
.bntc-rate-brand{width:100%;align-items:center}
.bntc-rate-copy{display:flex;flex-direction:column;min-width:0;line-height:1.3}
.bntc-rate-main{display:flex;align-items:center;flex-wrap:wrap;gap:5px;min-width:0}
.bntc-rate-title{font-weight:600;color:inherit;white-space:normal}
.bntc-rate-price{font-weight:600;color:inherit;white-space:nowrap}
.bntc-rate-price:not(:empty)::before{content:": ";}
.bntc-rate-help{display:block;margin-top:3px;color:#777;font-size:12px;font-weight:400;line-height:1.35;text-transform:none}
.bntc-panel__header>div{min-width:0}
.bntc-panel__header h3{white-space:normal!important;overflow-wrap:anywhere}
@media(max-width:767px){.bntc-panel__header{align-items:center}.bntc-panel__logo{width:44px;height:44px;flex-basis:44px}}

/* When WooCommerce Econt Express is active, BOX NOW lives inside the same
 * recipient/delivery shell. Keep the standalone panel as a safe fallback. */
#tpecont-boxnow-slot #bntc-checkout-panel{margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
#tpecont-boxnow-slot .bntc-panel__header{display:none!important}
#tpecont-boxnow-slot .bntc-step--locker{margin:0!important}

/* Customer order view: keep one clear Box Now destination and suppress the
 * stale/duplicate billing address that some themes render directly. */
body.bntc-boxnow-order .woocommerce-customer-details,
body.bntc-boxnow-order .woocommerce-column--billing-address,
body.bntc-boxnow-order .woocommerce-columns--addresses{display:none!important}
body.bntc-boxnow-order .bntc-order-delivery{clear:both;width:100%;margin:24px 0}
body.bntc-boxnow-order .bntc-order-delivery h2{margin:0 0 14px}
body.bntc-boxnow-order .bntc-delivery-table{width:100%;table-layout:fixed}
body.bntc-boxnow-order .bntc-delivery-table th{width:34%;font-weight:700;text-align:left;vertical-align:top}
body.bntc-boxnow-order .bntc-delivery-table td{overflow-wrap:anywhere;vertical-align:top}
@media(max-width:767px){
 body.bntc-boxnow-order .bntc-order-delivery{margin:18px 0}
 body.bntc-boxnow-order .bntc-order-delivery h2{font-size:23px;line-height:1.2}
 body.bntc-boxnow-order .bntc-delivery-table,
 body.bntc-boxnow-order .bntc-delivery-table tbody,
 body.bntc-boxnow-order .bntc-delivery-table tr,
 body.bntc-boxnow-order .bntc-delivery-table th,
 body.bntc-boxnow-order .bntc-delivery-table td{display:block;width:100%!important;box-sizing:border-box}
 body.bntc-boxnow-order .bntc-delivery-table tr{padding:13px 0;border-bottom:1px solid #e7e7e7}
 body.bntc-boxnow-order .bntc-delivery-table th,
 body.bntc-boxnow-order .bntc-delivery-table td{padding:0!important;border:0!important}
 body.bntc-boxnow-order .bntc-delivery-table th{margin-bottom:5px;font-size:14px}
 body.bntc-boxnow-order .bntc-delivery-table td{font-size:15px;line-height:1.45}
}


/* Shared courier information row in the cart. */
.topcase-cart-couriers-row>th{padding-top:14px!important;padding-bottom:14px!important;text-align:left!important}
.topcase-cart-couriers{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:10px;width:100%}
.topcase-cart-courier{display:flex;align-items:center;gap:12px;min-width:0;padding:12px 14px;border:1px solid #dce5ef;border-radius:8px;background:#f8fbfe;box-sizing:border-box}
.topcase-cart-courier__logo{display:block!important;width:46px!important;height:38px!important;max-width:46px!important;object-fit:contain;flex:0 0 46px;margin:0!important}
.topcase-cart-courier__copy{display:flex;min-width:0;flex-direction:column;gap:3px;color:#263645;font-size:13px;line-height:1.35;text-transform:none}
.topcase-cart-courier__copy strong{color:#172330;font-size:14px;font-weight:700;text-transform:none}
.topcase-cart-courier__copy span{color:#667482;font-weight:400;text-transform:none}
@media(max-width:575px){.topcase-cart-couriers{grid-template-columns:1fr}.topcase-cart-courier{padding:11px 12px}.topcase-cart-courier__logo{width:42px!important;height:34px!important;flex-basis:42px}}

.topcase-cart-couriers__next-step{display:flex;align-items:center;gap:7px;margin:11px 2px 0!important;color:#536779;font-size:13px;line-height:1.4;font-weight:500;text-transform:none!important}
.topcase-cart-couriers__next-step>span{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:#eaf4ff;color:#1976d2;font-size:14px;font-weight:700;flex:0 0 20px}
