/* ============================================
   Trifecta Booking Widget
   Embedded in WordPress event articles
   ============================================ */

.tfw {
  --tfw-primary: #1a3c5e;
  --tfw-primary-light: #2a5a8a;
  --tfw-accent: #c8a84e;
  --tfw-accent-hover: #b8962e;
  --tfw-bg: #fafafa;
  --tfw-card-bg: #ffffff;
  --tfw-border: #e2e2e2;
  --tfw-text: #2c2c2c;
  --tfw-text-light: #6b6b6b;
  --tfw-success: #2e7d32;
  --tfw-error: #c62828;
  --tfw-radius: 8px;
  --tfw-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --tfw-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --tfw-transition: 0.2s ease;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--tfw-text);
  line-height: 1.5;
  box-sizing: border-box;
  max-width: 900px;
  margin: 2rem auto;
}

.tfw *, .tfw *::before, .tfw *::after {
  box-sizing: border-box;
}

/* ── Search Bar ── */

.tfw-search {
  background: var(--tfw-primary);
  border-radius: var(--tfw-radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  box-shadow: var(--tfw-shadow);
}

.tfw-search-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 140px;
}

.tfw-search-field label {
  color: rgba(255,255,255,0.85);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tfw-search-field input,
.tfw-search-field select {
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.95);
  color: var(--tfw-text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--tfw-transition);
}

.tfw-search-field input:focus,
.tfw-search-field select:focus {
  border-color: var(--tfw-accent);
  box-shadow: 0 0 0 2px rgba(200,168,78,0.25);
}

.tfw-search-btn {
  background: var(--tfw-accent);
  color: #fff;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--tfw-transition);
  white-space: nowrap;
}

.tfw-search-btn:hover {
  background: var(--tfw-accent-hover);
}

.tfw-search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Status Messages ── */

.tfw-status {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--tfw-text-light);
  font-size: 0.95rem;
}

.tfw-status.error {
  color: var(--tfw-error);
}

.tfw-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--tfw-border);
  border-top-color: var(--tfw-primary);
  border-radius: 50%;
  animation: tfw-spin 0.7s linear infinite;
  margin-bottom: 0.5rem;
}

@keyframes tfw-spin {
  to { transform: rotate(360deg); }
}

/* ── Results Grid ── */

.tfw-results {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ── Listing Card ── */

.tfw-card {
  background: var(--tfw-card-bg);
  border: 1px solid var(--tfw-border);
  border-radius: var(--tfw-radius);
  overflow: hidden;
  box-shadow: var(--tfw-shadow);
  transition: box-shadow var(--tfw-transition);
  display: flex;
  flex-direction: row;
}

.tfw-card:hover {
  box-shadow: var(--tfw-shadow-hover);
}

/* ── Image Carousel ── */

.tfw-card-images {
  position: relative;
  width: 280px;
  min-width: 280px;
  height: 220px;
  overflow: hidden;
  background: #eee;
  flex-shrink: 0;
}

.tfw-card-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.tfw-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--tfw-transition);
  z-index: 2;
}

.tfw-card-images:hover .tfw-carousel-btn {
  opacity: 1;
}

.tfw-carousel-btn.prev { left: 8px; }
.tfw-carousel-btn.next { right: 8px; }

.tfw-carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 2;
}

.tfw-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background var(--tfw-transition);
}

.tfw-carousel-dot.active {
  background: #fff;
}

/* ── Card Body ── */

.tfw-card-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.tfw-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tfw-primary);
  margin: 0 0 0.15rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tfw-card-location {
  font-size: 0.8rem;
  color: var(--tfw-text-light);
  margin-bottom: 0.6rem;
}

.tfw-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--tfw-text-light);
  margin-bottom: 0.6rem;
}

.tfw-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tfw-card-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.tfw-amenity-tag {
  background: #f0f0f0;
  color: var(--tfw-text-light);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

.tfw-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tfw-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tfw-primary);
}

.tfw-price-label {
  font-size: 0.75rem;
  color: var(--tfw-text-light);
  font-weight: 400;
}

.tfw-book-btn {
  background: var(--tfw-accent);
  color: #fff;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--tfw-transition);
  white-space: nowrap;
}

.tfw-book-btn:hover {
  background: var(--tfw-accent-hover);
}

/* ── Expanded Detail / Quote Panel ── */

.tfw-detail-panel {
  display: none;
  border-top: 1px solid var(--tfw-border);
  padding: 1rem 1.25rem;
  background: #f9f9f9;
}

.tfw-card.expanded .tfw-detail-panel {
  display: block;
}

.tfw-card.expanded {
  flex-direction: column;
}

.tfw-card.expanded .tfw-card-images {
  width: 100%;
  height: 260px;
}

.tfw-card.expanded .tfw-card-body {
  flex-direction: column;
}

.tfw-detail-section {
  margin-bottom: 1rem;
}

.tfw-detail-section h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tfw-primary);
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tfw-detail-section p {
  font-size: 0.88rem;
  color: var(--tfw-text);
  margin: 0;
  line-height: 1.55;
}

/* ── Detail Panel Action Buttons ── */

.tfw-detail-btn-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tfw-detail-btn-row .tfw-book-btn,
.tfw-detail-btn-row .tfw-inquiry-btn {
  flex: 1;
  min-width: 140px;
  text-align: center;
}

/* ── Inquiry Form ── */

.tfw-inquiry-form {
  background: #fff;
  border: 1px solid var(--tfw-border);
  border-radius: var(--tfw-radius);
  padding: 1.25rem;
}

.tfw-inquiry-confirmation {
  background: #f0f4f8;
  border-color: #c8d8e8;
}

.tfw-inquiry-confirmation h3 {
  color: var(--tfw-primary);
}

/* ── Quote / Price Breakdown ── */

.tfw-quote-breakdown {
  background: #fff;
  border: 1px solid var(--tfw-border);
  border-radius: 6px;
  padding: 1rem;
  margin-top: 0.75rem;
}

.tfw-quote-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.88rem;
}

.tfw-quote-row.total {
  border-top: 2px solid var(--tfw-primary);
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--tfw-primary);
}

.tfw-coupon-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}

.tfw-coupon-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--tfw-border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.tfw-coupon-btn {
  background: var(--tfw-primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Checkout Form ── */

.tfw-checkout {
  display: none;
  margin-top: 1rem;
}

.tfw-checkout.active {
  display: block;
}

.tfw-form-group {
  margin-bottom: 0.75rem;
}

.tfw-form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tfw-text);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tfw-form-group input,
.tfw-form-group select,
.tfw-form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--tfw-border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--tfw-transition);
}

.tfw-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.tfw-form-group input:focus,
.tfw-form-group select:focus,
.tfw-form-group textarea:focus {
  border-color: var(--tfw-primary);
  box-shadow: 0 0 0 2px rgba(26,60,94,0.12);
}

.tfw-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.tfw-checkout-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tfw-confirm-btn {
  background: var(--tfw-success);
  color: #fff;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  transition: background var(--tfw-transition);
}

.tfw-confirm-btn:hover {
  background: #256d29;
}

.tfw-confirm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tfw-inquiry-btn {
  background: var(--tfw-primary);
  color: #fff;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  transition: background var(--tfw-transition);
}

.tfw-inquiry-btn:hover {
  background: var(--tfw-primary-light);
}

.tfw-back-btn {
  background: transparent;
  color: var(--tfw-text-light);
  border: 1px solid var(--tfw-border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 0.75rem;
}

/* ── Stripe Elements Container ── */

.tfw-stripe-element {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--tfw-border);
  border-radius: 6px;
  background: #fff;
  transition: border-color var(--tfw-transition);
}

.tfw-stripe-element.StripeElement--focus {
  border-color: var(--tfw-primary);
  box-shadow: 0 0 0 2px rgba(26,60,94,0.12);
}

/* ── Policy Checkboxes ── */

.tfw-policy-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: var(--tfw-text-light);
}

.tfw-policy-check input[type="checkbox"] {
  margin-top: 0.2rem;
  width: auto;
}

/* ── Confirmation Screen ── */

.tfw-confirmation {
  text-align: center;
  padding: 2rem 1.5rem;
  background: #f0f8f0;
  border-radius: var(--tfw-radius);
  border: 1px solid #c8e6c9;
}

.tfw-confirmation h3 {
  color: var(--tfw-success);
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
}

.tfw-confirmation-code {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tfw-primary);
  letter-spacing: 0.1em;
  margin: 0.75rem 0;
}

/* ── Responsive ── */

@media (max-width: 700px) {
  .tfw-card {
    flex-direction: column;
  }
  .tfw-card-images {
    width: 100%;
    height: 200px;
    min-width: unset;
  }
  .tfw-search {
    flex-direction: column;
    align-items: stretch;
  }
  .tfw-search-field {
    min-width: unset;
  }
  .tfw-search-field input,
  .tfw-search-field select {
    width: 100%;
  }
  .tfw-search-btn {
    width: 100%;
  }
  .tfw-form-row {
    grid-template-columns: 1fr;
  }
  .tfw-checkout-actions {
    flex-direction: column;
  }
}

/* ── Branding Footer ── */

.tfw-branding {
  text-align: center;
  padding: 1rem 0 0.5rem;
  font-size: 0.72rem;
  color: var(--tfw-text-light);
}

.tfw-branding a {
  color: var(--tfw-primary);
  text-decoration: none;
  font-weight: 600;
}

.tfw-branding a:hover {
  text-decoration: underline;
}
