*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none; 
}

input, textarea {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
}

img {
    pointer-events: none;
    -webkit-user-drag: none;
}

body.pay-page {
    min-height: 100vh;
    background-color: #f0f4f9;
    display: flex;
    justify-content: center;
    font-family: 'Poppins', 'Noto Sans Bengali', sans-serif;
    overflow-x: hidden;
}

body.pay-page * {
    font-family: 'Poppins', 'Noto Sans Bengali', sans-serif;
}

.page {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: transparent;
    padding-bottom: 80px;
}

.pay-page .top-bar {
    background: #ffffff;
    border-radius: 8px;
    margin: 32px 20px 0 20px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}

.icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    color: #7a8ba3;
}

.right-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 32px;
}

.logo-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 1px solid #c7d6e8;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-circle img {
    width: 75px;
    height: 75px;
    object-fit: contain;
}

.brand-name {
    margin-top: 14px;
    font-size: 20px;
    font-weight: 600;
    color: #5c6a82;
}

.banking-btn {
    margin: 36px 20px 16px 20px;
    background: #D97022;
    border-radius: 6px;
    padding: 5px 0;
    text-align: center;
    color: #ffffff;
    font-size: 15px;
    font-weight: 400;
}

.methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 0 30px;
}

.method-card {
    background: transparent;
    border: 1px solid #dce4ed;
    border-radius: 6px;
    padding: 5px;
    margin-top: 10px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.method-card:active {
    transform: scale(0.94);
}

.method-card img {
    max-width: 100%;
    height: 100%;
    max-height: 55px;
    object-fit: contain;
    pointer-events: none;
}

.spacer {
    flex: 1;
}

.pay-bar-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    z-index: 999;
}

.pay-bar {
    background: #FFF3E0;
    padding: 16px 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    border-radius: 16px 16px 0 0;
}

.pay-bar span {
    font-size: 16px;
    font-weight: 600;
    color: #D97022;
}

@media (min-width: 600px) {
    body.pay-page {
        align-items: center;
        padding: 40px 0;
    }

    .page {
        background: #ffffff;
        min-height: auto;
        max-width: 520px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.03);
        padding: 32px;
    }

    .pay-page .top-bar {
        margin: 0;
        border: 1px solid #eaeff5;
    }

    .logo-section {
        padding-top: 0;
        margin-top: 36px;
        flex-direction: row;
        justify-content: flex-start;
    }

    .logo-circle {
        width: 72px;
        height: 72px;
    }

    .logo-circle img {
        width: 50px;
        height: 50px;
    }

    .brand-name {
        margin-top: 0;
        margin-left: 18px;
        font-size: 21px;
    }

    .banking-btn {
        margin: 32px 0 16px 0;
        width: 100%;
        padding: 9px 0;
    }

    .methods-grid {
        padding: 0;
    }

    .pay-bar-wrapper {
        position: static;
        margin-top: 36px;
        padding: 0;
    }

    .pay-bar {
        border-radius: 8px;
        padding: 14px 0;
    }
}

body.checkout-page {
    background-color: #f2f5f8;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 24px 0;
}

.main-wrapper {
    width: 100%;
    max-width: 460px;
    padding: 0 26px;
    margin: 0 auto;
}

.checkout-page .top-bar {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.top-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.right-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo-container {
    text-align: center;
    margin-bottom: 16px;
}

#bkash-method-logo {
    height: 54px;
}

#nagad-method-logo {
    height: 60px;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.store-card, .amount-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px 20px;
}

.store-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.store-logo-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.dynamic-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dynamic-name {
    font-size: 18px;
    font-weight: 600;
    color: #64748b;
}

.amount-card {
    font-size: 24px;
    font-weight: 700;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.magenta-box {
    background: #CF2772;
    border-radius: 8px;
    padding: 24px 20px;
    margin-bottom: 16px;
}

.magenta-title, .box-title {
    color: #ffffff;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

.nagad-box {
    background: #b80d12;
    border-radius: 8px;
    padding: 24px 20px;
    margin-bottom: 16px;
}

.trx-input {
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    color: #333;
    outline: none;
    margin-bottom: 20px;
}

.trx-input::placeholder {
    color: #94a3b8;
}

.instruction-list {
    list-style: none;
}

.instruction-list li {
    position: relative;
    padding: 14px 0 14px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 15px;
    line-height: 1.5;
}

.instruction-list li:first-child {
    padding-top: 0;
}

.instruction-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.instruction-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 21px;
    width: 5px;
    height: 5px;
    background: #ffffff;
    border-radius: 50%;
}

.instruction-list li:first-child::before {
    top: 7px;
}

.highlight {
    color: #ffdb00;
    font-weight: 600;
}

.number-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.copy-btn {
    background: rgba(0, 0, 0, 0.15);
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
}

.copy-btn:hover {
    background: rgba(0, 0, 0, 0.25);
}

.verify-btn {
    width: 100%;
    background: #c61124; 
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    -webkit-tap-highlight-color: transparent;
}

.verify-btn.nagad-verify {
    background: #b80d12;
}

#toast-container {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 88%;
    max-width: 400px;
    pointer-events: none;
}

.custom-toast {
    display: flex;
    align-items: center;
    color: #ffffff;
    padding: 18px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-25px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.custom-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.custom-toast.error {
    background: rgba(200, 50, 60, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.custom-toast.success {
    background: rgba(46, 163, 76, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.custom-toast-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-toast-message {
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.4;
}

#page-loader-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(255, 255, 255, 0.85); 
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#page-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loader-svg {
    width: 65px;
    height: 65px;
    animation: loader-fast-spin 0.75s linear infinite;
    transform-origin: center center;
}

.loader-svg circle {
    stroke: #2a81ff; 
    stroke-width: 4.5;
    stroke-linecap: round;
    stroke-dasharray: 85, 200; 
    stroke-dashoffset: 0;
}

@keyframes loader-fast-spin {
    100% {
        transform: rotate(360deg);
    }
}

@media (min-width: 768px) {
    body.checkout-page {
        padding: 40px 20px;
        justify-content: center;
        align-items: center;
    }

    .main-wrapper {
        max-width: 750px;
        background: #ffffff;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
        padding: 40px;
        margin: 0;
    }

    .checkout-page .top-bar {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 12px 16px;
        margin-bottom: 24px;
    }

    .info-row {
        flex-direction: row;
        gap: 20px;
        margin-bottom: 24px;
    }

    .store-card, .amount-card {
        border: 1px solid #e2e8f0;
        padding: 16px 20px;
    }

    .store-card {
        flex: 1;
    }

    .amount-card {
        width: 180px;
        justify-content: center;
    }

    .magenta-box, .nagad-box {
        padding: 30px;
        margin-bottom: 24px;
    }

    .verify-btn {
        margin-bottom: 0;
    }
}
