/* Surcharge Visibility */
.bpoint-surcharge-info {
    display: none !important;
    margin-top: 10px;
}
body.bpoint-surcharge-active .bpoint-surcharge-info {
    display: block !important;
}

/* Surcharge Link */
.bpoint-surcharge-link {
    display: inline-block;
    margin-left: 10px;
}

.bpoint-surcharge-info-link {
    color: #0073aa;
    text-decoration: none !important;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bpoint-surcharge-info-link:hover {
    color: #005177;
    text-decoration: underline !important;
}

.bpoint-surcharge-info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

/* Modal Base */
.bpoint-surcharge-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bpoint-surcharge-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.bpoint-surcharge-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 598px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    z-index: 1000000 !important;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Header */
.bpoint-surcharge-modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.bpoint-surcharge-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.bpoint-surcharge-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.bpoint-surcharge-modal-close:hover {
    background-color: #e0e0e0;
    color: #333;
}

/* Modal Body */
.bpoint-surcharge-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.bpoint-surcharge-modal-body p {
    margin-bottom: 16px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Loading & Error States */
.surcharge-loading,
.surcharge-error {
    text-align: center;
    padding: 40px 20px;
}

.surcharge-loading p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.surcharge-loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.surcharge-error p {
    color: #d63638;
    font-size: 16px;
}

.bpoint-surcharge-modal .table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.bpoint-surcharge-modal .table-striped tbody tr:nth-of-type(odd) {
    background-color: #f9f9f9;
}

.bpoint-surcharge-modal .table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.bpoint-surcharge-modal .table tbody tr:hover {
    background-color: #f1f1f1;
}

.bpoint-surcharge-modal .table tbody tr:last-child {
    border-bottom: none;
}

.bpoint-surcharge-modal .table td {
    padding: 12px 16px;
    vertical-align: middle;
    color: #333;
}

.bpoint-surcharge-modal .table td:first-child {
    font-weight: 500;
}

.bpoint-surcharge-modal .table td:last-child {
    color: #666;
}

/* Section Headers */
.bpoint-surcharge-modal-body p[style*="text-decoration: underline"] {
    font-weight: 600;
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
}

.bpoint-surcharge-modal-body p[style*="text-decoration: underline"]:first-of-type {
    margin-top: 10px;
}

/* Last Update Text */
#surcharge-last-update {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

#surcharge-last-update p {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

#surcharge-last-update b {
    font-weight: 600;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bpoint-surcharge-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .bpoint-surcharge-modal-header {
        padding: 16px 20px;
    }

    .bpoint-surcharge-modal-header h3 {
        font-size: 18px;
    }

    .bpoint-surcharge-modal-body {
        padding: 20px;
    }

    /* Keep 2-column layout on mobile like HPP */
    .bpoint-surcharge-modal .table {
        font-size: 13px;
    }

    .bpoint-surcharge-modal .table td {
        padding: 10px 8px;
        word-wrap: break-word;
    }

    .bpoint-surcharge-modal .table td:first-child {
        font-size: 14px;
    }

    .bpoint-surcharge-modal .table td:last-child {
        font-size: 13px;
    }
}

/* WooCommerce Compatibility */
.woocommerce #bpoint-cc-form .bpoint-surcharge-modal {
    font-family: inherit;
}

.woocommerce .bpoint-surcharge-modal .table {
    background-color: #fff;
}

/* Fix for potential conflicts with theme styles */
.bpoint-surcharge-modal * {
    box-sizing: border-box;
}

.bpoint-surcharge-modal p {
    margin: 0 0 16px 0;
}

.bpoint-surcharge-modal table {
    margin: 0;
}
