/* Fapshi checkout (classic + block) — payment method icons and phone field */

.fapshi-method-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.fapshi-method-icons img,
#payment ul.payment_methods li .fapshi-method-icons img {
    width: 24px;
    height: 24px;
    max-height: 24px;
    border-radius: 50%;
    float: none !important;
    margin: 0 !important;
}

.fapshi-blocks-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.fapshi-redirect-notice,
.fapshi-blocks-description {
    margin: 0 0 0.75em;
}

.fapshi-phone-field {
    width: 100%;
    border: 0;
    padding: 0;
    margin: 0;
}

.fapshi-phone-field label {
    display: block;
    padding-bottom: 0.5rem;
}

.fapshi-phone-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fapshi-phone-input-wrap input {
    width: 100%;
    padding-right: 3.25rem; /* room for the logo */
    box-sizing: border-box;
}

.fapshi-phone-input-wrap input.fapshi-has-logo {
    padding-right: 3.5rem !important;
}

/* Block checkout: match the look of WooCommerce's block text inputs. */
.fapshi-phone-input-wrap input.fapshi-phone-input {
    min-height: 3.125em;
    padding: 0.75em 3.25rem 0.75em 0.75em;
    border: 1px solid hsla(0, 0%, 7%, 0.8);
    border-radius: 4px;
    background: #fff;
    color: #2b2d2f;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.375;
}

.fapshi-phone-input-wrap input.fapshi-phone-input:focus {
    outline: 1.5px solid currentColor;
    outline-offset: 0;
    border-color: currentColor;
}

.fapshi-phone-desc {
    display: block;
    margin-top: 0.4em;
    font-size: 0.875em;
    color: #6b7280;
}

/*
 * The extra specificity (and !important on layout) beats WooCommerce core's
 * "#payment ul.payment_methods li img" rule and theme rules such as Storefront's
 * float/max-height on payment method images.
 */
.fapshi-phone-input-wrap img.fapshi-operator-logo,
#payment .fapshi-phone-input-wrap img.fapshi-operator-logo {
    position: absolute !important;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    height: 1.5rem;
    max-height: 1.5rem;
    width: auto;
    margin: 0 !important;
    padding: 0;
    float: none !important;
    box-shadow: none;
    display: none;
    pointer-events: none;
    border-radius: 50%;
    /* Smooth fade-in when the operator is detected */
    opacity: 0;
    transition: opacity 0.15s ease;
}

.fapshi-phone-input-wrap img.fapshi-operator-logo--visible,
#payment .fapshi-phone-input-wrap img.fapshi-operator-logo--visible {
    display: block;
    opacity: 1;
}

/* Payment-pending overlay — dim backdrop + compact centred card */

.fapshi-payment-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000; /* above the admin bar (99999) and WooCommerce's blockUI (1000) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.45);
}

.fapshi-payment-overlay__card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
    text-align: center;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.fapshi-payment-overlay__spinner {
    display: block;
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top-color: #f0a500;
    border-radius: 50%;
    animation: fapshi-overlay-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes fapshi-overlay-spin {
    to { transform: rotate(360deg); }
}

.fapshi-payment-overlay__logo {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
}

.fapshi-payment-overlay__text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #374151;
}

.fapshi-payment-overlay--success .fapshi-payment-overlay__text {
    color: #15803d;
    font-weight: 600;
}

.fapshi-payment-overlay--failed .fapshi-payment-overlay__text {
    color: #b91c1c;
}

.fapshi-payment-overlay__retry {
    margin-top: 0.25rem;
    padding: 0.5em 1.5em;
    background: #f0a500;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
}

.fapshi-payment-overlay__retry:hover,
.fapshi-payment-overlay__retry:focus-visible {
    background: #d49200;
    outline: none;
}

.fapshi-payment-overlay__hint {
    margin: 0;
    font-size: 0.8125rem;
    color: #6b7280;
}
