/* ===== Otobüs koltuk krokisi (site + panel ortak) ===== */
:root {
  --seat-male: #2f7bf5;
  --seat-male-bg: #dbe8ff;
  --seat-female: #e8468f;
  --seat-female-bg: #ffdcec;
  --seat-free: #ffffff;
  --seat-border: #c9cfd8;
  --seat-blocked: #aeb4bd;
  --seat-select: #10b981;
  --seat-size: 40px;
  --seat-gap: 6px;
}

.seatmap { container-type: inline-size; position: relative; }

.seat-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .82rem; color: #555; margin-bottom: .9rem; }
.seat-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.seat-legend i { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--seat-border); background: var(--seat-free); display: inline-block; }
.seat-legend i.l-male { background: var(--seat-male); border-color: var(--seat-male); }
.seat-legend i.l-female { background: var(--seat-female); border-color: var(--seat-female); }
.seat-legend i.l-sel-male { background: var(--seat-male-bg); border-color: var(--seat-male); box-shadow: 0 0 0 2px var(--seat-select); }
.seat-legend i.l-sel-female { background: var(--seat-female-bg); border-color: var(--seat-female); box-shadow: 0 0 0 2px var(--seat-select); }
.seat-legend i.l-blocked { background: repeating-linear-gradient(45deg, #e3e6ea 0 4px, #cfd3d9 4px 8px); border-color: #cfd3d9; }
.seat-legend i.l-pending { background: var(--seat-male); border-style: dashed; opacity: .55; }

.bus-scroll { text-align: center; overflow-x: auto; padding: 4px 2px 8px; -webkit-overflow-scrolling: touch; }

.bus {
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 18px;
  background: #f4f6f9;
  border: 3px solid #d5dae1;
  border-radius: 38px 38px 16px 16px;
  margin: 0 auto;
}

.bus__front { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px; border-bottom: 2px dashed #d5dae1; }
.bus__driver, .bus__door {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8a929c;
}
.bus__driver svg { width: 30px; height: 30px; }
.bus__door { border: 2px solid #c3c9d1; border-radius: 6px; padding: 6px 6px; background: #fff; }

.bus__grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--seat-size));
  grid-template-rows: repeat(var(--rows), var(--seat-size));
  gap: var(--seat-gap);
}

.bus__grid > * { grid-row: var(--r); grid-column: var(--c); }

.cell--aisle { display: flex; align-items: center; justify-content: center; font-size: .6rem; color: #b5bbc3; }
.cell--door {
  display: flex; align-items: center; justify-content: center;
  font-size: .55rem; font-weight: 700; color: #8a929c; text-transform: uppercase;
  border: 2px dashed #c3c9d1; border-radius: 6px; background: #fff;
}

.seat {
  position: relative;
  width: var(--seat-size); height: var(--seat-size);
  display: flex; align-items: center; justify-content: center;
  font: 700 .82rem/1 inherit; font-family: inherit;
  color: #3b4350; text-decoration: none;
  background: var(--seat-free);
  border: 2px solid var(--seat-border);
  border-radius: 9px 9px 6px 6px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
/* koltuk sırtı */
.seat::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: -2px; height: 5px;
  border-radius: 0 0 4px 4px; background: currentColor; opacity: .14;
}
.seat:hover:not(:disabled):not(.is-taken) { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, .1); border-color: var(--seat-select); }
.seat:focus-visible { outline: 3px solid var(--seat-select); outline-offset: 2px; }

.seat.is-taken.g-E { background: var(--seat-male); border-color: var(--seat-male); color: #fff; }
.seat.is-taken.g-K { background: var(--seat-female); border-color: var(--seat-female); color: #fff; }
.seat.is-taken { cursor: not-allowed; }
a.seat.is-taken { cursor: pointer; }
.seat.is-pending { opacity: .6; border-style: dashed; }
.seat.is-blocked {
  background: repeating-linear-gradient(45deg, #eceef1 0 5px, #dcdfe4 5px 10px);
  border-color: #d3d7dc; color: #9aa1aa; cursor: not-allowed;
}

.seat.is-selected { box-shadow: 0 0 0 3px var(--seat-select); border-color: var(--seat-select); background: #e7f8f1; }
.seat.is-selected.g-E { background: var(--seat-male-bg); border-color: var(--seat-male); color: #174ea6; }
.seat.is-selected.g-K { background: var(--seat-female-bg); border-color: var(--seat-female); color: #a1245d; }
.seat.is-assigning { animation: seat-pulse 1s infinite; }
.seat .seat__g { position: absolute; bottom: 1px; right: 3px; font-size: .55rem; font-weight: 800; }

@keyframes seat-pulse { 50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, .35); } }

a.seat.is-free { border-style: dashed; color: #9aa1aa; }
a.seat.is-free:hover { color: var(--seat-select); }

/* Önizleme (otobüs tipi formu) */
.seat.is-preview { cursor: default; }

/* ===== Yatay görünüm: geniş kapsayıcıda otobüs yan döner (ön taraf solda) ===== */
@container (min-width: 700px) {
  .bus { flex-direction: row; border-radius: 38px 16px 16px 38px; padding: 14px 18px 14px 14px; }
  .bus__front { flex-direction: column-reverse; padding: 4px 10px 4px 4px; border-bottom: 0; border-right: 2px dashed #d5dae1; }
  .bus__grid {
    grid-template-columns: repeat(var(--rows), var(--seat-size));
    grid-template-rows: repeat(var(--cols), var(--seat-size));
  }
  .bus__grid > * { grid-row: var(--hr); grid-column: var(--r); }
  .seat::before { left: -2px; right: auto; top: 4px; bottom: 4px; width: 5px; height: auto; border-radius: 0 4px 4px 0; }
}

/* ===== Koltuk seçim menüsü ===== */
.seat-pop {
  position: absolute; z-index: 30; min-width: 190px;
  background: #fff; border-radius: 14px; padding: 10px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .22), 0 0 0 1px rgba(15, 23, 42, .06);
}
.seat-pop__title { font-size: .8rem; font-weight: 700; color: #334; margin: 2px 4px 8px; }
.seat-pop__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seat-pop button {
  border: 0; border-radius: 10px; padding: 10px 8px; font: 700 .85rem inherit; font-family: inherit; cursor: pointer;
}
.seat-pop .pop-E { background: var(--seat-male-bg); color: #174ea6; }
.seat-pop .pop-K { background: var(--seat-female-bg); color: #a1245d; }
.seat-pop .pop-E:hover { background: var(--seat-male); color: #fff; }
.seat-pop .pop-K:hover { background: var(--seat-female); color: #fff; }
.seat-pop .pop-remove { grid-column: 1 / -1; background: #f1f3f5; color: #555; }
.seat-pop button:disabled { opacity: .4; cursor: not-allowed; }
.seat-pop__warn { font-size: .74rem; color: #b45309; background: #fff7e6; border-radius: 8px; padding: 6px 8px; margin-top: 8px; line-height: 1.35; }

/* ===== Yolcu satırları ===== */
.passenger-list { display: flex; flex-direction: column; gap: .7rem; }
.passenger {
  display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: start;
  padding: .75rem; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff;
}
.passenger.is-assigning { border-color: var(--seat-select); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.passenger__seat {
  width: 44px; height: 44px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; background: #eef1f4; color: #445; border: 2px solid transparent; cursor: default; padding: 0; font-family: inherit;
}
.passenger__seat small { font-size: .55rem; font-weight: 600; text-transform: uppercase; opacity: .75; }
.passenger__seat.g-E { background: var(--seat-male-bg); color: #174ea6; border-color: var(--seat-male); }
.passenger__seat.g-K { background: var(--seat-female-bg); color: #a1245d; border-color: var(--seat-female); }
button.passenger__seat { cursor: pointer; }
.passenger__fields { display: grid; grid-template-columns: 1fr; gap: .5rem; min-width: 0; }
.passenger__row2 { display: grid; grid-template-columns: auto 1fr; gap: .5rem; }
.passenger__row3 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.passenger__remove { border: 0; background: transparent; color: #9aa1aa; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.passenger__remove:hover { background: #fdecec; color: #dc2626; }

.gender-toggle { display: inline-flex; border: 1px solid #d9dde3; border-radius: 10px; overflow: hidden; }
.gender-toggle label { cursor: pointer; }
.gender-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.gender-toggle span { display: block; padding: .5rem .75rem; font-size: .82rem; font-weight: 700; color: #667; }
.gender-toggle input:checked + span.t-E { background: var(--seat-male); color: #fff; }
.gender-toggle input:checked + span.t-K { background: var(--seat-female); color: #fff; }
.gender-toggle input:focus-visible + span { outline: 2px solid var(--seat-select); outline-offset: -2px; }

.passenger-empty { padding: 1.2rem; border: 2px dashed #e1e4e8; border-radius: 14px; text-align: center; color: #7a818b; font-size: .9rem; }

@media (max-width: 600px) {
  .passenger { grid-template-columns: auto 1fr; }
  .passenger__fields { grid-column: 1 / -1; grid-row: 2; }
  .passenger__remove { justify-self: end; }
  .passenger__row2, .passenger__row3 { grid-template-columns: 1fr; }
  .gender-toggle { width: 100%; }
  .gender-toggle label { flex: 1; text-align: center; }
}
@media (max-width: 480px) {
  :root { --seat-size: 36px; --seat-gap: 5px; }
}
