/*
==========================================================================
   ১. চেকআউট পপ-আপের স্টাইল
==========================================================================
*/
.checkout-popup-modal {
    display: flex;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease-in-out;
}

.checkout-popup-modal.is-hidden {
    display: none;
}

 .wc-block-checkout__sidebar.is-sticky {
        position: sticky;
        display: none;
    }

.checkout-popup-content {
    background-color: #fefefe;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    max-width: 550px;
    width: 90%;
    margin: 20px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: fadeIn 0.3s ease-out;
    position: relative;
}

/*
==========================================================================
   ২. পপ-আপ হেডার, বডি এবং লোগো
==========================================================================
*/
.popup-logo-container {
    position: absolute;
    top: 22px;
    left: 30px;
    z-index: 10;
}

.popup-logo-container img {
    max-height: 35px;
    width: auto;
}

.popup-header {
    padding: 20px 30px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.popup-header h3 {
    font-size: 20px;
    font-weight: 500;
    color: #333;
    line-height: 1.5;
    margin: 0;
}

.popup-close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    color: #e74c3c; /* একটি সুন্দর লাল রঙ ব্যবহার করা হলো */
    z-index: 1001; /* নিশ্চিত করা হলো যেন বাটনটি সবার উপরে থাকে */
}

.popup-close-button:hover {
    color: #555;
}

.popup-body {
    padding: 25px 30px;
    overflow-y: auto;
}

/*
==========================================================================
   ৩. নতুন ফর্ম ডিজাইন
==========================================================================
*/
.checkout-popup-form .form-field {
    display: none;
}

.checkout-popup-form .payment-method-section {
    display: none;
}

.checkout-popup-form .form-field-group {
    margin-bottom: 15px;
}

.checkout-popup-form .form-field-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 15px;
    color: #999;
    font-size: 16px;
    pointer-events: none;
}

.checkout-popup-form input[type="text"],
.checkout-popup-form input[type="tel"],
.checkout-popup-form textarea,
.checkout-popup-form select {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    background-color: #fff;
}

.checkout-popup-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    cursor: pointer;
    color: #999;
}

.checkout-popup-form select:valid {
    color: #333;
}

.checkout-popup-form select option[value=""][disabled] {
    color: #999;
}

.checkout-popup-form input:focus,
.checkout-popup-form textarea:focus,
.checkout-popup-form select:focus {
    outline: none;
    border-color: #27ae60;
}

/*
==========================================================================
   ৪. নতুন অর্ডার সামারি ডিজাইন (সকল ডিভাইসের জন্য)
==========================================================================
*/
.product-summary-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border: 1px solid #e9ecef;
}

.product-summary-section h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-align: center;
}

.summary-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-item-summary {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
}

.product-item-summary .summary-product-image {
    position: relative;
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.product-item-summary .summary-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.product-item-summary .remove-cart-item-button {
    display: flex;
    position: absolute;
    top: -8px;
    right: -8px;
    left: auto;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 16px;
    font-weight: bold;
    z-index: 10;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    text-decoration: none;
    transform: none;
}
.product-item-summary .remove-cart-item-button:hover {
    background-color: #c0392b;
    transform: scale(1.1);
    color: #fff;
}

.product-item-summary .summary-product-details {
    text-align: left;
    flex: 1 1 0;
    min-width: 0;
}

.product-item-summary .summary-product-details .item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.product-item-summary .summary-product-details .item-quantity-price {
    font-size: 13px;
    color: #555;
}

.summary-product-details .item-quantity-price strong {
    color: #27ae60;
    font-weight: 700;
}

.product-item-summary .summary-product-subtotal {
    display: block !important;
    font-size: 15px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    padding-bottom: 2px;
    flex-shrink: 0;
}

.cart-totals-summary {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #ced4da;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
}

.summary-row .summary-label {
    color: #555;
}

.summary-row .summary-value {
    font-weight: 600;
    color: #333;
}

.summary-row.total-row {
    font-size: 18px;
    font-weight: 700;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.summary-row.total-row .summary-label {
    color: #000;
}

.summary-row.total-row .total-price {
    color: #c03b2b;
}

/*
==========================================================================
   ৫. পেমেন্ট এবং রিলেটেড প্রোডাক্ট
==========================================================================
*/
.payment-method-section {
    text-align: center;
}

.popup-submit-button {
    width: 100%;
    padding: 15px;
    background-color: #27ae60;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.popup-submit-button:hover {
    background-color: #229954;
}

.related-products-section-checkout {
    background-color: #f8f9fa;
    margin: 25px -30px -25px -30px;
    padding: 25px 30px;
    border-top: 1px solid #e0e0e0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.related-products-section-checkout h4 {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: #333;
    margin: 10px 0 15px 0;
}

.related-products-list-checkout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-product-item-checkout {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.3s;
}

.related-product-item-checkout:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.related-product-item-checkout .related-product-link-area {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-grow: 1;
    margin-right: 10px;
}

.related-product-item-checkout .related-product-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    margin-right: 12px;
}

.related-product-item-checkout .related-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.related-product-item-checkout .related-product-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.related-product-item-checkout .related-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
}

.related-product-item-checkout .related-product-price {
    font-size: 15px;
    color: #333;
}

.related-product-item-checkout .related-product-price del {
    color: #95a5a6;
    margin-right: 8px;
    opacity: 0.8;
}

.related-product-item-checkout .related-product-price ins {
    color: #e0190a;
    font-weight: 700;
    text-decoration: none;
}


/* চেকআউট পপ-আপে সাশ্রয়ের পরিমাণ দেখানোর স্টাইল */
.related-product-item-checkout .related-product-info .saved-amount-container {
    font-size: 13px;
    font-weight: 600;
    color: #27ae60;
    margin-top: 4px;
    position: static; /* আগের absolute পজিশন তুলে দেওয়া হলো */
    text-align: left;
}



/*
==========================================================================
   নতুন কোয়ান্টিটি ইনপুটের স্টাইল
==========================================================================
*/
.quantity-wrapper-summary {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    height: 30px;
    max-width: 100px;
    margin-top: 5px;
}

.quantity-wrapper-summary input.qty-summary {
    width: 40px;
    height: 100%;
    padding: 0;
    border: none;
    text-align: center;
    font-size: 14px;
    -moz-appearance: textfield;
}

.quantity-wrapper-summary input.qty-summary::-webkit-outer-spin-button,
.quantity-wrapper-summary input.qty-summary::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-wrapper-summary .quantity-button-summary {
    width: 30px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f1f1f1;
    color: #555555;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.quantity-wrapper-summary .quantity-button-summary:hover {
    background-color: #e0e0e0;
}

.quantity-wrapper-summary .quantity-decrease-summary {
    border-right: 1px solid #ddd;
}

.quantity-wrapper-summary .quantity-increase-summary {
    border-left: 1px solid #ddd;
}

/* মোবাইল ডিভাইসের জন্য স্টাইল */
@media (max-width: 480px) {
    .quantity-wrapper-summary {
        max-width: 80px;
        height: 25px;
    }
    .quantity-wrapper-summary input.qty-summary {
        width: 30px;
        font-size: 13px;
    }
    .quantity-wrapper-summary .quantity-button-summary {
        width: 25px;
        font-size: 16px;
    }
}

/*
==========================================================================
   ৬. নতুন "Add" বাটন ও লোডিং স্টাইল
==========================================================================
*/
.add-related-product-button {
    background-color: #27ae60 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    line-height: 1.2 !important;
}

.add-related-product-button:hover {
    background-color: #229954 !important;
}

.add-related-product-button:disabled {
    background-color: #1abc9c !important;
    opacity: 0.8;
    cursor: default;
}

.product-summary-section-wrapper.loading {
    opacity: 0.5;
    position: relative;
    pointer-events: none;
}

.product-summary-section-wrapper.loading::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #27ae60;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


/*
==========================================================================
   ৮. রিলেটেড প্রোডাক্ট ট্যাবের নতুন UI স্টাইল
==========================================================================
*/
.related-products-section-checkout {
    background-color: #f8f9fa;
    margin: 25px -30px -25px -30px;
    border-top: 1px solid #e0e0e0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    padding: 0;
    overflow: hidden;
}

#checkout-related-products-content .related-products-content-inner {
    padding: 20px 30px 25px 30px;
}

.related-products-tabs {
    display: flex;
    width: 100%;
}

.related-products-tab-button {
    flex: 1;
    padding: 14px 10px;
    background-color: #e9ecef;
    color: #495057;
    border: none;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border-radius: 0;
    box-shadow: none;
    transform: none;
}

.related-products-tab-button:hover:not(.active) {
    background-color: #f1f3f5;
}

.related-products-tab-button.active {
    background-color: #ffffff;
    color: #27ae60;
    border-bottom: 2px solid #27ae60;
}

#checkout-related-products-content .loader {
    margin: 30px auto;
}




/* -- নতুন লেআউটের জন্য CSS -- */

/* মূল আইটেম কন্টেইনারের স্টাইল পরিবর্তন */
.related-product-item-checkout {
    align-items: flex-start; /* আইটেমগুলোকে উপরে অ্যালাইন করা */
    gap: 12px;
}

/* এখন আর পুরো এলাকা লিংক না হওয়ায় এই ক্লাসের প্রয়োজন নেই */
.related-product-item-checkout .related-product-link-area {
    margin-right: 0;
}

/* পণ্যের তথ্য কন্টেইনারের জন্য স্টাইল */
.related-product-item-checkout .related-product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* শিরোনামের লিংকের জন্য স্টাইল */
.related-product-info .related-product-title-link {
    text-decoration: none;
    color: inherit;
}

/* 'সাশ্রয়' এবং 'Add' বাটনের জন্য নতুন wrapper */
.related-product-info .actions-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px; /* উপরের অংশ থেকে দূরত্ব */
}

/* সাশ্রয় লেখার কন্টেইনার থেকে অতিরিক্ত মার্জিন সরানো */
.related-product-info .actions-wrapper .saved-amount-container {
    margin: 0;
    padding: 0;
    position: static;
    text-align: left;
}

/* বাটনের কন্টেইনার থেকে অতিরিক্ত মার্জিন সরানো */
.related-product-info .actions-wrapper .related-product-buttons {
    margin: 0;
}




/*
==========================================================================
   ৭. মোবাইল রেসপন্সিভ ডিজাইন (শুধুমাত্র পপ-আপ কন্টেইনারের জন্য)
==========================================================================
*/
@media (max-width: 480px) {
    .popup-logo-container {
        top: 20px;
        left: 20px;
    }

    .popup-logo-container img {
        max-height: 30px;
    }

    .popup-header,
    .popup-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .popup-header h3 {
        font-size: 16px;
    }

    .popup-close-button {
        font-size: 24px;
        right: 15px;
    }

    .popup-submit-button {
        font-size: 16px;
        padding: 12px;
    }

    .related-products-section-checkout {
        margin: 25px -20px -25px -20px;
        padding: 25px 20px;
    }


    #checkout-related-products-content .related-products-content-inner {
    padding: 20px 10px 25px 10px;
    }
    

}





/*
==========================================================================
   ৮. ডেস্কটপের জন্য দুই-কলাম লেআউট
==========================================================================
*/
@media (min-width: 992px) {
    .checkout-popup-content {
        max-width: 1100px; /* পপ-আপের প্রস্থ বাড়ানো হলো */
        width: 90%;
    }

    .popup-flex-container {
        display: flex;
        align-items: flex-start;
    }

    /* --- বাম কলাম --- */
    .popup-main-content {
        flex: 1;
        padding: 30px;
        border-right: 1px solid #e0e0e0;
        overflow-y: auto;
        max-height: 90vh; /* উচ্চতা সীমাবদ্ধ করা হলো */
    }

    .popup-main-content .popup-logo-container {
        position: static;
        margin-bottom: 20px;
    }

    .popup-main-content .popup-header {
        padding: 0;
        text-align: left;
        border-bottom: none;
        margin-bottom: 20px;
    }

    .popup-main-content .popup-body {
        padding: 0;
        overflow-y: visible;
    }
    
    .popup-main-content .related-products-section-checkout {
        display: none; /* বাম কলাম থেকে রিলেটেড প্রোডাক্ট সেকশন হাইড করা হলো */
    }


    /* --- ডান কলাম --- */
    .popup-sidebar-content {
        flex: 1;
        max-width: 500px; /* ডান কলামের সর্বোচ্চ প্রস্থ নির্ধারণ করা হলো */
        background-color: #f8f9fa;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
        overflow-y: auto;
        max-height: 90vh; /* উচ্চতা সীমাবদ্ধ করা হলো */
    }
    
    .popup-sidebar-content .related-products-section-checkout {
        margin: 0;
        border: none;
        border-radius: 0;
    }

    /* ক্লোজ বাটনকে পপ-আপের কোনায় আনা হলো */
    .popup-close-button {
        top: 15px;
        right: 15px;
    }
}












/*
==========================================================================
   ৯. বাম কলামের জন্য Sticky Footer এবং উন্নত UI
==========================================================================
*/
@media (min-width: 992px) {
    /* বাম কলামকে Flexbox বানানো হলো */
    .popup-main-content {
        display: flex;
        flex-direction: column;
        max-height: 90vh; /* আগের কোড থেকে max-height এখানে আনা হলো */
        overflow: hidden; /* ভেতরের কন্টেন্টকে কন্ট্রোল করার জন্য */
        padding: 0; /* ভেতরের প্যাডিং সরিয়ে দেওয়া হলো */
    }

    .popup-main-header {
        padding: 30px 30px 0 30px;
        flex-shrink: 0; /* এই অংশটি সংকুচিত হবে না */
    }

    /* শুধুমাত্র মাঝের অংশটি স্ক্রল হবে */
    .popup-main-body {
        flex-grow: 1; /* বাকি সব জায়গা নিয়ে নেবে */
        overflow-y: auto; /* ভার্টিকাল স্ক্রলবার যুক্ত করা হলো */
        padding: 0 30px;
    }

    /* ফুটার অংশটি সবসময় নিচে থাকবে */
    .popup-main-footer {
        flex-shrink: 0; /* এই অংশটিও সংকুচিত হবে না */
        padding: 20px 30px;
        border-top: 1px solid #e0e0e0;
        background-color: #ffffff;
    }

    .popup-main-footer .popup-submit-button {
        margin-bottom: 0;
    }
}


/*
==========================================================================
   ১০. ডান কলামের (Related Products) জন্য উন্নত UI/UX
==========================================================================
*/
.popup-sidebar-content .related-products-section-checkout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.popup-sidebar-content .related-products-tabs {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
}

#checkout-related-products-content {
    flex-grow: 1;
    overflow-y: auto;
    background-color: #F2F4F8;
}

#checkout-related-products-content .related-products-content-inner {
    padding: 20px;
}

/* প্রতিটা প্রোডাক্ট আইটেমের নতুন স্টাইল */
#checkout-related-products-content .related-product-item-checkout {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    transition: box-shadow 0.3s, transform 0.3s;
}

#checkout-related-products-content .related-product-item-checkout:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

/* 'Add' বাটনের নতুন স্টাইল */
#checkout-related-products-content .add-related-product-button {
    background-color: #e9ecef !important;
    color: #333 !important;
    font-weight: 500 !important;
    padding: 5px 10px !important;
    font-size: 13px !important;
    border: 1px solid #dee2e6 !important;
}

#checkout-related-products-content .add-related-product-button:hover {
    background-color: #27ae60 !important;
    color: #fff !important;
    border-color: #27ae60 !important;
}

#checkout-related-products-content .add-related-product-button:disabled {
    background-color: #27ae60 !important;
    color: #fff !important;
    opacity: 1;
}







/*
==========================================================================
   ১১. ট্যাবলেট এবং মোবাইলের জন্য প্রফেশনাল রেসপন্সিভ স্টাইল
==========================================================================
*/

/* --- ট্যাবলেট ভিউ (৯৯১px পর্যন্ত) --- */
@media (max-width: 991px) {
    .popup-flex-container {
        flex-direction: column;
    }

    .popup-main-content {
        border-right: none;
    }
    
    .popup-sidebar-content {
        max-width: 100%;
        width: 100%;
        border-top: 1px solid #e0e0e0;
        background-color: #f8f9fa;
        border-radius: 0 0 10px 10px;
    }
}

/* --- মোবাইল ভিউ (৭৬৮px পর্যন্ত) --- */
@media (max-width: 768px) {
    .checkout-popup-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .popup-flex-container {
        height: 100%;
    }
    
    .popup-main-content {
        max-height: 100vh;
    }

    .popup-main-header {
        padding: 15px 15px 0 15px;
    }
    
    .popup-main-body {
        padding: 0 15px;
    }
    
    .popup-main-footer {
        padding: 10px 15px;
        position: fixed;
        bottom: 50px; /* মোবাইল বারের উপরে থাকবে */
        left: 0;
        width: 100%;
        background-color: #ffffff;
        z-index: 100;
    }

    /* ডান পাশের সাইডবার মোবাইলে হাইড করা থাকবে */
    .popup-sidebar-content {
        display: none;
    }

    /* মোবাইল Sticky Bar স্টাইল */
    .mobile-related-products-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 5px;
        background-color: #101828;
        z-index: 999;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    .mobile-related-products-bar .button {
        width: 100%;
        background-color: #27ae60 !important;
        color: #fff !important;
        font-weight: 600;
    }

    /* মোবাইল Modal স্টাইল */
    .related-products-modal {
        display: flex;
        position: fixed;
        z-index: 10001; /* Checkout popup এর উপরে থাকবে */
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        justify-content: center;
        align-items: flex-end; /* নিচ থেকে উপরে আসবে */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }
    .related-products-modal.is-visible {
        opacity: 1;
        visibility: visible;
    }
    .related-products-modal-content {
        background-color: #ffffff;
        width: 100%;
        max-width: 100%;
        max-height: 70vh;
        border-radius: 15px 15px 0 0;
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
    }
    .related-products-modal.is-visible .related-products-modal-content {
        transform: translateY(0);
    }
    .related-products-modal-header {
        padding: 15px;
        border-bottom: 1px solid #e0e0e0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
    }
    .related-products-modal-header .modal-title {
        font-size: 16px;
        margin: 0;
    }
    .related-products-modal-header .modal-close-button {
        font-size: 24px;
        cursor: pointer;
    }
    .related-products-modal-body {
        overflow-y: auto;
        flex-grow: 1;
    }
}



/*
==========================================================================
   ১২. ডেস্কটপে মোবাইল বার লুকানো এবং মোবাইলে দেখানো
==========================================================================
*/

/* ডিফল্টভাবে ডেস্কটপে বার'টি লুকানো থাকবে */
.mobile-related-products-bar {
    display: none;
}

/* শুধুমাত্র মোবাইল ভিউতে বার'টি দেখানো হবে */
@media (max-width: 768px) {
    .mobile-related-products-bar {
        display: flex; /* আগের কোডে এটি 이미 আছে, তাও নিশ্চিত হওয়ার জন্য দেওয়া হলো */
    }
}



/*
==========================================================================
   FIX: ডেস্কটপ পপ-আপে রিলেটেড প্রোডাক্ট বক্সের উচ্চতা সমস্যার সমাধান
==========================================================================
*/
@media (min-width: 992px) {
    .popup-sidebar-content .related-products-list-checkout {
        max-height: none !important; /* নির্দিষ্ট max-height তুলে দেওয়া হলো */
    }
}




/*
==========================================================================
   ডেস্কটপ সাইডবার লেআউট আপডেট (স্টিকি ট্যাব ও ফুটার সহ)
==========================================================================
*/
@media (min-width: 992px) {
    /* সাইডবারের মূল কন্টেইনারকে ফ্লেক্স লেআউট দেওয়া হয়েছে */
    .popup-sidebar-content {
        overflow-y: hidden; /* পুরো সাইডবারের স্ক্রল বন্ধ করা হলো */
        display: flex;
        flex-direction: column;
    }

    /* ট্যাব বার এখন আর sticky নয়, এটি ফ্লেক্স লেআউটের অংশ */
    .popup-sidebar-content .related-products-tabs {
        position: static;
        flex-shrink: 0; /* ট্যাব বার যেন সংকুচিত না হয় */
    }

    /* শুধুমাত্র প্রোডাক্ট লিস্টের অংশটি স্ক্রল হবে */
    #checkout-related-products-content {
        overflow-y: auto; /* এই অংশে ভার্টিকাল স্ক্রল যুক্ত করা হলো */
        flex-grow: 1; /* এটি বাকি সবটুকু জায়গা নিয়ে নেবে */
    }

    /* নতুন ফুটারের জন্য স্টাইল */
    .popup-sidebar-footer {
        padding: 15px 20px;
        text-align: center;
        border-top: 1px solid #e0e0e0;
        background-color: #ffffff;
        flex-shrink: 0; /* ফুটার যেন সংকুচিত না হয় */
        border-bottom-right-radius: 10px; /* পপ-আপের সাথে মিলিয়ে কর্নার রাউন্ড করা হলো */
    }

    .popup-sidebar-footer .site-title {
        margin: 0 0 5px 0;
        font-size: 16px;
        font-weight: 700;
        color: #101828;
    }

    .popup-sidebar-footer .site-tagline {
        margin: 0;
        font-size: 13px;
        color: #555;
    }
}



/*
==========================================================================
   FIX: মোবাইল ভিউতে অর্ডার সামারি স্ক্রলযোগ্য করার জন্য নতুন স্টাইল
==========================================================================
*/
@media (max-width: 768px) {
    /* মূল অর্ডার সামারি বক্সটিকে ফ্লেক্স কন্টেইনার বানানো হলো */
    .product-summary-section {
        display: flex;
        flex-direction: column;
        /* একটি নির্দিষ্ট সর্বোচ্চ উচ্চতা দেওয়া হলো যাতে এটি স্ক্রিন ছাড়িয়ে না যায় */
        /* আপনি এই মানটি (40vh) প্রয়োজন অনুযায়ী পরিবর্তন করতে পারেন */
        max-height: 40vh; 
    }

    /* শুধুমাত্র পণ্যের তালিকাটি স্ক্রল হবে */
    .product-summary-section .summary-items-list {
        overflow-y: auto; /* ভার্টিকাল স্ক্রলবার যুক্ত করা হলো */
        flex-grow: 1; /* এটি বাকি সবটুকু জায়গা নিয়ে নেবে */
        padding-right: 10px; /* স্ক্রলবারের জন্য সামান্য জায়গা */
    }

    /* শিরোনাম এবং মোট মূল্যের অংশ যেন সংকুচিত না হয় */
    .product-summary-section h4,
    .product-summary-section .cart-totals-summary {
        flex-shrink: 0;
    }
}


/*
==========================================================================
   FIX: মোবাইল চেকআউট পেজের নতুন লেআউট (স্টিকি হেডার ও স্ক্রলযোগ্য বডি)
==========================================================================
*/
@media (max-width: 768px) {
    /* মূল কন্টেন্ট এলাকাকে ফ্লেক্স লেআউট দেওয়া হলো */
    .popup-main-content {
        display: flex;
        flex-direction: column;
        height: 100%;
        max-height: 100vh;
    }

    /* ১. হেডার অংশটি উপরে স্থির থাকবে */
    .popup-main-header {
        flex-shrink: 0; /* হেডারকে সংকুচিত হতে দেবে না */
        background: #fefefe;
        z-index: 2;
        border-bottom: 1px solid #e0e0e0;
        position: sticky;
        top: 0;
    }

    /* ২. মাঝের ফর্ম এবং প্রোডাক্ট লিস্টের অংশটি স্ক্রল হবে */
    .popup-main-body {
        flex-grow: 1; /* বাকি সবটুকু জায়গা নিয়ে নেবে */
        overflow-y: auto; /* এই অংশে ভার্টিকাল স্ক্রল যুক্ত করা হলো */
        padding-bottom: 80px !important; /* ফুটারের জন্য জায়গা তৈরি করা */
    }

    /* ৩. ফুটার অংশটি নিচে স্থির থাকবে */
    .popup-main-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        z-index: 100;
        border-top: 1px solid #e0e0e0;
        flex-shrink: 0;
    }

    /* মোবাইল ফুটারের নিচের যে বারটি আছে, তার জন্য জায়গা রাখা */
    body:not(.admin-bar) .popup-main-footer {
       bottom: 60px; /* Assuming tab bar height is 60px */
    }

    /* ডেস্কটপের জন্য তৈরি সাইডবারকে মোবাইলে হাইড করা */
    .popup-sidebar-content {
        display: none !important;
    }
}

/*
==========================================================================
   FIX: মোবাইল চেকআউট পেজের নতুন লেআউট (স্টিকি হেডার ও স্ক্রলযোগ্য বডি)
==========================================================================
*/
@media (max-width: 768px) {
    /* মূল কন্টেন্ট এলাকাকে ফ্লেক্স লেআউট দেওয়া হলো */
    .popup-main-content {
        display: flex;
        flex-direction: column;
        height: 100%;
        max-height: 100vh;
    }

    /* ১. হেডার অংশটি উপরে স্থির থাকবে */
    .popup-main-header {
        flex-shrink: 0; /* হেডারকে সংকুচিত হতে দেবে না */
        background: #fefefe;
        z-index: 2;
        border-bottom: 1px solid #e0e0e0;
        position: sticky;
        top: 0;
        padding: 15px 15px 0 15px;
    }

    /* ২. মাঝের ফর্ম এবং প্রোডাক্ট লিস্টের অংশটি স্ক্রল হবে */
    .popup-main-body {
        flex-grow: 1; /* বাকি সবটুকু জায়গা নিয়ে নেবে */
        overflow-y: auto; /* এই অংশে ভার্টিকাল স্ক্রল যুক্ত করা হলো */
        padding: 0 15px;
        /* ফুটার এবং 'প্রয়োজনীয় পণ্য' বারের জন্য জায়গা তৈরি করা */
        padding-bottom: 170px !important; 
    }

    /* ৩. স্টিকি ফুটারটি (অর্ডার বাটন সহ) মোবাইলে লুকিয়ে ফেলা হলো */
    .popup-main-footer {
        display: none;
    }

    /* ৪. ডেস্কটপের জন্য তৈরি সাইডবারকে মোবাইলে হাইড করা */
    .popup-sidebar-content {
        display: none !important;
    }

    /* ৫. ফর্মের ভেতরের মূল 'অর্ডার কনফার্ম' বাটনটি এখন দেখানো হবে */
    .popup-main-body .payment-method-section {
        display: block;
        margin-top: 20px;
    }
    
    /* ৬. অর্ডার সামারির ভেতরের স্ক্রল বন্ধ করা হলো */
    .product-summary-section {
        max-height: none; /* আগের দেওয়া max-height তুলে দেওয়া হলো */
    }

    .product-summary-section .summary-items-list {
        overflow-y: visible; /* ভেতরের স্ক্রল বন্ধ করা হলো */
        padding-right: 0;
    }

    /* ৭. 'প্রয়োজনীয় পণ্য দেখুন' বাটনটি বটম ট্যাব বারের উপরে দেখানো হলো */
    .mobile-related-products-bar {
        bottom: 60px; /* বটম ট্যাব বারের উচ্চতা (60px) অনুযায়ী পজিশন */
    }

    /* ৮. অন্যান্য মোবাইল স্টাইল */
    .checkout-popup-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .popup-flex-container {
        height: 100%;
    }
}


/*
==========================================================================
   FIX: মোবাইল চেকআউটে বটম বার হাইড হওয়ার সময় গ্লিচ সমাধান
==========================================================================
*/
@media (max-width: 768px) {
    /* 'আরও প্রয়োজনীয় পণ্য দেখুন' বাটনটিতে একটি ট্রানজিশন যোগ করা হলো */
    .mobile-related-products-bar {
        transition: bottom 0.3s ease-in-out;
    }

    /* যখন ট্যাব বার হাইড থাকবে, তখন এই বাটনটি নিচে নেমে আসবে */
    body.tab-bar-is-hidden .mobile-related-products-bar {
        bottom: 0;
    }
}