/* ==========================================================
   خمات - مودال تسجيل الدخول / إنشاء حساب
   تصميم عصري بلون المتجر: #024F6D
   ========================================================== */

:root {
    --khamat-primary: #024F6D;
    --khamat-primary-dark: #013a51;
    --khamat-bg-field: #f4f6f7;
    --khamat-text: #16232a;
    --khamat-text-muted: #7c8a93;
    --khamat-border: #e7ebed;
}

.khamat-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6, 20, 27, 0.55);
    backdrop-filter: blur(3px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
}

.khamat-modal-overlay.active {
    display: flex;
    animation: khamatFadeIn 0.2s ease;
}

@keyframes khamatFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.khamat-modal-box {
    width: 100%;
    max-width: 430px;
    max-height: 92vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 22px;
    padding: 30px 28px 26px;
    position: relative;
    box-shadow: 0 24px 60px rgba(2, 20, 30, 0.28);
    animation: khamatSlideUp 0.28s cubic-bezier(.2,.8,.2,1);
}

@keyframes khamatSlideUp {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.khamat-modal-close {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--khamat-text-muted);
    cursor: pointer;
    line-height: 1;
    transition: 0.2s;
    background: var(--khamat-bg-field);
    border: none;
    border-radius: 22px 0 14px 0;
    z-index: 2;
}

.khamat-modal-close:hover {
    color: #fff;
    background: var(--khamat-primary);
}

.khamat-modal-logo {
    text-align: center;
    margin-bottom: 18px;
}

/* تبويبات - أسلوب Underline عصري */
.khamat-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--khamat-border);
    margin-bottom: 22px;
}

.khamat-tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--khamat-text-muted);
    font-size: 15px;
    font-weight: 600;
    padding: 10px 0 14px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    position: relative;
    top: 1px;
    border-bottom: 2px solid transparent;
}

.khamat-tab-btn.active {
    color: var(--khamat-primary);
    border-bottom: 2px solid var(--khamat-primary);
}

.khamat-panel { display: none; }
.khamat-panel.active { display: block; animation: khamatFadeIn 0.2s ease; }

.khamat-title {
    color: var(--khamat-text);
    font-size: 19px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 20px;
}

.khamat-field {
    width: 100%;
    background: var(--khamat-bg-field);
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    color: var(--khamat-text);
    margin-bottom: 12px;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
    transition: 0.2s;
}

.khamat-field:focus {
    background: #fff;
    border-color: var(--khamat-primary);
    box-shadow: 0 0 0 3px rgba(2, 79, 109, 0.12);
}

.khamat-field::placeholder { color: #9aa6ac; }

.khamat-submit-btn {
    width: 100%;
    background: var(--khamat-primary);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 15px 0;
    cursor: pointer;
    margin-top: 8px;
    transition: 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.khamat-submit-btn:hover {
    background: var(--khamat-primary-dark);
}

.khamat-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.khamat-msg {
    text-align: center;
    font-size: 13px;
    margin-top: 12px;
    min-height: 16px;
    line-height: 1.6;
}

.khamat-msg.error   { color: #d9433f; }
.khamat-msg.success { color: #1a9e5c; }

.khamat-switch-link {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--khamat-text-muted);
}

.khamat-switch-link a {
    color: var(--khamat-primary);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.khamat-switch-link a:hover { text-decoration: underline; }

/* لودر بسيط داخل الزر */
.khamat-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top: 2.5px solid #fff;
    border-radius: 50%;
    animation: khamatSpin 0.7s linear infinite;
}

.khamat-submit-btn.loading .khamat-btn-text { display: none; }
.khamat-submit-btn.loading .khamat-loader { display: block; }

@keyframes khamatSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .khamat-modal-box { padding: 26px 20px 22px; border-radius: 18px; }
}

/* ==========================================================
   إخفاء نافذة الدخول الجانبية الافتراضية لقالب Woodmart نهائيًا
   (استبدلناها بمودال خمات المخصص)
   ========================================================== */
.login-form-side,
.login-form-side.wd-opened,
.login-form-side.wd-side-hidden,
body .login-form-side {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* رابط نسيت كلمة المرور داخل نموذج الدخول */
.khamat-forgot-wrap {
    text-align: left;
    margin: -4px 0 16px;
}

.khamat-forgot-link {
    font-size: 13px;
    color: var(--khamat-text-muted);
    text-decoration: none;
}

.khamat-forgot-link:hover {
    color: var(--khamat-primary);
    text-decoration: underline;
}

/* ==========================================================
   إخفاء فورم تسجيل الدخول الافتراضي بصفحة الدفع (Checkout) —
   نبقي إشعار "عميل سابق؟ أنقر هنا لتسجيل الدخول" ظاهر لأن رابطه
   الآن يفتح مودال خمات (عبر JS)، بس نخفي الفورم القديم اللي كان
   ينزلق تحته لو ضغط المستخدم الرابط.
   ========================================================== */
.woocommerce-checkout .woocommerce-form-login {
    display: none !important;
}

/* ==========================================================
   تنسيق صفحة "نسيت كلمة المرور" الافتراضية بووكومرس
   لتتماشى مع هوية خمات بدل الخلفية السوداء الافتراضية
   ========================================================== */
.woocommerce-account .lost_reset_password {
    max-width: 420px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 22px;
    padding: 30px 28px;
    box-shadow: 0 10px 40px rgba(2, 20, 30, 0.08);
    direction: rtl;
    text-align: right;
}

.woocommerce-account .lost_reset_password .form-row label {
    color: var(--khamat-text);
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

/* ملاحظة السبام - عنصر منفصل تحت النص التوضيحي بصفحة نسيت كلمة المرور */
.woocommerce-account .lost_reset_password > p:first-child::after {
    content: "⚠ ملاحظة: إذا لم يصلك رابط إعادة تعيين كلمة السر، راجع السبام (البريد غير المهم).";
    display: block;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--khamat-border);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
    color: #d9433f;
}

.woocommerce-account .lost_reset_password input[type="text"] {
    width: 100%;
    background: var(--khamat-bg-field);
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: 0.2s;
}

.woocommerce-account .lost_reset_password input[type="text"]:focus {
    background: #fff;
    border-color: var(--khamat-primary);
    box-shadow: 0 0 0 3px rgba(2, 79, 109, 0.12);
}

.woocommerce-account .lost_reset_password button[type="submit"] {
    width: 100%;
    background: var(--khamat-primary);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 15px 0;
    cursor: pointer;
    margin-top: 8px;
    transition: 0.2s;
}

.woocommerce-account .lost_reset_password button[type="submit"]:hover {
    background: var(--khamat-primary-dark);
}