/* Phone layout for the trip publish and search flow. Loaded after the compiled pack. */

.brand-wordmark {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.navbar-brand .brand-wordmark {
  color: inherit;
  font-size: 1.25rem;
}

.splashscreen .brand-wordmark {
  color: #fff;
}

/* 360, 390 and 430 px share this phone header size. */
@media (max-width: 430px) {
  .navbar-brand .brand-wordmark {
    font-size: 1.15rem;
  }
}

.trip-cost {
  overflow-wrap: anywhere;
}

@media (max-width: 430px) {
  .form-control--short,
  .trip-cost {
    max-width: 100%;
  }

  .form-control--short {
    width: 100%;
  }
}

.home-languages {
  margin-top: 1rem;
}

.home-languages__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0 0.5rem;
  color: #fff;
}

.form-control,
.form-control-lg,
.btn {
  max-width: 100%;
}

.trip-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
}

.trip-result-fare {
  font-weight: 700;
}

@media (max-width: 767.98px) {
  .splashscreen__container h2 {
    font-size: 2.25rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .navbar-toggler {
    min-width: 44px;
    min-height: 44px;
  }

  .main-navbar .navbar-collapse .nav-item {
    width: 100%;
  }

  .main-navbar .navbar-collapse .nav-link,
  .main-navbar .navbar-collapse .btn {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    margin-bottom: 0.25rem;
  }

  .form-control,
  .form-control-lg,
  input,
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
  }

  /* Checkboxes and radios keep their shape (consent on registration, trip choice in an offer);
     the label next to them stays the touch target. */
  .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    min-height: 0;
  }

  .btn-lg,
  .form-control-lg {
    min-height: 48px;
  }

  .poputchik-map,
  .google-maps,
  .google-static-map,
  #index-itineraries-map {
    max-width: 100%;
    overflow: hidden;
  }

  .table-responsive {
    max-width: 100%;
  }

  .trip-fact--price .trip-result-fare,
  .trip-result-fare {
    font-size: 1.35rem;
  }

  .trip-result-seats {
    font-size: 1.05rem;
  }
}

/* Trip route map (P4.2) */
.route-map-canvas {
  width: 100%;
  height: 320px;
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
  background: #eef2f5;
}

@media (max-width: 575.98px) {
  .route-map-canvas {
    height: 260px;
  }
}

/* P5.2 cabin seat maps: one cell per seat, driver or aisle; 44 px touch targets. */
.cabin-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.cabin {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 2px solid #adb5bd;
  border-radius: 28px 28px 10px 10px;
  background: #f8f9fa;
}
.cabin-front {
  text-align: center;
  font-size: 0.8rem;
  color: #6c757d;
}
.cabin-row {
  display: grid;
  grid-template-columns: repeat(var(--cabin-columns), 44px);
  gap: 6px;
}
.cabin-cell {
  width: 44px;
  height: 44px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}
.cabin-driver {
  background: #495057;
  color: #fff;
  font-size: 0.7rem;
}
.cabin-seat {
  position: relative;
  border: 2px solid transparent;
}
label.cabin-seat {
  cursor: pointer;
}
.cabin-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.cabin-input:disabled {
  cursor: not-allowed;
}
.cabin-seat--free {
  background: #d1e7dd;
  border-color: #198754;
  color: #0f5132;
}
.cabin-seat--selected,
.cabin-seat:has(.cabin-input[name="seat_ids[]"]:checked) {
  background: #0d6efd;
  border-color: #0a58ca;
  color: #fff;
}
.cabin-seat--taken {
  background: #f8d7da;
  border-color: #dc3545;
  color: #842029;
}
.cabin-seat--disabled {
  background: #e9ecef;
  border-color: #ced4da;
  border-style: dashed;
  color: #6c757d;
}
.cabin-seat:has(.cabin-input:focus-visible) {
  outline: 3px solid #ffc107;
  outline-offset: 2px;
}
.cabin-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 8px 0 0;
}
.cabin-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cabin-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-radius: 4px;
}
@media (max-width: 400px) {
  .cabin {
    padding: 6px;
    gap: 4px;
  }
  .cabin-row {
    gap: 4px;
  }
}

/* P5.3: seat states differ by more than colour — taken is striped and crossed, selected is
   ticked, unavailable is hatched with a dashed border. */
.cabin-seat--taken {
  background-image: repeating-linear-gradient(135deg, rgba(220, 53, 69, 0.18) 0 4px, transparent 4px 8px);
}
.cabin-seat--taken::after,
.cabin-seat--selected::after,
.cabin-seat:has(.cabin-input[name="seat_ids[]"]:checked)::after {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 0.7rem;
  line-height: 1;
}
.cabin-seat--taken::after {
  content: "✕";
}
.cabin-seat--selected::after,
.cabin-seat:has(.cabin-input[name="seat_ids[]"]:checked)::after {
  content: "✓";
  color: #fff;
}
.cabin-seat--disabled {
  background-image: repeating-linear-gradient(45deg, rgba(108, 117, 125, 0.25) 0 2px, transparent 2px 6px);
}
.cabin-swatch.cabin-seat--taken::after,
.cabin-swatch.cabin-seat--selected::after {
  content: none;
}

/* Trip lifecycle badges */
.trip-state { color: #fff; }
.trip-state--planned { background: #6c757d; }
.trip-state--ready { background: #0d6efd; }
.trip-state--in_progress { background: #fd7e14; }
.trip-state--completed { background: #198754; }
.trip-state--cancelled { background: #dc3545; }
.trip-state--expired { background: #495057; }

/* Reviews: star picker (radio buttons, works without JavaScript), stars and ratings */
.review-stars { border: 0; padding: 0; margin-left: 0; margin-right: 0; }
.review-stars__options {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.25rem;
}
.review-stars__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.review-stars__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.25rem;
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  cursor: pointer;
  color: #adb5bd;
  user-select: none;
}
.review-stars__star { font-size: 1.75rem; line-height: 1; }
.review-stars__value { font-size: 0.8rem; color: #495057; }
.review-stars__input:checked ~ .review-stars__label,
.review-stars__label:hover,
.review-stars__label:hover ~ .review-stars__label {
  color: #f0a500;
  border-color: #f0a500;
}
.review-stars__input:focus-visible + .review-stars__label {
  outline: 3px solid #0d6efd;
  outline-offset: 2px;
}
.review-rating { color: #f0a500; letter-spacing: 0.05em; white-space: nowrap; }
.reputation-average { white-space: nowrap; }
.reputation-none { color: #6c757d; }
.review-done { background: #198754; color: #fff; }
.admin-review--hidden { opacity: 0.7; border-style: dashed !important; }

/* Complaints (P6.1) */
.complaint-link { text-decoration: underline; }
.complaint-status { color: #fff; }
.complaint-status--open { background: #fd7e14; }
.complaint-status--resolved { background: #198754; }
.complaint-status--rejected { background: #6c757d; }

/* Legal drafts (P6.2) */
.legal-document { max-width: 50rem; }
.legal-document h2 { margin-top: 1.5rem; }
.legal-owner-decision { background: #fff3cd; color: #664d03; padding: 0 0.2em; border-radius: 0.2rem; }

/* Vehicle form: every passenger seat is a button that switches with one press. */
button.cabin-seat {
  padding: 0;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button.cabin-seat--disabled .cabin-label,
label.cabin-seat--disabled .cabin-label {
  text-decoration: line-through;
}
button.cabin-seat:focus-visible {
  outline: 3px solid #ffc107;
  outline-offset: 1px;
}

/* Out of service in the vehicle itself, unlike a seat closed for one trip. */
.cabin-seat--fixed {
  background: #6c757d;
  border-color: #495057;
  color: #fff;
  cursor: not-allowed;
}

/* Vehicle photos */
.vehicle-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vehicle-photo-card { border: 2px solid #dee2e6; border-radius: 10px; padding: 6px; }
.vehicle-photo-card--main { border-color: #198754; }
.vehicle-photo-thumb { display: block; width: 100%; max-width: 320px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #e9ecef; }
.vehicle-photo-badge { color: #0f5132; font-weight: 700; text-align: center; }
.vehicle-gallery-row { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; }
.vehicle-gallery-row a { flex: 0 0 70%; max-width: 280px; scroll-snap-align: start; }
.vehicle-photo-viewer { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; }
.vehicle-photo-viewer::backdrop { background: rgba(0, 0, 0, 0.85); }
.vehicle-photo-viewer img { display: block; max-width: 100vw; max-height: 100vh; object-fit: contain; }

/* Menu counts (NavigationHelper#nav_counted_link): a small number after the link text, never wider than the menu. */
.main-navbar .nav-link--counted {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.main-navbar .nav-count {
  min-width: 1.5rem;
  padding: 0.2em 0.5em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bs-white, #fff);
  background-color: var(--bs-secondary, #6c757d);
}

/* A highlighted count of new offers next to «Мої заявки». */
.main-navbar .nav-count--new {
  color: #212529;
  background-color: var(--bs-warning, #ffc107);
}

/* «Нова пропозиція» next to a request status (the Bootstrap badge component is not compiled in). */
.request-new-offer {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.2em 0.6em;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* «Мої дії» (MVP navigation): one tappable row per section, its count on the right. The Bootstrap
   list-group and badge components are not compiled in, so the rows get their own style. */
.my-actions .list-group {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.5rem;
  overflow: hidden;
}
.my-actions .list-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  color: var(--bs-body-color, #212529);
  text-decoration: none;
  background-color: var(--bs-body-bg, #fff);
}
.my-actions .list-group-item + .list-group-item { border-top: 1px solid var(--bs-border-color, #dee2e6); }
.my-actions .list-group-item:hover, .my-actions .list-group-item:focus { background-color: var(--bs-tertiary-bg, #f8f9fa); }
.my-actions .nav-count {
  min-width: 1.5rem;
  margin-left: auto;
  padding: 0.2em 0.5em;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--bs-white, #fff);
  background-color: var(--bs-secondary, #6c757d);
}
.my-actions .nav-count--new { margin-left: 0; color: #212529; background-color: var(--bs-warning, #ffc107); }

/* Profile photo (P0): a small round picture before a name, a larger one in the settings. */
.user-avatar {
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-right: 0.35rem;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  background-color: var(--bs-tertiary-bg, #f8f9fa);
}
.user-avatar--large { width: 96px; height: 96px; margin-right: 0; }
img.user-avatar {
  width: 28px;
  height: 28px;
  max-width: 28px;
}
img.user-avatar.user-avatar--profile {
  width: 72px;
  height: 72px;
  max-width: 72px;
  margin-right: 0;
}
img.user-avatar.user-avatar--large {
  width: 96px;
  height: 96px;
  max-width: 96px;
  margin-right: 0;
}
@media (max-width: 575.98px) {
  .profile-photo-settings .d-flex {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Public profile: compact header. Photo upload stays in the account settings. */
.profile-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.profile-header h1 {
  margin: 0 0 0.15rem;
  font-size: 1.35rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.profile-since {
  margin: 0;
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.875rem;
}
.profile-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
}
.profile-header-actions a,
.profile-settings-link { font-size: 0.875rem; }
.profile-bio {
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}
.public-profile .profile-section { margin-bottom: 1.25rem; }
.public-profile .profile-section h2 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}
.profile-reputation-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 576px) {
  .profile-reputation-list { grid-template-columns: 1fr 1fr; }
}
.profile-reputation-list li {
  margin: 0;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.5rem;
  overflow-wrap: anywhere;
}
.profile-trip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-height: 2.75rem;
}
.profile-trip-route { font-weight: 600; overflow-wrap: anywhere; }
.profile-trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.875rem;
}
.profile-empty { color: var(--bs-secondary-color, #6c757d); }
.vehicle-color-dot { display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.4em; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.25); vertical-align: -0.1em; }

/* Exact pickup and drop-off points */
.exact-point-map { height: 260px; border-radius: 10px; border: 1px solid #ced4da; touch-action: pan-x pan-y; }
.exact-point-pin { background: #dc3545; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.exact-points-card { border-left: 4px solid #0d6efd; padding-left: 10px; }
.invite-label { display: inline-flex; align-items: center; gap: .45rem; }
.invite-label .invite-icon { flex: none; }
