/* Nomod Modal Checkout Styles */

body.nomod-modal-open {
    overflow: hidden;
}

#nomod-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: nomodFadeIn 0.25s ease;
}

@keyframes nomodFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#nomod-modal-box {
    background: #fff;
    width: 96%;
    max-width: 1104px;
    height: 88vh;
    max-height: 780px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    animation: nomodSlideUp 0.3s ease;
}

@keyframes nomodSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Header ── */
#nomod-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}

#nomod-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}

#nomod-modal-close {
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

#nomod-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ── Two-column body ── */
#nomod-modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Left: Order Summary */
#nomod-modal-summary {
    width: 38%;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
}

#nomod-modal-summary h3 {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 18px 0;
}

.nomod-summary-items {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nomod-summary-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.nomod-summary-item-img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #fff;
}

.nomod-summary-item-img-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #e5e7eb;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.nomod-summary-item-info {
    flex: 1;
    min-width: 0;
}

.nomod-summary-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    margin: 0 0 2px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nomod-summary-item-qty {
    font-size: 12px;
    color: #9ca3af;
}

.nomod-summary-item-price {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    margin-left: auto;
}

.nomod-summary-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

.nomod-summary-totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nomod-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #6b7280;
}

.nomod-summary-row.total {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-top: 4px;
}

.nomod-summary-secure {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #9ca3af;
}

/* Right: Payment iframe */
#nomod-modal-payment {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #fff;
}

/* ── Branding overlay (covers Nomod's merchant name banner) ── */
#nomod-iframe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 148px;
    background: #fff;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    border-bottom: 1px solid #e5e7eb;
}

#nomod-iframe-overlay .nomod-overlay-label {
    font-family: "Open Sans", sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #777;
    text-transform: uppercase;
    text-align: center;
    padding: 0 16px;
    letter-spacing: 0.02em;
}

#nomod-iframe-overlay .nomod-overlay-amount {
    font-family: "Open Sans", sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #313131;
    letter-spacing: -0.02em;
}

/* ── Loading spinner ── */
#nomod-modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6b7280;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 6;
}

#nomod-modal-loading::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-top-color: #374151;
    border-radius: 50%;
    animation: nomodSpin 0.7s linear infinite;
}

@keyframes nomodSpin {
    to { transform: rotate(360deg); }
}

/* ── Scroll wrapper + iframe ── */
#nomod-iframe-scroll-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#nomod-modal-iframe {
    width: 100%;
    height: 1050px;
    border: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: block;
}

/* ── Bottom blocker (hides merchant info below Nomod logo) ── */
#nomod-iframe-bottom-block {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 100%);
    z-index: 4;
    pointer-events: none;
}

/* ── Responsive: devices under 1200px ── */
@media (max-width: 1200px) {
    #nomod-iframe-bottom-block {
        height: 200px;
    }
}

/* ── Devices under 768px: larger bottom blocker ── */
@media (max-width: 768px) {
    #nomod-iframe-bottom-block {
        height: 300px;
    }
}

/* ── Mobile: stack vertically ── */
@media (max-width: 700px) {
    #nomod-modal-box {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    #nomod-modal-body {
        flex-direction: column;
    }

    #nomod-modal-summary {
        width: 100%;
        max-height: 220px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 16px 18px;
    }

    #nomod-modal-summary h3 {
        margin-bottom: 12px;
    }

    #nomod-iframe-bottom-block {
        height: 200px;
    }
}