/**
 * 2008-2026 Prestaworld
 *
 * NOTICE OF LICENSE
 *
 * The source code of this module is under a commercial license.
 * Each license is unique and can be installed and used on only one website.
 * Any reproduction or representation total or partial of the module, one or more of its components,
 * by any means whatsoever, without express permission from us is prohibited.
 *
 * DISCLAIMER
 *
 * Do not alter or add/update to this file if you wish to upgrade this module to newer
 * versions in the future.
 *
 * @author    prestaworld
 * @copyright 2008-2026 Prestaworld
 * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
 * International Registered Trademark & Property of prestaworld
 */

/* Presta Bus Booking — storefront header strip (displayNavFullWidth). Scoped: no global element selectors. */

.wbb-header-strip {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.35rem 0;
  margin: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.wbb-header-strip-inner {
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 0;
}

.wbb-header-entry,
.wbb-header-strip .wbb-header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.wbb-header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.3rem 0.95rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
  color: #0f172a;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.wbb-header-link:hover {
  color: #b91c1c;
  border-color: #fecaca;
  box-shadow: 0 2px 10px rgba(217, 58, 58, 0.1);
  text-decoration: none;
  transform: translateY(-1px);
}

.wbb-header-link-icon {
  font-size: 1rem;
  line-height: 1;
}

.wbb-header-link-text {
  letter-spacing: -0.01em;
}

.wbb-front-shell,
.prestabusbooking-front {
  padding: 1rem;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
}

.wbb-front-shell h2,
.prestabusbooking-front h2 {
  margin-top: 0;
}

/* My Tickets — action buttons */
.wbb-ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.wbb-ticket-actions__btn {
  white-space: nowrap;
}

@media (min-width: 769px) {
  .wbb-ticket-actions {
    justify-content: flex-end;
  }
}

/* My Tickets — premium table */
.wbb-mytickets__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.wbb-mytickets__title {
  margin: 0;
}

.wbb-mytickets__sub {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
}

/* My Tickets — premium card list (desktop + mobile) */
.wbb-ticketcards {
  display: grid;
  gap: 12px;
}

.wbb-ticketcard {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.wbb-ticketcard__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.wbb-ticketcard__routeName {
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
}

.wbb-ticketcard__routeMeta {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 54vw;
}

.wbb-ticketcard__right {
  text-align: right;
  flex: 0 0 auto;
}

.wbb-ticketcard__id {
  font-weight: 900;
  color: #0f172a;
}

.wbb-ticketcard__date {
  margin-top: 2px;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 700;
}

.wbb-ticketcard__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.75fr 1fr 1fr;
  gap: 10px 12px;
  padding: 12px 14px;
}

.wbb-ticketcard__label {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}

.wbb-ticketcard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 14px;
  border-top: 1px solid #eef2f7;
  background: #fff;
}

@media (max-width: 1100px) {
  .wbb-ticketcard__grid {
    grid-template-columns: 1fr 1fr;
  }
  .wbb-ticketcard__routeMeta {
    max-width: 70vw;
  }
}

@media (max-width: 768px) {
  .wbb-ticketcard__top {
    flex-direction: column;
    align-items: stretch;
  }
  .wbb-ticketcard__right {
    text-align: left;
    display: flex;
    gap: 10px;
    align-items: baseline;
  }
  .wbb-ticketcard__grid {
    grid-template-columns: 1fr;
  }
  .wbb-ticketcard__actions {
    justify-content: stretch;
  }
  .wbb-ticketcard__actions .btn {
    width: 100%;
  }
}

.wbb-ticket-table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.wbb-ticket-table {
  margin: 0;
  width: 100%;
  table-layout: fixed;
}

.wbb-ticket-table th,
.wbb-ticket-table td {
  padding: 10px 10px;
}

.wbb-ticket-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 700;
  font-size: 0.82rem;
  color: #0f172a;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.wbb-ticket-table tbody td {
  vertical-align: middle;
  border-top: 1px solid #eef2f7;
  font-size: 0.9rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Desktop column sizing for clean readability */
@media (min-width: 769px) {
  .wbb-ticket-table thead th:nth-child(1),
  .wbb-ticket-table tbody td:nth-child(1) { width: 72px; } /* Booking */

  .wbb-ticket-table thead th:nth-child(2),
  .wbb-ticket-table tbody td:nth-child(2) { width: 260px; } /* Route */

  .wbb-ticket-table thead th:nth-child(3),
  .wbb-ticket-table tbody td:nth-child(3) { width: 110px; } /* Date */

  .wbb-ticket-table thead th:nth-child(4),
  .wbb-ticket-table tbody td:nth-child(4) { width: 120px; } /* Seats */

  .wbb-ticket-table thead th:nth-child(5),
  .wbb-ticket-table tbody td:nth-child(5) { width: 130px; } /* Status */

  .wbb-ticket-table thead th:nth-child(6),
  .wbb-ticket-table tbody td:nth-child(6) { width: 110px; } /* Payment */

  .wbb-ticket-table thead th:nth-child(7),
  .wbb-ticket-table tbody td:nth-child(7) { width: 120px; } /* Order */

  .wbb-ticket-table thead th:nth-child(8),
  .wbb-ticket-table tbody td:nth-child(8) { width: 120px; } /* Tickets */

  .wbb-ticket-table thead th:nth-child(9),
  .wbb-ticket-table tbody td:nth-child(9) { width: 220px; } /* Actions */
}

.wbb-ticket-table tbody tr:hover {
  background: #f8fafc;
}

.wbb-cell-main {
  font-weight: 700;
  color: #0f172a;
}

.wbb-route-cell__name {
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wbb-route-cell__meta {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wbb-td-route {
  min-width: 220px;
}

.wbb-th-actions {
  min-width: 220px;
}

/* Chips */
.wbb-chiplist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wbb-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #e0e7ff;
  max-width: 100%;
}

.wbb-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.wbb-ticketnums__item {
  padding: 1px 0;
}

/* Pills */
.wbb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
  border: 1px solid transparent;
  margin-top: 2px;
  white-space: nowrap;
}

.wbb-pill--neutral {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #e2e8f0;
}
.wbb-pill--warn {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}
.wbb-pill--danger {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.wbb-pill--success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.wbb-pill--muted {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}

@media (max-width: 768px) {
  /* Convert table rows to stacked cards (no ugly scrolling) */
  .wbb-ticket-table-wrap {
    border-radius: 16px;
  }
  .wbb-ticket-table thead {
    display: none;
  }
  .wbb-ticket-table,
  .wbb-ticket-table tbody,
  .wbb-ticket-table tr,
  .wbb-ticket-table td {
    display: block;
    width: 100%;
  }
  .wbb-ticket-table tr {
    padding: 12px 12px 6px;
    border-top: 1px solid #eef2f7;
  }
  .wbb-ticket-table td {
    padding: 8px 0;
    border: 0;
  }
  .wbb-ticket-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
  }
  .wbb-th-actions {
    min-width: 0;
  }
  .wbb-ticket-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .wbb-ticket-actions__btn {
    width: 100%;
  }

  .wbb-td-route {
    min-width: 160px;
  }
}

/* Generic modal (used on My Tickets cancellation) */
.wbb-modal[hidden] {
  display: none !important;
}

.wbb-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wbb-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.wbb-modal__card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(80vh, 680px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
  padding: 1rem 1rem 0.85rem;
}

.wbb-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #0f172a;
}

.wbb-order-summary {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px solid #f1d5d8;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fff7f8);
}

.wbb-order-summary-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #7f1d1d;
}

.wbb-order-card {
  border: 1px solid #f8d7da;
  border-radius: 10px;
  background: #fff;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.wbb-order-card:last-child {
  margin-bottom: 0;
}

.wbb-order-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.wbb-order-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7f1d1d;
  background: #fee2e2;
}

.wbb-order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
  font-size: 0.92rem;
  color: #111827;
}

@media (max-width: 767px) {
  .wbb-order-grid {
    grid-template-columns: 1fr;
  }
}
