/* ============================================
   Trek Booking — Frontend Styles
   ============================================ */

/* ---------- Notices ---------- */
.tb-notice {
  padding: 16px 20px;
  border-radius: 6px;
  margin-bottom: 24px;
  border-left: 4px solid;
}
.tb-notice--success {
  background: #f0fdf4;
  border-color: #15803d;
  color: #14532d;
}
.tb-notice--warning {
  background: #fffbeb;
  border-color: #d97706;
  color: #78350f;
}
.tb-notice h2 {
  margin-top: 0;
}

/* ---------- Confirmation table ---------- */
.tb-confirmation-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 480px;
  margin-top: 12px;
}
.tb-confirmation-table th,
.tb-confirmation-table td {
  padding: 10px 12px;
  border: 1px solid #d1fae5;
  text-align: left;
}
.tb-confirmation-table th {
  background: #dcfce7;
  font-weight: 600;
  width: 40%;
}

/* ---------- Booking box ---------- */
.tb-booking-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  position: sticky;
  top: 24px;
}
.tb-booking-box h2 {
  margin-top: 0;
  font-size: 1.25em;
  margin-bottom: 16px;
}
.tb-booking-box h3 {
  font-size: 1em;
  margin-bottom: 12px;
}
.tb-no-departures {
  color: #6b7280;
  font-style: italic;
}

/* ---------- Form fields ---------- */
.tb-field {
  margin-bottom: 14px;
}
.tb-field label {
  display: block;
  font-weight: 600;
  font-size: 0.875em;
  margin-bottom: 4px;
  color: #374151;
}
.tb-field label span[aria-hidden] {
  color: #dc2626;
  margin-left: 2px;
}
.tb-field input,
.tb-field select,
.tb-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.9375em;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s;
}
.tb-field input:focus,
.tb-field select:focus,
.tb-field textarea:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.tb-field-hint {
  font-size: 0.8em;
  color: #6b7280;
  margin: 4px 0 0;
}
.tb-field-row {
  display: flex;
  gap: 12px;
}
.tb-field-row .tb-field {
  flex: 1;
}

/* ---------- Price summary ---------- */
.tb-price-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 1em;
}
.tb-price-label {
  font-weight: 600;
  color: #374151;
}
.tb-price-total {
  font-size: 1.25em;
  font-weight: 700;
  color: #0d9488;
}

/* ---------- Error message ---------- */
.tb-error-message {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  color: #991b1b;
  padding: 10px 14px;
  font-size: 0.9em;
  margin-bottom: 12px;
}

/* ---------- Submit button ---------- */
.tb-submit-btn {
  display: block;
  width: 100%;
  padding: 13px;
  background: #0d9488;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.tb-submit-btn:hover {
  background: #0f766e;
}
.tb-submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}
.tb-payment-note {
  font-size: 0.8em;
  color: #6b7280;
  text-align: center;
  margin-top: 10px;
}

/* ---------- Archive ---------- */
.tb-archive {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}
.tb-archive-header {
  margin-bottom: 24px;
}
.tb-archive-title {
  font-size: 2em;
}

/* ---------- Filters ---------- */
.tb-filters {
  margin-bottom: 28px;
}
.tb-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.tb-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tb-filter-group label {
  font-size: 0.8em;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tb-filter-group select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.9375em;
  background: #fff;
}
.tb-filter-clear {
  font-size: 0.875em;
  color: #6b7280;
  text-decoration: underline;
  align-self: flex-end;
}

/* ---------- Trek grid ---------- */
.tb-trek-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

/* ---------- Trek card ---------- */
.tb-trek-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.tb-trek-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.tb-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.tb-card-image {
  position: relative;
  overflow: hidden;
}
.tb-card-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.tb-trek-card:hover .tb-card-image img {
  transform: scale(1.04);
}
.tb-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
}
.tb-badge--soldout {
  background: #dc2626;
  color: #fff;
}
.tb-card-body {
  padding: 16px;
}
.tb-card-title {
  font-size: 1.1em;
  margin: 0 0 8px;
}
.tb-card-excerpt {
  font-size: 0.875em;
  color: #6b7280;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tb-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.tb-card-meta-item {
  font-size: 0.8em;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 4px;
  color: #4b5563;
}
.tb-next-dep {
  background: #ecfdf5;
  color: #065f46;
}
.tb-card-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}
.tb-price-from,
.tb-price-per {
  font-size: 0.8em;
  color: #6b7280;
}
.tb-price-amount {
  font-size: 1.1em;
  font-weight: 700;
  color: #0d9488;
}

/* ---------- No treks ---------- */
.tb-no-treks {
  color: #6b7280;
  font-style: italic;
  text-align: center;
  padding: 40px 0;
}

/* ============================================
   Stepped Booking Flow (v1.1)
   ============================================ */

/* ---------- Step indicator ---------- */
.tb-step-indicator ol {
  list-style: none;
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 0 0 20px;
  counter-reset: tb-step;
}
.tb-step-indicator li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 600;
  position: relative;
}
.tb-step-indicator li.is-done {
  background: #ecfdf5;
  color: #065f46;
}
.tb-step-indicator li.is-current {
  background: #0d9488;
  color: #fff;
}
.tb-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.85em;
  font-weight: 700;
}
.tb-step-indicator li:not(.is-current) .tb-step-num {
  background: #fff;
  color: inherit;
}
.tb-step-indicator--compact ol {
  gap: 2px;
  margin-bottom: 16px;
}
.tb-step-indicator--compact li {
  padding: 6px 8px;
  font-size: 0.75em;
}
.tb-step-indicator--compact .tb-step-num {
  width: 18px;
  height: 18px;
  font-size: 0.75em;
}

/* ---------- Step 2 page ---------- */
.tb-booking-step-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}
.tb-trek-summary {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}
.tb-trek-summary-thumb {
  flex: 0 0 160px;
}
.tb-trek-summary-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.tb-trek-summary-body {
  flex: 1;
  min-width: 0;
}
.tb-trek-summary-body h1 {
  margin: 0 0 12px;
  font-size: 1.5em;
}
.tb-trek-summary-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 0;
}
.tb-trek-summary-meta > div {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 12px;
}
.tb-trek-summary-meta dt {
  font-size: 0.75em;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 2px;
}
.tb-trek-summary-meta dd {
  font-weight: 600;
  margin: 0;
}
.tb-trek-summary-total {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}
.tb-trek-summary-total dd {
  color: #047857;
}
.tb-trek-summary-back {
  margin: 12px 0 0;
  font-size: 0.875em;
}
.tb-trek-summary-back a {
  color: #0d9488;
  text-decoration: none;
}
.tb-trek-summary-back a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .tb-trek-summary {
    flex-direction: column;
  }
  .tb-trek-summary-thumb {
    flex: 0 0 auto;
    width: 100%;
  }
  .tb-trek-summary-thumb img {
    height: 180px;
  }
}

.tb-step-form {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
}

/* ---------- Traveller rows (injected above GF form) ---------- */
.tb-travellers {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}
.tb-travellers-heading {
  font-size: 1.1em;
  margin: 0 0 14px;
  color: #1a1a2e;
}
.tb-traveller-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.tb-traveller-label {
  flex: 0 0 90px;
  font-size: 0.9em;
  color: #374151;
  font-weight: 500;
}
.tb-traveller-fields {
  flex: 1;
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  gap: 10px;
  min-width: 0;
}
.tb-traveller-fields select,
.tb-traveller-fields input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.9375em;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s;
}
.tb-traveller-fields select:focus,
.tb-traveller-fields input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

@media (max-width: 600px) {
  .tb-traveller-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .tb-traveller-label {
    flex: 0 0 auto;
  }
  .tb-traveller-fields {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Booking form card ([tb_booking_form])
   ============================================ */
.tb-booking-card {
  background: var(--light-grey);
  border-radius: 14px;
  padding: var(--brxw-space-l);
  max-width: 380px;
  position: sticky;
  top: 24px;
}

/* ---------- Price header ---------- */
.tb-bf-price {
  margin-bottom: var(--brxw-space-m);
}
.tb-bf-amount {
  display: block;
  font-weight: 500;
  color: #0d3b5e;
}
.tb-bf-per {
  display: block;
  margin-top: 4px;
  color: #6cab3c;
}

/* ---------- Underline selects ---------- */
.tb-bf-field {
  margin-bottom: 4px;
}
.tb-bf-select {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 16px;
  border: none;
  border-bottom: 1px solid var(--grey);
  border-radius: 0;
  padding: 12px 26px 12px 2px;
  color: var(--grey);
  cursor: pointer;
}
.tb-bf-select:focus {
  outline: none;
  border-bottom-color: var(--secondary);
}

/* ---------- Seats available ---------- */
.tb-bf-seats {
  margin: 16px 0 4px;
  color: var(--primary);
}

/* ---------- Action buttons (Bricks) ---------- */
.tb-bf-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.tb-bf-actions .bricks-button {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  cursor: pointer;
}
.tb-bf-actions .bricks-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tb-booking-card .tb-error-message {
  margin-top: 16px;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .tb-booking-card {
    position: static;
    max-width: none;
  }
}

/* ---------- [tb_search] front-end search bar ---------- */
.tb-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.tb-search .facetwp-facet {
  margin: 0;
}
.tb-search-field {
  flex: 1 1 0;
  min-width: 140px;
}
.tb-search-select,
.tb-search .facetwp-dropdown {
  width: 100%;
  color: #a5a5a5;
  border-left: none;
  border-right: none;
  border-top: none;
}
.tb-search-select option,
.tb-search .facetwp-dropdown option {
  color: black;
}
.tb-search-submit {
  cursor: pointer;
  min-width: 200px;
}

@media (max-width: 600px) {
  .tb-search {
    flex-direction: column;
  }
  .tb-search-field,
  .tb-search-submit {
    width: 100%;
  }
}
