/* Rasid SMM storefront — TikTok Followers purchase form.
 * RTL-first, mobile-first. The TikTok URL input stays LTR inside the RTL UI.
 */

/* ── STRUCTURAL cart-grid fix (iPhone narrow-column root cause) ─────────
 * The theme renders form.cart as a 2-column grid (96px qty stepper + 1fr
 * button). Our form is injected INSIDE that grid via
 * woocommerce_before_add_to_cart_button. On SMM products the Woo stepper
 * is never rendered (sold_individually), so the grid collapses to one
 * column and the SMM form + the add-to-cart button each span the full
 * width. This is structural (grid placement), not cosmetic hiding.
 * Scoped by the rasid-smm-product-page body class — no :has() needed.
 */
.rasid-smm-product-page form.cart {
    grid-template-columns: 1fr !important;
}

.rasid-smm-product-page form.cart .rasid-smm-form {
    grid-column: 1 / -1;
    min-width: 0; /* allow the grid item to shrink to the column */
}

.rasid-smm-product-page form.cart .single_add_to_cart_button {
    grid-column: 1 / -1;
    width: 100%;
}

/* Defensive: the express-checkout slot in the theme's sticky buy bar must
 * stay empty on SMM products (the Noon buttons are never rendered —
 * see Storefront::suppress_express_checkout). */
.rasid-smm-product-page .rch-mobile-buybar__apple-pay {
    display: none !important;
}

.rasid-smm-form {
    direction: rtl;
    margin: 1.25rem 0;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafbfc;
    min-width: 0; /* never force horizontal overflow inside the grid */
    max-width: 100%;
    box-sizing: border-box;
}

.rasid-smm-field {
    margin-bottom: 1rem;
}

.rasid-smm-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.375rem;
    font-size: 1rem;
    line-height: 1.5;
}

.rasid-smm-field select,
.rasid-smm-field input[type="url"] {
    width: 100%;
    min-height: 48px; /* touch target >= 44px */
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

/* URL input stays LTR so the address reads correctly. */
.rasid-smm-field input[type="url"] {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
    word-break: break-all;
}

.rasid-smm-field select:focus,
.rasid-smm-field input[type="url"]:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
    border-color: #2563eb;
}

.rasid-smm-help {
    font-size: 0.875rem;
    color: #475569;
    margin: 0.375rem 0 0;
    line-height: 1.6;
}

.rasid-smm-error {
    font-size: 0.875rem;
    color: #b91c1c; /* not color-only: prefixed with ⚠ in JS */
    margin: 0.375rem 0 0;
    font-weight: 600;
    line-height: 1.6;
}

.rasid-smm-price {
    font-size: 1.25rem;
    margin: 1rem 0;
    padding: 0.75rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
}

.rasid-smm-price strong {
    color: #0f766e;
}

.rasid-smm-notice {
    font-size: 0.875rem;
    color: #334155;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    line-height: 1.8;
}

.rasid-smm-notice p {
    margin: 0.25rem 0;
}

.rasid-smm-unavailable {
    direction: rtl;
    padding: 1rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    border-radius: 8px;
    color: #991b1b;
}

/* Customer order cards (thank-you / my account / email). */
.rasid-cust-order {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin: 0.75rem 0;
    background: #fff;
    font-size: 0.95rem;
    line-height: 1.9;
}

.rasid-cust-order .co-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.rasid-cust-pill {
    display: inline-block;
    padding: 0.15rem 0.75rem;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.rasid-cust-pill.ok {
    background: #dcfce7;
    color: #166534;
}

.rasid-cust-pill.warn {
    background: #fef3c7;
    color: #92400e;
}

/* Narrow screens: keep the form usable, never overflow horizontally. */
@media (max-width: 430px) {
    .rasid-smm-form {
        padding: 0.75rem;
        margin-left: 0;
        margin-right: 0;
    }

    .rasid-smm-field input[type="url"] {
        font-size: 0.9rem; /* long URLs must not break layout */
    }

    .rasid-smm-price {
        font-size: 1.1rem;
    }

    .rasid-cust-order .co-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
