﻿
:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --accent: #0078ff;
    --accent-2: #ff4b4b;
    --muted: #6b7b8a;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(8,20,40,0.06);
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: 'Heebo',sans-serif;
    background: var(--bg);
    color: #123;
    min-height: 100vh
}

.app {
    max-width: 1180px;

    margin: 18px auto;
    padding: 20px
}

/* TOP: progress + back */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px
}

.steps {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer
}

.bullet {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eaf2ff;
    color: var(--muted);
    font-weight: 700;
    box-shadow: var(--shadow)
}

.step.active .bullet {
    background: var(--accent);
    color: #fff
}

.step.completed .bullet {
    background: #e6fff4;
    color: #0a7b4d
}

.connector {
    height: 6px;
    background: linear-gradient(90deg,#cfe3ff,#e9f8ff);
    flex: 1;
    border-radius: 6px
}

.step .label {
    font-weight: 700;
    color: #123c55
}

.back-link {
    background: transparent;
    border: 0;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer
}

/* pages */
.page {
    padding: 20px;
    margin:20px;
    display: none;
    background: transparent;
    animation: fade .28s ease
}

    .page.active {
        display: block
    }

@@keyframes fade {
    from {
        opacity: .1;
        transform: translateY(6px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

/* shared header */
.page h2 {
    margin: 6px 0 20px;
    font-size: 1.6rem;
    color: #122
}

/* PAGE1: Topics Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 18px;
    margin-bottom: 18px
}

@@media(max-width:1000px) {
    .grid {
        grid-template-columns: repeat(2,1fr)
    }
}

@@media(max-width:600px) {
    .grid {
        grid-template-columns: 1fr
    }
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    position: relative;
    transition: transform .18s ease,box-shadow .18s ease,border .18s ease
}

    .card:hover {
        transform: translateY(-6px)
    }

    .card img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        display: block
    }

.card-content {
    padding: 14px;
    text-align: center
}

.card-title {
    font-weight: 800;
    margin-bottom: 6px
}

.card-desc {
    color: var(--muted);
    font-size: 0.95rem
}

.card .check {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transform: scale(.8);
    opacity: 0;
    transition: all .22s ease;
    z-index: 10;
}

.card.selected {
    border: 3px solid var(--accent);
    box-shadow: 0 12px 30px rgba(0,120,255,0.12)
}

    .card.selected .check {
        opacity: 1;
        transform: scale(1)
    }

.subtitle {
    margin: 10px 0 8px;
    font-weight: 700;
    text-align: center
}

.action-row {
    text-align: center;
    margin-bottom: 40px
}

    .action-row .btn {
        display: inline-block;
        padding: 10px 26px;
        border-radius: 26px;
        border: 0;
        background: var(--accent-2);
        color: #fff;
        font-weight: 700;
        cursor: pointer;
        margin: 0 10px;
        opacity: .95
    }

.btn[disabled] {
    opacity: .45;
    cursor: not-allowed
}

/* PAGE2: Models Gallery */
.search-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px
}

    .search-row input {
        padding: 10px 12px;
        border-radius: 10px;
        border: 1px solid #e6eef7;
        flex: 1
    }

    .search-row .actions {
        display: flex;
        gap: 8px
    }

    .search-row button {
        padding: 10px 14px;
        border-radius: 10px;
        border: 0;
        background: var(--accent);
        color: #fff;
        cursor: pointer;
        font-weight: 700
    }

        .search-row button.secondary {
            background: transparent;
            border: 2px solid #e6eef7;
            color: #123
        }

.result-line {
    margin-bottom: 12px;
    color: var(--muted);
    font-weight: 600
}

.models {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 16px
}

@@media(max-width:1000px) {
    .models {
        grid-template-columns: repeat(2,1fr)
    }
}

@@media(max-width:600px) {
    .models {
        grid-template-columns: 1fr
    }
}

.model {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .18s ease,box-shadow .18s ease,border .18s ease
}

    .model:hover {
        transform: translateY(-6px)
    }
    /* תמונות מרובעות יותר */
    .model img {
        width: 100%;
      max-height : 370px;
        object-fit: cover
    }

    .model .meta {
        padding: 10px 12px;
        border-top: 1px solid #f0f6fb
    }

    .model .row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 700
    }

    .model .name {
        direction: rtl;
        text-align: right
    }

    .model .code {
        direction: ltr;
        text-align: left;
        color: var(--muted);
        font-weight: 700
    }

    .model .desc {
        margin-top: 8px;
        color: var(--muted);
        font-size: 0.95rem
    }

    .model .hover-btn {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%) scale(.9);
        z-index: 5;
        padding: 10px 18px;
        border-radius: 999px;
        background: var(--accent);
        color: #fff;
        border: 0;
        font-weight: 800;
        cursor: pointer;
        opacity: 0;
        transition: all .18s ease
    }

    .model:hover .hover-btn {
        opacity: 1;
        transform: translate(-50%,-50%) scale(1)
    }

    .model .check {
        position: absolute;
        top: 12px;
        left: 12px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: var(--accent);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        transform: scale(.8);
        opacity: 0;
        transition: all .22s ease;
        z-index: 10;
    }

    .model:hover .check, .model.selected .check {
        opacity: 1;
        transform: scale(1);
    }

    .model.selected {
        border: 3px solid var(--accent);
        box-shadow: 0 12px 30px rgba(0,120,255,0.12);
    }

.bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px
}

.back-to-topic {
    background: transparent;
    border: 0;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer
}

/* PAGE3, PAGE4, PAGE5 Layout: Two-column grid for forms */
.page-grid {
    display: grid;
    /*grid-template-columns: 1fr 1fr;*/
    grid-template-columns: 70% 30%; /* הגדרת הפיצול ל-70%/30% */
    gap: 20px
}

@media(max-width:800px) {
    .page-grid {
        grid-template-columns: 1fr
    }
}

.preview-card, .form-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px
}

    .preview-card img {
        width: 100%;
        border-radius: 10px;
        margin-bottom: 10px
    }

.preview-summary {
    margin-bottom: 10px;
    font-weight: 600;
    color: #123c55;
    text-align: center
}

.summary-line {
    margin-bottom: 20px;
    text-align: center;
    color: #6b7b8a;
    font-weight: 600
}

/* Form Elements */
.form-section {
    margin-bottom: 18px
}

    .form-section h4 {
        margin: 0 0 8px;
        font-size: 1rem;
        color: #123c55
    }

.size-options {
    display: flex;
    gap: 10px
}

.size-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #ccd9e8;
    cursor: pointer;
    font-weight: 700;
    text-align: center
}

    .size-btn.selected {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent)
    }

.row-inline {
    display: flex;
    gap: 8px;
    align-items: center
}

    .row-inline input, .row-inline select, .form-card select, .form-card textarea {
        padding: 8px;
        border: 1px solid #ccd9e8;
        border-radius: 8px
    }

    .row-inline .small {
        width: 60px;
        text-align: center
    }




   

.qty-section {
    margin-top: 10px
}

.qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px
}

    .qty-row .color-dot {
        width: 22px;
        height: 22px;
        border-radius: 50%
    }

    .qty-row input {
        width: 70px;
        text-align: center;
        padding: 5px;
        border: 1px solid #ccd9e8;
        border-radius: 6px
    }

.reset-btn {
    background: transparent;
    border: 0;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.9rem
}

.total-line {
    font-weight: 700;
    text-align: right;
    margin-top: 10px
}

/* Buttons */
.continue-btn {
    margin-top: 10px;
    background: var(--accent-2);
    color: #fff;
    padding: 10px 24px;
    border-radius: 999px;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    float: left
}

.primary-upload {
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    border: 0;
    font-weight: 700;
    cursor: pointer
}

.radio-label {
    font-size: 0.95em
}

/* PAGE5 Summary Table (New) */
.summary-table-container {
    padding: 15px;
    background: #fcfcfc;
    border-radius: 10px;
    border: 1px solid #eee;
}

.summary-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95em;
    padding-bottom: 5px;
    border-bottom: 1px dashed #eee;
}

    .summary-detail.total {
        font-weight: 700;
        font-size: 1.1em;
        color: var(--accent-2);
        border-top: 2px solid #ccc;
        margin-top: 15px;
        padding-top: 10px;
    }

    .summary-detail span:last-child {
        color: #123c55;
    }

.color-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

/* PAGE6: Product Card Customization */
#recommendationsGrid .model {
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: border 0.2s ease-in-out;
}

    #recommendationsGrid .model img {
        height: 180px; /* Bigger image for product card */
        object-fit: contain; /* Ensure full product visibility */
        background: #fdfdfd;
    }

    #recommendationsGrid .model:hover {
        transform: none; /* Disable lift effect */
        border: 3px solid var(--accent); /* Border on hover, as requested */
    }

#recommendationsGrid .meta .desc {
    min-height: 2.5em; /* Ensure uniform height for card descriptions */
}

.add-to-cart-btn {
    padding: 6px 12px !important;
    font-size: 0.9em;
}

/* יש להוסיף לקובץ ה־CSS שלך, או ל־<style> ב־Orders.cshtml */
.result-line-container {
    display: flex; /* מפעיל את Flexbox */
    justify-content: space-between; /* דוחף את התוכן לקצוות */
    align-items: center;
    margin-bottom: 15px;
    width: 100%; /* ודא שהוא תופס את כל הרוחב */
}

/* שורת התוצאות (מימין) */
#resultLine {
    font-weight: 500;
    color: var(--muted);
    /* אין צורך ב־flex-grow, הוא יישאר מימין */
}

/* הודעת השגיאה (משמאל) */
#searchErrorMsg {
    /* מאפשר לאלמנט לתפוס את המרווח שנוצר וליישר את הטקסט לשמאל */
    flex-grow: 1;
    text-align: left;
    padding-left: 10px; /* מרווח מהמרכז */
}
/* מבנה חדש לרינדור אפשרויות הצבע */
.color-options {
    display: flex;
    gap: 15px; /* מרווח בין אפשרויות הצבע */
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: center;
}

/* עטיפה לכל אפשרות צבע (שם + עיגול) */
.color-option-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

    /* שם הצבע (שינוי 2) */
    .color-option-wrapper .color-name {
        font-size: 0.85em;
        font-weight: 500;
        color: var(--text-color, #333);
        margin-bottom: 5px; /* מרווח בין השם לעיגול */
        white-space: nowrap;
    }

/* העיגול עצמו (נשאר דומה, אבל הבחירה עוברת ל-wrapper) */
.color-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid transparent; /* ברירת מחדל: גבול שקוף */
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}
    .color-circle.selected {
        border-color: var(--accent-2);
        box-shadow: 0 0 0 2px #ffbcbc
    }
/* הדגשת הבחירה על העטיפה */
.color-option-wrapper.selected .color-circle {
    border-color: var(--accent); /* צבע ההדגשה */
    transform: scale(1.1);
}

/* סימן ה-V בתוך העיגול */
.color-circle .check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 1.2em;
    display: none; /* הסתרה בברירת מחדל */
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* הצגת סימן ה-V רק כשנבחר */
.color-option-wrapper.selected .color-circle .check {
    display: block;
}
.color-option-wrapper {
    display: flex;
    flex-direction: column; /* שם הצבע מעל העיגול */
    align-items: center;
    gap: 5px; /* מרווח בין השם לעיגול */
    cursor: pointer; /* כדי שכל הבלוק יהיה לחיץ, במקום רק העיגול */
}

.color-name {
    font-size: 0.85em;
    font-weight: 500;
    text-align: center;
    white-space: nowrap; /* מונע שבירת שורה בשם */
    color: #333;
}
/* סימון השם הנבחר */
.color-circle.selected + .color-name { /* זה לא יעבוד עם המבנה החדש, נטפל ב-JS */
    /* נגדיר את זה ישירות ב-JS */
}
/* CSS חדש עבור שורות הכמות */
.qty-row {
    display: flex;
    justify-content: space-between; /* דוחף את שדה הכמות לשמאל */
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

    .qty-row:last-child {
        border-bottom: none;
    }
/* CSS לניהול התמונה בשלב 3 */
#page3Image {
    max-height: 500px; /* הגובה המקסימלי שביקשת */
    width: auto;
    display: block;
    margin: 10px auto;
    border: 1px solid #ddd;
    border-radius: 5px;
}
/* CSS לסימון שדות קלט שגויים */
.error-input {
    border: 2px solid red !important; /* גבול אדום לשגיאה */
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5); /* צל אדום */
}
/* CSS לסימון מחיר יחידה שגוי */
.error-price {
    color: red !important; /* צובע את הטקסט באדום */
    font-weight: bold;
    text-decoration: underline; /* מוסיף קו תחתון להדגשה */
}
/* CSS לסימון כל שורת הסיכום (totalLine) כאשר יש שגיאת מחיר */
.error-total-line {
    background-color: #ffebeb; /* רקע אדום בהיר */
    border: 1px solid red; /* גבול אדום */
    padding: 5px; /* מרווח פנימי לשפר מראה */
    border-radius: 4px; /* פינות מעוגלות קלות */
}
/* כלל CSS לכפתורים במצב מושבת (Disabled) */
.primary-upload:disabled {
    background-color: var(--muted-light, #ccc) !important; /* אפור בהיר */
    color: var(--muted, #666); /* טקסט אפור כהה */
    cursor: not-allowed;
    border: 1px solid var(--muted-dark, #aaa);
    box-shadow: none;
}
/* אם הכפתור הכחול שלך נקרא .continue-btn */
.continue-btn:disabled {
    background-color: var(--muted-light, #ccc) !important;
    color: var(--muted, #666);
    cursor: not-allowed;
}


/* ======================================================= */
/* כפתור SWITCH מודרני - CSS מתוקן */
/* ======================================================= */

/* 1. קונטיינר ראשי (מבטיח שהטקסט והמתג זה לצד זה) */
.form-group.switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    gap: 15px; /* מרווח בין הטקסט למתג */
}

/* 2. הטקסט: תופס את כל המקום שנותר */
.switch-text-label {
    flex-grow: 1; /* יתפוס את כל הרוחב הפנוי */
    font-size: 1em;
    color: var(--text-color, #333);
}

/* 3. עטיפת המתג (Switch Control) */
.switch-control {
    position: relative;
    display: inline-block;
    width: 40px; /* רוחב המתג */
    height: 20px; /* גובה המתג */
    cursor: pointer;
}

/* הסתרת תיבת הסימון המקורית */
.modern-switch {
    opacity: 0;
    width: 0;
    height: 0;
}

/* 4. יצירת המעטפת של המתג (הפס) */
.switch-control::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ccc; /* צבע כבוי */
    border-radius: 10px;
    transition: background-color 0.4s;
}

/* 5. יצירת ה"ידית" של המתג (הכפתור העגול) */
.switch-control::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px; /* מיקום התחלתי (כבוי) */
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.4s, box-shadow 0.4s;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* 6. מצב פעיל (CHECKED) */
/* משתמשים ב- :checked בתוך ה-label כדי לשנות את ה-:before וה-:after של ה-label */
.modern-switch:checked + .switch-control::after {
    background-color: var(--accent, #007bff); /* צבע מופעל */
}

.modern-switch:checked + .switch-control::before {
    /* הזזת הידית ימינה (לצד שמאל, בכיוון RTL) */
    transform: translateX(20px);
}

/* סגנונות מותאמים לטבלת פירוט מחירים */
.price-breakdown-container {
    padding: 10px 0;
    margin-top: 15px;
}

.price-breakdown-container .breakdown-title {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
}

.price-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 10px;
    font-size: 0.95em;
}

    .price-detail-row .price-label {
        flex: 3;
        text-align: right;
    }

    .price-detail-row .price-value {
        flex: 2;
        text-align: center;
        font-weight: normal;
        color: #555;
    }

    .price-detail-row .price-total {
        flex: 1;
        text-align: left;
        font-weight: bold;
        color: #123c55;
    }

.breakdown-final-total {
    border-top: 2px solid #ccc;
    padding-top: 8px !important;
    margin-top: 5px;
}
