/* =========================================================
   صفحه‌ی تماس با ما - یک سبد
   کل فایل contact.css قبلی را با این جایگزین کنید.
   همه‌ی کلاس‌ها با پیشوند ct- هستند و با استایل‌های دیگر تداخل ندارند.
   ========================================================= */

.ct {
    --ct-ink: #14231f;
    --ct-soft: #5b6b66;
    --ct-leaf: #123a31;
    --ct-leaf-deep: #0c2923;
    --ct-straw: #f0b429;
    --ct-paper: #f7f8f5;
    --ct-line: #dfe5e0;
    --ct-danger: #c2342b;

    background: var(--ct-paper);
    color: var(--ct-ink);
    padding: 56px 0 72px;
}
.ct *, .ct *::before, .ct *::after { box-sizing: border-box; }

/* ───────── سربرگ ───────── */
.ct-head { margin-bottom: 36px; max-width: 620px; }
.ct-head h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 900;
    line-height: 1.5;
    color: var(--ct-ink);
}
.ct-head p {
    margin: 0;
    font-size: 16px;
    line-height: 2;
    color: var(--ct-soft);
}

/* ───────── کارت اصلی ───────── */
.ct-board {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 60px -36px rgba(18, 58, 49, .35);
}

/* فرم */
.ct-form { padding: clamp(24px, 4vw, 48px); }
.ct-form h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--ct-ink);
}
.ct-form > p {
    margin: 0 0 28px;
    font-size: 14.5px;
    color: var(--ct-soft);
}
.ct-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.ct-field { display: block; }
.ct-field.is-wide { grid-column: 1 / -1; }
.ct-field > span {
    display: block;
    margin-bottom: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ct-ink);
}
.ct .ct-input {
    width: 100%;
    display: block;
    padding: 0 16px;
    height: 52px;
    font-family: inherit;
    font-size: 15px;
    color: var(--ct-ink);
    background: var(--ct-paper);
    border: 1.5px solid var(--ct-line);
    border-radius: 12px;
    outline: 0;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.ct textarea.ct-input {
    height: auto;
    min-height: 150px;
    padding: 14px 16px;
    line-height: 2;
    resize: vertical;
}
.ct .ct-input:focus {
    background: #fff;
    border-color: var(--ct-leaf);
    box-shadow: 0 0 0 4px rgba(18, 58, 49, .12);
}
.ct .ct-input.is-invalid { border-color: var(--ct-danger); }
.ct-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--ct-danger);
}
.ct-ltr { direction: ltr; text-align: right; }
.ct-ltr::placeholder { text-align: right; }

.ct .ct-submit {
    margin-top: 22px;
    width: 100%;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 12px;
    background: var(--ct-leaf);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s, transform .15s, box-shadow .15s;
}
.ct .ct-submit:hover {
    background: var(--ct-leaf-deep);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -10px rgba(12, 41, 35, .6);
}
.ct .ct-submit:focus-visible { outline: 3px solid var(--ct-straw); outline-offset: 3px; }

.ct-alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14.5px;
    line-height: 1.9;
    background: #e9f5ee;
    color: #14583a;
}

/* ───────── پنل اطلاعات ───────── */
.ct-info {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--ct-leaf);
    color: #fff;
    padding: clamp(24px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.ct-info::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.5'%3E%3Crect x='2' y='2' width='20' height='9' rx='2'/%3E%3Crect x='2' y='13' width='20' height='9' rx='2'/%3E%3Crect x='26' y='2' width='9' height='20' rx='2'/%3E%3Crect x='37' y='2' width='9' height='20' rx='2'/%3E%3Crect x='2' y='26' width='9' height='20' rx='2'/%3E%3Crect x='13' y='26' width='9' height='20' rx='2'/%3E%3Crect x='26' y='26' width='20' height='9' rx='2'/%3E%3Crect x='26' y='37' width='20' height='9' rx='2'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 48px 48px;
}
.ct-info h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}
.ct-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.ct-list li { display: flex; gap: 16px; align-items: flex-start; }
.ct-ico {
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--ct-straw);
    color: var(--ct-leaf-deep);
    font-size: 20px;
}
.ct-list h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
}
.ct-list p, .ct-list a {
    display: block;
    margin: 0;
    font-size: 15px;
    line-height: 2;
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
}
.ct-list a:hover { color: var(--ct-straw); }
.ct-list a bdi { direction: ltr; unicode-bidi: isolate; }
.ct-tag {
    display: inline-block;
    margin-inline-start: 8px;
    padding: 1px 10px;
    border-radius: 999px;
    background: rgba(240, 180, 41, .18);
    color: var(--ct-straw);
    font-size: 12px;
    font-weight: 700;
}
.ct-basket {
    margin-top: auto;
    align-self: flex-start;
    width: 120px;
    color: var(--ct-straw);
    opacity: .9;
}

/* ───────── شعبه‌ها ───────── */
.ct-branches { margin-top: 56px; }
.ct-branches > h2 {
    margin: 0 0 22px;
    font-size: 22px;
    font-weight: 800;
    color: var(--ct-ink);
}
.ct-branch-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.ct-branch {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    border-radius: 18px;
    overflow: hidden;
    background: var(--ct-leaf);
    isolation: isolate;
}
.ct-branch img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.ct-branch::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(8, 28, 23, .85) 0%, rgba(8, 28, 23, 0) 60%);
}
.ct-branch:hover img { transform: scale(1.06); }
.ct-branch div {
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0;
    padding: 20px;
}
.ct-branch h3 {
    margin: 0 0 2px;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}
.ct-branch p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, .8);
}

/* ───────── ریسپانسیو ───────── */
@media (max-width: 991px) {
    .ct-board { grid-template-columns: 1fr; }
    .ct-basket { display: none; }
    .ct-branch-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
    .ct { padding: 36px 0 48px; }
    .ct-grid { grid-template-columns: 1fr; }
    .ct-branch-grid { gap: 12px; }
    .ct-branch { aspect-ratio: 1 / 1; }
    .ct-branch div { padding: 14px; }
    .ct-branch h3 { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
    .ct * { transition: none !important; }
}

/* =========================================================
   پیگیری پیام / گفتگوی تیکت
   ========================================================= */
.ct .tk { max-width: 760px; margin: 0 auto; }
.ct .tk-narrow { max-width: 520px; }
.ct .tk-card { border-radius: 24px; box-shadow: 0 30px 60px -36px rgba(18, 58, 49, .35); }

.tk-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
}
.tk-head h1 {
    margin: 0 0 8px;
    font-size: clamp(22px, 3.4vw, 30px);
    font-weight: 900;
    line-height: 1.6;
    color: var(--ct-ink);
}
.tk-head p { margin: 0; font-size: 14px; color: var(--ct-soft); }

.tk-badge {
    flex: none;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.tk-open     { background: #fdeccd; color: #8a5a00; }
.tk-answered { background: #e1f3e8; color: #14583a; }
.tk-closed   { background: #e8ebe9; color: #50605a; }

.tk-thread { display: grid; gap: 16px; margin-bottom: 28px; }
.tk-msg {
    max-width: 88%;
    padding: 16px 20px;
    border-radius: 18px;
    background: #fff;
    border: 1.5px solid var(--ct-line);
}
.tk-msg header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--ct-soft);
}
.tk-msg header strong { color: var(--ct-ink); font-size: 14px; }
.tk-msg p { margin: 0; font-size: 15px; line-height: 2.1; color: var(--ct-ink); word-break: break-word; }

/* پیام خود کاربر: سمت شروع (راست)؛ پاسخ پشتیبانی: سمت مقابل با رنگ برند */
.tk-msg.is-me { justify-self: start; border-end-start-radius: 6px; }
.tk-msg.is-admin {
    justify-self: end;
    background: var(--ct-leaf);
    border-color: var(--ct-leaf);
    border-end-end-radius: 6px;
}
.tk-msg.is-admin header, .tk-msg.is-admin header strong { color: rgba(255, 255, 255, .8); }
.tk-msg.is-admin header strong { color: var(--ct-straw); }
.tk-msg.is-admin p { color: #fff; }

.tk-reply {
    padding: clamp(20px, 3vw, 32px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px -36px rgba(18, 58, 49, .4);
}
.tk-closed {
    padding: 18px 20px;
    border-radius: 14px;
    background: #e8ebe9;
    color: #50605a;
    font-size: 14.5px;
    line-height: 2;
}

@media (max-width: 575px) {
    .tk-head { flex-direction: column; }
    .tk-msg { max-width: 100%; }
}
