/**
 * Saudi Trainers Theme — RTL Stylesheet
 * Applied automatically when WordPress is in RTL mode.
 *
 * @package SaudiTrainers
 */

/* ── Base Direction Overrides ──────────────────────────── */
body {
    direction: rtl;
    text-align: right;
}

/* ── Site Header ───────────────────────────────────────── */
.site-header .site-branding {
    margin-right: 0;
    margin-left: auto;
}

.primary-navigation {
    margin-right: auto;
    margin-left: 0;
}

.primary-navigation ul {
    padding-right: 0;
    padding-left: 0;
}

.primary-navigation .menu-item a {
    padding: 0.5rem 1.2rem;
}

/* Submenu opens to the right in RTL */
.primary-navigation .sub-menu {
    right: 0;
    left: auto;
}

/* ── Menu Toggle (Mobile) ──────────────────────────────── */
.menu-toggle {
    margin-right: auto;
    margin-left: 0;
}

/* ── Cards & Grid ──────────────────────────────────────── */
.st-results-grid {
    direction: rtl;
}

.st-result-card {
    text-align: right;
}

.st-card-type-badge {
    float: right;
    margin-left: 0.5rem;
    margin-right: 0;
}

/* ── Filter Form ───────────────────────────────────────── */
.st-filter-form {
    direction: rtl;
}

.st-filter-group label {
    text-align: right;
}

/* ── Escrow Dashboard ──────────────────────────────────── */
.st-contract-card {
    direction: rtl;
    text-align: right;
}

.st-contract-parties {
    flex-direction: row-reverse;
}

.st-fin-row {
    flex-direction: row;
}

.st-fin-row span {
    text-align: right;
}

.st-fin-row strong {
    text-align: left;
}

/* ── Rating Stars ──────────────────────────────────────── */
.st-star-picker {
    direction: rtl;
    display: flex;
    flex-direction: row;
}

/* Pure CSS star rating (RTL — radio inputs reversed) */
.st-star-picker input[type="radio"] {
    display: none;
}

.st-star-picker label {
    font-size: 1.8rem;
    color: #ccc;
    cursor: pointer;
    transition: color 0.15s;
    order: -1; /* RTL visual ordering trick */
}

.st-star-picker input[type="radio"]:checked ~ label,
.st-star-picker label.hovered {
    color: #f5c518;
}

/* ── Profile Page ──────────────────────────────────────── */
.st-profile-rating-summary {
    flex-direction: row;
    gap: 0.5rem;
}

/* ── Sidebar ───────────────────────────────────────────── */
.widget-area {
    padding-right: 0;
    padding-left: 0;
    border-right: none;
    border-left: 1px solid var(--border-color, #e0e0e0);
    margin-right: 2rem;
    margin-left: 0;
}

/* ── Breadcrumbs ───────────────────────────────────────── */
.breadcrumb-separator {
    transform: scaleX(-1);
    display: inline-block;
}

/* ── Buttons ───────────────────────────────────────────── */
.st-btn + .st-btn {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* ── Footer ────────────────────────────────────────────── */
.footer-widgets {
    direction: rtl;
}

.footer-widget-area {
    text-align: right;
}

/* ── Contact info ──────────────────────────────────────── */
.st-contact-info {
    direction: ltr;  /* keep phone/email numbers LTR inside RTL context */
    text-align: left;
    display: inline-block;
}

/* ── Toast Notifications ───────────────────────────────── */
.st-toast {
    right: 1.5rem;
    left: auto;
}

/* ── Form Groups ───────────────────────────────────────── */
.st-form-group {
    text-align: right;
}

/* ── Meta / Badge ──────────────────────────────────────── */
.st-card-meta {
    direction: rtl;
}

/* ── WooCommerce RTL fixes ─────────────────────────────── */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    float: right;
    margin-left: 3.8%;
    margin-right: 0;
}

.woocommerce ul.products li.product:nth-child(3n),
.woocommerce-page ul.products li.product:nth-child(3n) {
    margin-left: 0;
}

.woocommerce ul.products li.product:nth-child(3n+1),
.woocommerce-page ul.products li.product:nth-child(3n+1) {
    clear: right;
}
