/* Custom Header Builder - Quote Request Popup */

.chb-qp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 20, 0.6);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 280px 20px 40px;
    z-index: 2147483000 !important;
    opacity: 0;
    transition: opacity 0.2s ease;
    overflow-y: auto;
    /* מנסה למשוך את הפונט הגלובלי של Elementor, ואם לא קיים - יורש מהעמוד */
    font-family: var(--e-global-typography-text-font-family, var(--e-global-typography-primary-font-family, inherit));
}

.chb-qp-overlay.chb-qp-visible {
    display: flex;
    opacity: 1;
}

.chb-qp-overlay * {
    box-sizing: border-box;
    font-family: inherit;
}

.chb-qp-card {
    direction: rtl;
    text-align: right;
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.22), 0 4px 14px rgba(0, 0, 0, 0.08);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s ease;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chb-qp-overlay.chb-qp-visible .chb-qp-card {
    transform: translateY(0) scale(1);
}

/* כשיש תמונה - פריסה דו-טורית: תמונה ריבועית מימין, טופס משמאל (RTL) */
.chb-qp-card.chb-qp-has-image {
    flex-direction: row;
}

.chb-qp-overlay button.chb-qp-close {
    all: unset;
    box-sizing: border-box;
    position: absolute;
    top: 14px;
    left: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.92) !important;
    color: #5b605b !important;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.chb-qp-overlay button.chb-qp-close:hover {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

.chb-qp-product-image {
    display: none;
    flex: 0 0 240px;
    width: 240px;
    height: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #ffffff;
    align-self: stretch;
    align-items: flex-start;
    justify-content: center;
}

.chb-qp-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.chb-qp-form-side {
    flex: 1 1 auto;
    min-width: 0;
    padding: 36px 36px 30px;
    overflow-y: auto;
}

.chb-qp-heading {
    margin: 4px 0 6px;
    font-size: 21px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.3;
    text-align: center;
}

.chb-qp-sub {
    margin: 0 0 22px;
    font-size: 13px;
    color: #7c817c;
    line-height: 1.5;
    text-align: center;
}

.chb-qp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.chb-qp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chb-qp-field.chb-qp-full {
    grid-column: 1 / -1;
}

.chb-qp-field label {
    font-size: 12px;
    font-weight: 700;
    color: #3a3a3a;
}

.chb-qp-field input,
.chb-qp-field select,
.chb-qp-field textarea {
    all: unset;
    box-sizing: border-box;
    border: 1.5px solid #e6e8e6 !important;
    background-color: #f7f8f7 !important;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: #1a1a1a;
    width: 100%;
    resize: none;
    display: block;
    cursor: text;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.chb-qp-field select {
    cursor: pointer;
}

.chb-qp-field .chb-qp-file-input {
    padding: 9px 10px;
    font-size: 12.5px;
    cursor: pointer;
}

.chb-qp-field input::placeholder,
.chb-qp-field textarea::placeholder {
    color: #a7aca7;
}

.chb-qp-field input:focus,
.chb-qp-field select:focus,
.chb-qp-field textarea:focus {
    border-color: #2e9e2e !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(46, 158, 46, 0.14);
}

.chb-qp-overlay button.chb-qp-submit {
    all: unset;
    box-sizing: border-box;
    display: block;
    width: 100% !important;
    margin-top: 10px;
    background: linear-gradient(135deg, #37b137, #237a23) !important;
    color: #ffffff !important;
    text-align: center;
    border-radius: 11px;
    padding: 16px;
    font-size: 15.5px;
    font-weight: 800;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 12px 24px rgba(46, 158, 46, 0.3);
}

.chb-qp-overlay button.chb-qp-submit:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(46, 158, 46, 0.36);
}

.chb-qp-overlay button.chb-qp-submit:active {
    transform: translateY(0);
}

.chb-qp-overlay button.chb-qp-submit:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.chb-qp-status {
    margin: 14px 0 0;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}

.chb-qp-status.chb-qp-success {
    color: #237a23;
    font-weight: 700;
}

.chb-qp-status.chb-qp-error {
    color: #c0392b;
    font-weight: 700;
}

body.chb-qp-lock {
    overflow: hidden;
}

/* כשהמשתמש מחובר לוורדפרס, ה-Admin Bar תופס עוד מקום למעלה - נוסיף מרווח קטן */
body.admin-bar .chb-qp-overlay {
    padding-top: 312px;
}

@media (max-width: 700px) {
    .chb-qp-overlay {
        padding: 140px 14px 20px;
    }

    body.admin-bar .chb-qp-overlay {
        padding-top: 172px;
    }

    .chb-qp-card,
    .chb-qp-card.chb-qp-has-image {
        flex-direction: column;
        max-height: 88vh;
    }

    .chb-qp-product-image {
        width: 100%;
        flex: 0 0 auto;
        aspect-ratio: 16 / 9;
    }

    .chb-qp-form-side {
        padding: 30px 22px 24px;
    }

    .chb-qp-row {
        grid-template-columns: 1fr;
    }
}
