/* ============================================================
   PaymentFactory Modal Styles
   Aligned with form-message-alert design in from-theme.css
   ============================================================ */

/* Overlay */
.payment-modal-overlay {
    position: fixed;
    z-index: 100001;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.payment-modal-overlay.animate {
    opacity: 1;
}

/* Panel */
.payment-modal-panel {
    background-color: #FFF;
    border-radius: 6px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.7);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.payment-modal-overlay.animate .payment-modal-panel {
    transform: scale(1);
}

/* Header */
.payment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eff2f5;
}

.payment-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #3f4254;
}

.payment-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #b5b5c3;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.payment-modal-close:hover {
    color: #3f4254;
}

/* Body */
.payment-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Order Summary */
.payment-order-summary {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #F1F5F9;
    text-align: center;
    border-radius: 10px;
}
.payment-amount-title{
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 4px;
}
.payment-amount {
    font-size: 30px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}
.payment-amount span{
    font-size: 16px;
    color: #94a3b8;
    margin-left: 3px;
}
.payment-txn-id {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    justify-content:space-between;
    border-top: 1px dashed #e2e8f0;
    padding: 10px 0 0;
    margin: 10px 0 0; 
}
.payment-txn-id .order-id{
    color: #0f172a;
}



/* SDK Container */
.payment-sdk-title{
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    margin: 0 0 10px;
}
.payment-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 12px;
    color: #a1a5b7;
}
.payment-secure-note svg {
    width: 13px;
    height: 13px;
}



#payment-sdk-container {
    min-height: 46px;
    margin-bottom: 16px;
}

/* Submit Button (Stripe) */
.payment-btn-submit {
    height: 42px;
    border-radius: 4px;
    background: #50cd89;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: #FFF;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.payment-btn-submit:hover {
    background-color: #47be7d;
}

.payment-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Error Message */
.payment-error {
    color: #f1416c;
    font-size: 13px;
    text-align: center;
    padding: 8px;
    margin-top: 8px;
}

/* Footer */
.payment-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #eff2f5;
    text-align: center;
    background-color: #F1F5F9;
    border-radius: 0 0 6px 6px;
}

/* Sandbox Badge */
.payment-sandbox-badge {
    display: inline-block;
    padding: 7px 15px;
    border: 1px solid #F59E0B;
    color: #F59E0B;
    background-color: #FFFBEB;
    border-radius: 25px;
    font-size: 12px;
}

/* Result Panels (Success / Error) */
.payment-modal-result .payment-modal-body {
    text-align: center;
    padding: 35px 26px;
}

.payment-result-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 10px auto 25px;
    position: relative;
}

.payment-modal-success .payment-result-icon {
    border: 3px solid rgba(165, 220, 134, 0.3);
}

.payment-modal-success .payment-result-icon::after {
    content: "";
    width: 55%;
    height: 32%;
    position: absolute;
    left: 25%;
    top: 26%;
    border-bottom: 4px solid #50cd89;
    border-left: 4px solid #50cd89;
    transform: rotate(-45deg);
    border-radius: 3px;
}

.payment-modal-error .payment-result-icon {
    border: 3px solid rgba(241, 65, 108, 0.3);
}

.payment-modal-error .payment-result-icon::after,
.payment-modal-error .payment-result-icon::before {
    content: "";
    width: 60%;
    border-bottom: 4px solid #f1416c;
    opacity: 0.75;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -2px 0 0 -30%;
    border-radius: 2px;
}

.payment-modal-error .payment-result-icon::after {
    transform: rotate(45deg);
}

.payment-modal-error .payment-result-icon::before {
    transform: rotate(-45deg);
}

.payment-result-message {
    font-size: 14px;
    color: #3f4254;
    margin-bottom: 15px;
}

.payment-btn-confirm {
    height: 42px;
    border-radius: 4px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0 0;
    color: #FFF;
    font-size: 14px;
    padding: 0 15px;
    min-width: 110px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.payment-modal-success .payment-btn-confirm {
    background: #50cd89;
}

.payment-modal-success .payment-btn-confirm:hover {
    background: #47be7d;
}

.payment-modal-error .payment-btn-confirm {
    background: #f1416c;
}

.payment-modal-error .payment-btn-confirm:hover {
    background: #d9214e;
}

/* ============================================================
   Payment Processing Modal
   Markup source: Resources/theme/templates/payment-processing.html
   (keep this block in sync with the <style> in that template file)
   ============================================================ */

/* Backdrop */
.payment-processing-overlay {
    position: fixed;
    z-index: 100002;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.payment-processing-overlay.animate {
    opacity: 1;
}

/* Panel */
.payment-processing-panel {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28), 0 8px 20px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    transform: translateY(18px) scale(0.98);
    opacity: 0;
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.payment-processing-overlay.animate .payment-processing-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Body */
.payment-processing-body {
    padding: 40px 28px 32px;
    text-align: center;
}

/* Spinner */
.payment-processing-spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto 22px;
    position: relative;
}

.payment-processing-spinner-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid #f1f5f9;
    border-top-color: #2563eb;
    animation: payment-processing-spin 0.8s linear infinite;
}

.payment-processing-spinner-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #2563eb;
    opacity: 0;
    animation: payment-processing-pulse 1.8s ease-out infinite;
}

@keyframes payment-processing-spin {
    to { transform: rotate(360deg); }
}

@keyframes payment-processing-pulse {
    0%   { transform: scale(0.85); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Status text */
.payment-processing-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.payment-processing-desc {
    font-size: 13.5px;
    color: #475569;
    margin-bottom: 4px;
}

/* animated ellipsis */
.payment-processing-dots::after {
    content: '';
    animation: payment-processing-dots 1.4s steps(4, end) infinite;
}

@keyframes payment-processing-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

/* Amount recap */
.payment-processing-amount {
    margin-top: 22px;
    padding: 14px 18px;
    background: #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.payment-processing-amount .label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.payment-processing-amount .value {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.payment-processing-amount .value .cur {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    margin-left: 3px;
}

/* Warning note */
.payment-processing-warn {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}

.payment-processing-warn svg {
    width: 15px;
    height: 15px;
    color: #94a3b8;
    flex-shrink: 0;
    margin-top: 1px;
}

.payment-processing-warn span {
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 540px) {
    .payment-modal-panel {
        max-width: 95vw;
        border-radius: 4px;
    }

    .payment-amount {
        font-size: 20px;
    }

    .payment-processing-panel {
        max-width: 95vw;
        border-radius: 12px;
    }

    .payment-processing-body {
        padding: 32px 20px 26px;
    }
}

/* ============================================================
   Pricing Fields Styles
   ============================================================ */

.product-single-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.product-price {
    font-weight: 600;
    color: #3f4254;
}

.pricing-total {
    font-size: 24px;
    font-weight: 700;
    color: #3f4254;
    text-align: right;
    padding: 12px 0;
    border-top: 2px solid #eff2f5;
    margin-top: 10px;
}

.shipping-fixed {
    padding: 0 0 8px;
    font-weight: 500;
    color: #3f4254;
}

/* ============================================================
   Card Grid (shared by Product and Shipping)
   ============================================================ */

.fields-columns .product-card-grid {
    gap: 12px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--form-FieldsWidth), 1fr);
}

.product-card-grid .product-card {
    position: relative;
    margin-inline-end: 15px;
    margin-bottom: 10px;
    display: inline-flex;
    vertical-align: middle;
    max-width: 180px;
}
.fields-columns .product-card-grid .product-card{
    margin-inline-end: 0;
    margin-bottom: 0;
    max-width: none;
}

.product-card-grid input[type="radio"] {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
}

.product-card-grid label {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--form-FieldBorderColor);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    background: #fff;
    height: 100%;
}

.product-card-grid label:hover {
    border-color: var(--form-FieldBorderHoverColor);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.product-card-grid input:checked + label {
    border-color: var(--form-FieldBorderFocusColor);
    box-shadow: 0 0 0 1px var(--form-FieldBorderFocusColor), 0 2px 8px rgba(102, 108, 255, 0.15);
}

.product-card-grid .card-image {
    width: 100%;
    overflow: hidden;
}

.product-card-grid .card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-card-grid .card-body {
    padding: 10px 12px;
}

.product-card-grid .card-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--form-FieldColor);
}

.product-card-grid .card-price {
    display: block;
    font-size: 13px;
    color: var(--form-FieldColor);
    margin-top: 4px;
    opacity: 0.95;
}
.product-card-grid label:hover .card-title {
    color: var(--form-FieldHoverColor);
}
.product-card-grid label:hover .card-price {
    color: var(--form-FieldHoverColor);
}

.product-card-grid input:checked + label .card-title {
    color: var(--form-FieldFocusColor);
}
.product-card-grid input:checked + label .card-price {
    color: var(--form-FieldFocusColor);
}

.product-card-grid .formError2 {
    position: absolute;
    top: 100%;
    left: 0;
}

/* ============================================================
   Product Radio Grid (columns)
   ============================================================ */

.radio-list[style*="grid"] .option-item label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
}
