/* ===============================
   Base Layout
================================ */
.train-search-module {
    display: flex;
    justify-content: center;
 
}

.train-search-card {
width: 100%;
  max-width: 1200px;
  background: linear-gradient(90deg,#ffffffd4,#ffffffd9);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.48);
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 2fr 2fr 1.5fr 2fr;
  gap: 12px;
  align-items: end;
  backdrop-filter: blur(11.7463px);
}

/* ===============================
   Top Row
================================ */
/* ===============================
   FIX TOP ROW (FINAL)
================================ */
.ts-top-row {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Trip type pills */
.ts-trip-type {
    display: flex;
    gap: 8px;
}

.ts-trip-type label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 999px;
    background: #f3f5f9;
    border: 1px solid #e0e3e7;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.ts-trip-type input {
    display: none;
}

.ts-trip-type label:has(input:checked) {
background: #c5a370;
  color: #fff;
  border-color: #002469;
}

/* Private checkbox */
.ts-private {
    display: flex;
    align-items: center;
}

.ts-private label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.ts-private input {
    accent-color: #0077ff;
}

/* ===============================
   Fields
================================ */
.ts-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.ts-field label {
    font-size: 13px;
    color: #333;
}

.ts-field input,
.ts-field select,
.ts-search-btn {
    height: 46px;
    padding: 0 12px;
    border: 1px solid #dcdfe3;
    border-radius: 12px;
    font-size: 13px;
    background: #fff;
    width: 100%;
}

/* ===============================
   Joined Dates (FIXED)
================================ */
.ts-go-date-field input {
    border-radius: 0 12px 12px 0;
    border-left: none;
}

.ts-return-date-field input {
    border-radius: 12px 0 0 12px;
}

.ts-return-date.disabled {
    opacity: .5;
}

/* ===============================
   Passengers (FIXED WIDTH)
================================ */
.ts-passengers-field {
    position: relative;
    min-width: 0;
}

.ts-passengers-input {
    cursor: pointer;
}

.ts-passengers-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
    padding: 16px;
    display: none;
    z-index: 9999;
}

.ts-passengers-wrap.open .ts-passengers-panel {
    display: block;
}

.ts-passenger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.ts-counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ts-counter button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eef1f5;
    cursor: pointer;
    font-size: 18px;
}

/* ===============================
   Submit Button (NO WRAP)
================================ */
.ts-search-btn {
    background: linear-gradient(135deg,#01163e,#002469);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 46px;
    text-align: center;
    padding: 0;
}
/* ===============================
   Mobile Layout
================================ */
@media (max-width: 768px) {

    .train-search-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Row بالا */
    .ts-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ts-trip-type {
        flex-wrap: wrap;
    }

    .ts-private {
        align-self: flex-start;
    }

    /* فیلدها */
    .ts-origin-field,
    .ts-destination-field,
    .ts-go-date-field,
    .ts-return-date-field,
    .ts-passengers-field,
    .ts-passenger-type-field,
    .ts-submit {
        grid-column: span 1;
    }

    /* تاریخ‌ها در موبایل */
    .ts-go-date-field input,
    .ts-return-date-field input {
        border-radius: 12px;
        border-left: 1px solid #dcdfe3;
    }

    /* پنل مسافران */
    .ts-passengers-panel {
        width: 100%;
        right: 0;
        left: 0;
    }

    /* دکمه جستجو */
    .ts-search-btn {
        height: 50px;
        font-size: 15px;
    }
}
