/*
 * Theme: Astra Child
 * File: account.css
 * Purpose: WooCommerce "My Account", login/register, navigation icons, Nextend social login
 * Split from: css/custom.css
 */

/* ===========================================
   Login/Register RTL Layout (Logged Out)
   =========================================== */

/* מיושר לימין כמו שצריך רק במצב לא מחובר */
body.woocommerce-account.rtl .woocommerce .u-columns {
    display: flex;
    flex-direction: row-reverse;
    gap: 50px;
    justify-content: space-between;
    text-align: right;
}

body.woocommerce-account.rtl .woocommerce .u-columns .col-1,
body.woocommerce-account.rtl .woocommerce .u-columns .col-2 {
    width: 48%;
}

@media (max-width: 768px) {
    body.woocommerce-account.rtl .woocommerce .u-columns {
        flex-direction: column;
    }
    body.woocommerce-account.rtl .woocommerce .u-columns .col-1,
    body.woocommerce-account.rtl .woocommerce .u-columns .col-2 {
        width: 100%;
    }
}

/* מיושר לימין לכל התוכן הפנימי */
body.woocommerce-account.rtl .woocommerce form,
body.woocommerce-account.rtl .woocommerce p,
body.woocommerce-account.rtl .woocommerce label {
    direction: rtl;
    text-align: right;
}

/* כפתורים לימין */
body.woocommerce-account.rtl .woocommerce button {
    float: right;
}

/* ===========================================
   Nextend Social Login
   =========================================== */

/* מיישר לימין את כפתור Nextend בכל מצב */
.nsl-container {
    text-align: right !important;
}
.nsl-container .nsl-button {
    display: inline-block;
}

/* ===========================================
   Hide Seller/Vendor Registration Options
   Only on /my-account/ register form
   =========================================== */

/* מסתיר את בחירת 'חשבון מוכר' בטופס הרשמה בדף החשבון שלי */
body.woocommerce-account .woocommerce form.register .user-role,
body.woocommerce-account .woocommerce form.register .dokan-seller-account-fields,
body.woocommerce-account .woocommerce form.register #dokan-seller-wrap {
    display: none !important;
}

/* ===========================================
   Mobile Login/Register Forms
   =========================================== */

/* סידור תצוגת החשבון שלי בגרסת מובייל */
@media (max-width: 768px) {

    /* ריווח פנימי מסביב לתוכן */
    .woocommerce form.login,
    .woocommerce form.register {
        width: 100% !important;
        padding: 0 24px !important;
        box-sizing: border-box;
    }

    /* יישור לימין אבל עם ריווח */
    .woocommerce form .form-row label {
        text-align: right;
        display: block;
        margin-right: 4px;
        margin-bottom: 6px;
        font-size: 15px;
    }

    /* שדות טקסט עם ריווח פנימי */
    .woocommerce form .input-text {
        padding: 12px 14px !important;
        font-size: 16px !important;
        border-radius: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    /* טאב התחברות/הרשמה */
    .u-columns.col2-set {
        flex-direction: column !important;
        gap: 40px;
    }

    .u-column1, .u-column2 {
        width: 100% !important;
    }

    /* לחצן התחברות */
    .woocommerce button.button {
        width: 100% !important;
        font-size: 16px;
        padding: 12px;
        background-color: #83b735 !important;
    }

    /* כפתור סושיאל */
    .nx-social-login-button {
        width: 100% !important;
        justify-content: center;
    }

    .nx-social-login-button img {
        margin-left: 8px;
    }

    /* אייקון עין */
    .woocommerce form .show-password-input {
        top: 38px !important;
        right: 12px !important;
        transform: scale(1.5);
    }
}

/* יישור כותרות התחברות/הרשמה לימין */
@media (max-width: 768px) {
    .woocommerce h2 {
        text-align: right !important;
        padding-right: 35px;
        font-size: 20px;
        margin-bottom: 16px;
    }
}

/* ===========================================
   My Account Content (Mobile)
   =========================================== */

/* עיצוב דף החשבון שלי למשתמש מחובר - - - לא חשבון מוכר */
@media (max-width: 768px) {

    /* שובר את המבנה לשני טורים מוערמים */
    .woocommerce-MyAccount-content .dokan-w8.left-content,
    .woocommerce-MyAccount-content .dokan-w4.right-content {
        width: 100% !important;
        float: none !important;
        box-sizing: border-box;
        text-align: right;
    }

    /* מסגרת יפה לבלוק ההצעה */
    .woocommerce-MyAccount-content .dokan-account-migration-lists {
        border: 1px solid #ddd;
        border-radius: 12px;
        padding: 20px 16px;
        margin-top: 32px;
        background-color: #f9f9f9;
    }

    /* טקסטים בבלוק – ריווח ונראות */
    .woocommerce-MyAccount-content .dokan-w8.left-content p {
        font-size: 15px;
        color: #444;
        line-height: 1.6;
        margin-bottom: 14px;
    }

    .woocommerce-MyAccount-content .dokan-w8.left-content p:first-of-type {
        font-weight: 600;
        font-size: 17px;
        color: #222;
    }

    /* כפתור "שדרוג חשבון" */
    .woocommerce-MyAccount-content .dokan-w4.right-content .btn.btn-primary {
        display: block;
        width: 100%;
        padding: 10px 16px;
        background-color: #4caf50 !important;
        color: #fff !important;
        font-size: 15px;
        border-radius: 8px;
        text-align: center;
        text-decoration: none;
        transition: background-color 0.3s ease;
        line-height: 1.4;
    }

    .woocommerce-MyAccount-content .dokan-w4.right-content .btn.btn-primary:hover {
        background-color: #45a047 !important;
    }
}

/* Upgrade button - all screen sizes */
.woocommerce-MyAccount-content .dokan-w4.right-content .btn.btn-primary {
    background-color: #4caf50 !important;
    color: #fff !important;
    border: none !important;
}

/* ===========================================
   My Account Navigation (Mobile)
   =========================================== */

/* שינוי תצוגת לוח בקרה של משתמש בגרסת מובייל */
@media (max-width: 768px) {
    .woocommerce-MyAccount-navigation ul {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 0;
        margin-bottom: 24px;
    }

    .woocommerce-MyAccount-navigation li {
        list-style: none;
    }

    .woocommerce-MyAccount-navigation li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        background-color: #f7f7f7;
        padding: 14px 6px;
        border-radius: 12px;
        font-size: 13px;
        color: #222;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.2s ease;
        text-align: center;
        min-height: 80px;
    }

    .woocommerce-MyAccount-navigation li a:hover {
        background-color: #eaeaea;
        transform: scale(1.02);
    }

    /* אייקונים – FontAwesome classes */
    .woocommerce-MyAccount-navigation-link--dashboard a::before {
        content: "\f015"; /* Home */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

    .woocommerce-MyAccount-navigation-link--orders a::before {
        content: "\f291"; /* Box */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

    .woocommerce-MyAccount-navigation-link--edit-address a::before {
        content: "\f3c5"; /* Map Pin */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

    .woocommerce-MyAccount-navigation-link--edit-account a::before {
        content: "\f007"; /* User */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

    .woocommerce-MyAccount-navigation-link--auctions-endpoint a::before {
        content: "\f6e3"; /* Hammer */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

    .woocommerce-MyAccount-navigation-link--customer-logout a::before {
        content: "\f2f5"; /* Sign-out */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
    }

    /* עיצוב אחיד לכל האייקונים */
    .woocommerce-MyAccount-navigation a::before {
        font-size: 20px;
        margin-bottom: 4px;
        display: block;
    }
}

/* Hide downloads link on mobile */
@media (max-width: 768px) {
    .woocommerce-MyAccount-navigation-link--downloads {
        display: none !important;
    }
}

/* ===========================================
   Password Toggle Icon (Mobile)
   =========================================== */

@media (max-width: 768px) {

    /* סידור אייקון של הסתרת הסיסמא בגרסת מובייל */
    .woocommerce form .show-password-input {
        position: absolute;
        top: 50%;
        left: 0.75rem; /* שמאל של שדה הסיסמה */
        transform: translateY(-50%);
        background: transparent;
        border: none;
        padding: 0;
        width: 24px;
        height: 24px;
        z-index: 2;
        cursor: pointer;
    }
}

/* מנקה הוראות מדיה-קוויריז או ברירת מחדל שדורשות right */
@media (max-width: 768px) {
    .woocommerce form .show-password-input {
        right: auto !important;
        left: 0.75rem !important;
        transform: translateY(-50%) !important;
    }
}

/* ===========================================
   Form Input Styling
   =========================================== */

/* עטיפת שדות דף החשבון שלי במסגרת עדינה לנראות טובה יותר */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea {
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 12px !important;
    box-shadow: none !important;
    background-color: #fff !important;
    transition: border-color 0.2s ease-in-out;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus {
    border-color: #a3a3a3 !important;
    outline: none !important;
}

/* ===========================================
   My Auctions Page (page-id-30433)
   =========================================== */

/* עיצוב כרטיסי מכרזים בעמוד "המכרזים שלי" בהתאם ל-endedactions */
body.page-id-30433 ul.products {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start !important; /* הצמד לימין */
    gap: 30px;
    direction: rtl;
}

body.page-id-30433 ul.products li.product {
    width: 100%;
    max-width: 250px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    text-align: right;
    transition: transform 0.2s ease;
    background: #fff;
}

body.page-id-30433 ul.products li.product:hover {
    transform: translateY(-4px);
}

body.page-id-30433 ul.products li.product img {
    max-height: 200px;
    object-fit: cover;
    border-radius: 6px;
}

/* יישור כותרת לטבלה בדף פעילות המכרזים שלי */
body.page-id-30433 .wp-block-heading {
    text-align: right;
    margin-right: 0;
}

body.page-id-30433 table.my_auctions_activity {
    margin-right: 0 !important;
    margin-left: auto !important;
    direction: rtl;
    text-align: right;
}

/* ===========================================
   Following Icon (Mobile)
   =========================================== */

/* תוספת אייקון למוכרים מועדפים בדף החשבון */
@media (max-width: 768px) {
    .woocommerce-MyAccount-navigation-link--following a::before {
        content: "\f005"; /* כוכב */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size: 20px;
        margin-bottom: 4px;
        display: block;
    }
}

/* ===========================================
   Mobile Navigation Buttons
   =========================================== */

@media (max-width: 768px) {
    /* כל הכפתורים במובייל */
    .woocommerce-MyAccount-navigation-link a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 20px;
        border: 1px solid #ddd;
        border-radius: 12px;
        background-color: #fff;
        height: 100%;
    }

    /* רק לכפתור המכרזים שלי נזריק אייקון */
    .woocommerce-MyAccount-navigation-link--auctions_activity a::before {
        content: '\f0e3'; /* Gavel */
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 22px;
        color: #000;
        margin-bottom: 5px;
        display: block;
    }

    /* שאר האייקונים שכבר קיימים (לא נוגעים בהם יותר) */
    .woocommerce-MyAccount-navigation-link i {
        font-size: 22px;
        color: #000;
        margin-bottom: 5px;
    }

    /* טקסט */
    .woocommerce-MyAccount-navigation-link span,
    .woocommerce-MyAccount-navigation-link a {
        font-size: 12px;
        color: #000;
        text-align: center;
    }

    /* כפתור פעיל */
    .woocommerce-MyAccount-navigation-link.is-active a {
        border-color: #fbbc34;
        box-shadow: 0 0 10px rgba(251, 188, 52, 0.5);
    }
}

