/*
==========================================================================
    উন্নত অর্ডার সফল হওয়ার পপ-আপের স্টাইল (Sticky Header/Footer সহ)
==========================================================================
*/

.order-success-popup {
    display: flex;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.order-success-popup.is-visible {
    opacity: 1;
    visibility: visible;
}

.order-success-popup-content {
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    max-width: 480px;
    width: 90%;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    /* Sticky Layout styles */
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    /* পপ-আপের সর্বোচ্চ উচ্চতা নির্ধারণ */
}

.order-success-popup.is-visible .order-success-popup-content {
    transform: scale(1);
}

/* --- টপ অংশ (স্ক্রল হবে না) --- */
.popup-top-content {
    flex-shrink: 0;
    position: relative;
    padding: 25px 30px 0;
}

.popup-logo-container {
    margin-bottom: 15px;
}

.popup-logo-container img {
    max-height: 40px;
    width: auto;
}

.popup-logo-container span {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.popup-close-icon {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    font-weight: bold;
    color: #aaa;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.popup-close-icon:hover {
    color: #333;
}

/* Success Icon Animation */
.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
}

.success-icon .checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #27ae60;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #27ae60;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.success-icon .checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #27ae60;
    fill: #fff;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-icon .checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {

    0%,
    100% {
        transform: none;
    }

    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 40px #27ae60;
    }
}

.order-success-popup .popup-header h3 {
    font-size: 26px;
    font-weight: 700;
    color: #101828;
    margin: 0 0 10px 0;
}

.order-success-popup .order-success-message p {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 20px;
}

/* --- মাঝের অংশ (স্ক্রল হবে) --- */
.related-products-section {
    flex-grow: 1;
    overflow-y: auto;
    /* শুধুমাত্র এই অংশ স্ক্রল হবে */
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.related-products-tabs {
    display: flex;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 2; /* z-index বাড়িয়ে 2 করা হয়েছে */
    background-color: #f8f9fa; /* একটি ব্যাকগ্রাউন্ড যুক্ত করা হয়েছে */
}
.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;
}

.related-products-tab-button:hover:not(.active) {
    background-color: #f1f3f5;
}

.related-products-tab-button.active {
    background-color: #f8f9fa;
    color: #27ae60;
    border-bottom: 2px solid #27ae60;
}

#success-related-products-content .related-products-content-inner {
    padding: 20px 30px 25px 30px;
}

.related-products-section h4 {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: #333;
    margin: 0 0 15px 0;
}

.related-products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-product-item {
    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:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.related-product-item .related-product-link-area {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-grow: 1;
    margin-right: 10px;
}

.related-product-item .related-product-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    margin-right: 12px;
}

.related-product-item .related-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.related-product-item .related-product-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.related-product-item .related-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
}

.related-product-item .related-product-price {
    font-size: 15px;
    color: #333;
}

.related-product-item .related-product-price del {
    color: #95a5a6;
    margin-right: 8px;
    opacity: 0.8;
}

.related-product-item .related-product-price ins {
    color: #c0392b;
    font-weight: 700;
    text-decoration: none;
}

.related-product-item .related-product-info .saved-amount-container {
    font-size: 13px;
    font-weight: 600;
    color: #27ae60;
    margin-top: 4px;
    text-align: left;
}

.related-product-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.related-product-buttons .success-popup-button {
    padding: 8px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    border-radius: 5px !important;
    white-space: nowrap;
    border: none !important;
    text-align: center;
}

.related-product-buttons .popup-buy-now-button {
    background-color: #101828 !important;
    color: #ffffff !important;
}

.related-product-buttons .popup-buy-now-button:hover {
    background-color: #333741 !important;
}

.related-product-item .tinv-wraper {
    position: relative;
    top: auto;
    right: auto;
    z-index: 1;
}

.related-product-item .tinv-wraper .tinvwl_add_to_wishlist_button {
    font-size: 0;
    color: transparent;
    background: #f1f1f1;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
}

.related-product-item .tinv-wraper .tinvwl-icon-heart:before {
    font-size: 14px;
    color: #e74c3c;
    margin: 0;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #27ae60;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.view-all-offers-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.view-all-offers-button {
    background-color: #f0f0f0 !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    width: auto !important;
    padding: 10px 20px !important;
    display: inline-block !important;
    font-weight: 600 !important;
    border-radius: 5px !important;
    text-align: center;
}

.view-all-offers-button:hover {
    background-color: #e0e0e0 !important;
    color: #000 !important;
}

/* --- নিচের অংশ (স্ক্রল হবে না) --- */
.order-success-actions {
    flex-shrink: 0;
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.order-success-actions .button {
    width: 100%;
    margin-bottom: 0;
}


/*
==========================================================================
   Mobile Responsive Design (Consolidated)
==========================================================================
*/
@media (max-width: 480px) {
    .popup-top-content {
        padding: 25px 15px 0;
    }

    .popup-logo-container img {
        max-height: 35px;
    }

    .popup-close-icon {
        top: 5px;
        right: 10px;
        font-size: 28px;
    }

    .order-success-popup .popup-header h3 {
        font-size: 22px;
    }

    .order-success-popup .order-success-message p {
        font-size: 15px;
        margin-bottom: 15px;
    }

    #success-related-products-content .related-products-content-inner {
        padding: 20px 15px 25px;
    }

    .related-product-item {
        padding: 8px;
        gap: 8px;
    }

    .related-product-item .related-product-link-area {
        margin-right: 5px;
    }

    .related-product-item .related-product-image {
        width: 45px;
        height: 45px;
        margin-right: 10px;
    }

    .related-product-item .related-product-title {
        font-size: 13px;
        font-weight: 500;
        line-height: 1.3;
        margin-bottom: 2px;
    }

    .related-product-item .related-product-price {
        font-size: 14px;
    }

    .related-product-item .related-product-price del {
        margin-right: 5px;
    }

    .related-product-buttons .popup-buy-now-button {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    .related-product-item .tinv-wraper .tinvwl_add_to_wishlist_button {
        width: 32px;
        height: 32px;
    }

    .order-success-actions {
        padding: 15px;
    }
}