:root {
  --brand: #b31c1c;
  --brand-dark: #8f1515;
  --text: #1f1f1f;
  --muted: #666;
  --bg: #f8f8f8;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

header {
  background: var(--brand);
  color: #fff;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
}

.menu-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #fff;
  border-radius: 6px;
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
  cursor: pointer;
}

.site-nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 14px;
  font-size: 0.95rem;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-nav a.is-active {
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 700;
}

.hero {
  background: linear-gradient(120deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: 48px 0;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 2rem;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 18px;
}

.card h3 {
  margin-top: 0;
}

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 5px 30px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
}

.btn:hover {
  background: var(--brand-dark);
}

.filters select,
.filters input,
.filters textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d6d6d6;
  border-radius: 6px;
  font: inherit;
}

.btnSwap {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: 50%;
  cursor: pointer;
  color: var(--brand);
  font-size: 1.5rem;
  transition: background 0.18s, color 0.18s, transform 0.3s;
  margin-bottom: 1px;
  flex-shrink: 0;
}

.btnSwap:hover {
  background: var(--brand);
  color: #fff;
}

.swap-btn.spinning {
  transform: rotate(180deg);
}

.actions {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;

}

/* Utility: center actions on mobile when applied */
.actions-center-mobile {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  justify-content: center;
}

@media (max-width: 640px) {
  .actions.center-mobile {
    justify-content: center;
    width: 100%;
  }
}

main {
  padding: 28px 0 50px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

th,
td {
  border: 1px solid #e1e1e1;
  padding: 10px;
  text-align: center;
}

th {
  background: #f1f1f1;
}

/* Left align stop name column */
td.stop-name,
th.stop-name {
  text-align: left;
}

.muted {
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.filters label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--muted);
}

.filters select,
.filters input,
.filters textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d6d6d6;
  border-radius: 6px;
  font: inherit;
}

.result-empty {
  margin-top: 12px;
  color: var(--muted);
}

.app-feature-list {
  margin: 12px 0 16px;
  padding-left: 20px;
}

.app-store-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.store-badge {
  height: 52px;
  width: auto;
  display: block;
}

.app-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.app-gallery img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e1e1e1;
  background: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.gallery-thumb {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e1e1e1;
  background: #fff;
}

.gallery-thumb:hover img {
  transform: scale(1.02);
}

.gallery-thumb img {
  transition: transform 0.2s ease;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.video-grid iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  z-index: 1000;
  padding: 20px;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-image {
  max-width: min(92vw, 1200px);
  max-height: 86vh;
  border-radius: 8px;
  border: 2px solid #fff;
}

.lightbox-nav,
.lightbox-close {
  position: absolute;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
}

.lightbox-close {
  top: 18px;
  right: 24px;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  width: 52px;
  height: 52px;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.home-gallery-action {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-meta {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e8e8e8;
  font-size: 0.92rem;
}

.btn-gallery-home {
  background: #1e63d6;
  border-radius: 10px;
  padding: 10px 30px;
  margin: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.btn-gallery-home:hover {
  background: #184ead;
}

footer {
  background: #111;
  color: #ddd;
  padding: 22px 0;
  font-size: 0.9rem;
}

footer a {
  color: #fff;
}

@media (max-width: 800px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    margin: 0;
    padding: 8px 0;
  }
}


.wa-center {
  text-align: center;
}

.wa-img {
  width: 250px;
  height: auto;

}

.fb-btn {
  background-color: #1877F2;
  color: #fff;
  padding: 10px 16px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  display: inline-block;
}

.fb-btn:hover {
  background-color: #145dbf;
}

.table-container {
  width: 100%;
  overflow-x: auto; /* scroll on mobile */
}

.bus-table {
  width: 100%;
  border-collapse: collapse;
}

.bus-table th,
.bus-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
}

.bus-table th {
  background-color: #f4f4f4;
}

td:first-child {
  font-weight: 700;
}


/* Striped table style */
.striped-table tbody tr:nth-child(odd) {
  background-color: #fafafa;
}
.striped-table tbody tr:nth-child(even) {
  background-color: #f1f1f1;
}
.striped-table th,
.striped-table td {
  border: 1px solid #e1e1e1;
  padding: 10px;
  text-align: center;
}
.striped-table th {
  background: #f1f1f1;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  height: 40px;
}

.custom-select-input:disabled {
  background: #f3f4f6;
  color: #888;
}

.custom-select-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 230px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  z-index: 20;
}

.custom-select-options[hidden] {
  display: none !important;
}

.custom-select-options.is-open {
  display: block;
}

.custom-select-option {
  width: 100%;
  display: block;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #f1f1f1;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option:focus {
  background: #f8eeee;
  outline: none;
}

.custom-select-empty {
  padding: 10px 12px;
  color: var(--muted);
}

.btn-small {
  padding: 7px 10px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Ensure buttons in action bars match input height */
.actions .btn,
.actions .btn.btn-small {
  height: 40px;
  width: 120px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.highlight-row td {
  background: #fff7d6;
  font-weight: 700;
}

.stop-direction-table {
  margin-bottom: 18px;
}

.stop-results-grid {
  display: grid;
  gap: 18px;
}

.stop-result-table h4 {
  margin: 0 0 10px;
}

@media (min-width: 900px) {
  .stop-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: 14px 0 10px;
}

.btn-action {
  align-items: center;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.15rem;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 34px;
}

.btn-map {
  background: #1a73e8;
}

.btn-map:hover {
  background: #1558b0;
}

.btn-print {
  background: #374151;
}

.btn-print:hover {
  background: #1f2937;
}

.btn-whatsapp {
  background: #25d366;
  color: #102817;
}

.btn-whatsapp:hover {
  background: #1fad53;
  color: #102817;
}

.btn-reverse {
  background: #b31c1c;
}

.mobile-result-list {
  display: none;
}

.mobile-result-card {
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.mobile-result-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.mobile-result-main strong {
  font-size: 20px;
}

.mobile-result-card p {
  margin: 6px 0;
  color: var(--muted);
}

.mobile-result-route {
  color: var(--text);
}

.mobile-result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
}

.mobile-result-footer span {
  text-align: left;
  flex: 1 1 auto;
}

.mobile-result-footer .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: 0px;
}

@media (max-width: 640px) {
  .result-actions {
    gap: 6px;
    justify-content: flex-end;
  }

  .result-actions .btn {
    flex: 1 1 140px;
    padding: 7px 12px;
    text-align: center;
  }

  .result-actions .btn-action {
    flex: 0 0 34px;
    min-width: 34px;
    padding: 0;
  }

  .mobile-result-list {
    display: grid;
    gap: 10px;
  }

  .mobile-result-list + .result-empty,
  .mobile-result-list ~ .result-empty {
    margin-top: 12px;
  }

  .card .table-wrap:has(+ .mobile-result-list) {
    display: none;
  }
}

@media print {
  header,
  footer,
  .no-print,
  .actions,
  .custom-select-options,
  .btn,
  .result-actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .container {
    width: 100%;
    margin: 0;
  }

  .card {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .mobile-result-list {
    display: none !important;
  }

  .table-wrap {
    overflow: visible;
  }
}
