/* دکمه باز کردن فرم */
.jof-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: #151c24;
    color: #fff;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, opacity .2s;
}

.jof-open-btn:hover { transform: translateY(-2px); opacity: .92; }

/* مودال */
.jof-modal[hidden] { display: none; }

.jof-modal,
.jof-modal * { box-sizing: border-box; }

.jof-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.jof-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,20,28,.6);
}

.jof-box {
    position: relative;
    width: min(560px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 30px 70px rgba(0,0,0,.3);
    direction: rtl;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.jof-close {
    position: absolute;
    top: 12px;
    left: 14px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #f0f2f4;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.jof-box h2 { margin: 0 0 6px; font-size: 1.3rem; color: #151c24; }

.jof-sub {
    margin: 0 0 18px;
    color: #7c8896;
    font-size: .85rem;
    line-height: 1.9;
}

.jof-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.jof-grid > * { min-width: 0; }

.jof-field { display: flex; flex-direction: column; gap: 5px; }
.jof-full  { grid-column: 1 / -1; }

.jof-field span { font-size: .8rem; font-weight: 600; color: #151c24; }
.jof-field span b { color: #d33; }
.jof-field small { color: #7c8896; font-weight: 400; }

.jof-field input,
.jof-field select,
.jof-field textarea {
    width: 100%;
    max-width: 100%;
    padding: 11px 13px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 10px;
    background: #f7f8f9;
    font-family: inherit;
    font-size: .88rem;
    color: #151c24;
    transition: border-color .2s, background .2s;
}

.jof-field input:focus,
.jof-field select:focus,
.jof-field textarea:focus {
    outline: none;
    border-color: #f0b90d;
    background: #fff;
}

.jof-field input.has-error { border-color: #d33; }

/* فیلد ضد اسپم */
.jof-hp {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.jof-msg {
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: .85rem;
}

.jof-msg.is-ok  { background: rgba(60,180,100,.12); color: #1e7a42; }
.jof-msg.is-err { background: rgba(220,50,50,.1);  color: #b02a2a; }

.jof-submit {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px 20px;
    border: 0;
    border-radius: 12px;
    background: #f0b90d;
    color: #fff;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, opacity .2s;
}

.jof-submit:hover { transform: translateY(-2px); opacity: .92; }
.jof-submit[disabled] { opacity: .6; pointer-events: none; }

@media (max-width: 520px) {
    .jof-modal { padding: 10px; align-items: flex-end; }
    .jof-grid { grid-template-columns: 1fr; }
    .jof-box { padding: 22px 16px; border-radius: 18px; max-height: 94vh; }
    .jof-field input,
    .jof-field select,
    .jof-field textarea { font-size: 16px; }
}

/* ردیف دکمه‌ها: تماس بزرگ‌تر، سفارش کوچک‌تر */
.jof-cta-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 18px;
}

.jof-cta-row > a {
    flex: 1 1 auto;        /* دکمه تماس هر چی جا هست رو می‌گیره */
    width: auto;
    margin: 0;
    min-width: 0;
}

.jof-cta-row > .jof-open-btn {
    flex: 0 0 34%;         /* دکمه سفارش کوچک‌تر */
    margin: 0;
    padding: 12px 10px;
    font-size: .85rem;
}

@media (max-width: 420px) {
    .jof-cta-row { flex-direction: column; }
    .jof-cta-row > .jof-open-btn { flex-basis: auto; }
}