:root {
  --tb-green: #1f7a4d;
  --tb-green-dark: #145536;
  --tb-clay: #b5622f;
  --tb-hard: #2b6cb0;
  --tb-grass: #3f9142;
  --tb-padel: #6b4fa0;
  --tb-bg: #f7f9f8;
  --tb-text: #1c2b23;
  --tb-muted: #5b6a62;
  --tb-border: #e3e8e5;
  --tb-danger: #c0392b;
  --tb-radius: 10px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--tb-text); background: #ffffff; line-height: 1.5; }
a { color: var(--tb-green); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 12px; }
p { margin: 0 0 12px; }

.tb-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.tb-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--tb-border); }
.tb-header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.tb-brand img { height: 36px; }
.tb-brand span { font-weight: 800; font-size: 20px; color: var(--tb-green-dark); }
.tb-nav { display: flex; gap: 20px; }
.tb-nav a { color: var(--tb-text); font-weight: 500; font-size: 14px; }
.tb-nav a:hover { color: var(--tb-green); }
.tb-header-actions { display: flex; align-items: center; gap: 14px; }
.tb-lang-switch { display: flex; gap: 4px; }
.tb-lang-switch a { padding: 4px 8px; font-size: 12px; font-weight: 700; border-radius: 6px; color: var(--tb-muted); }
.tb-lang-switch a.active { background: var(--tb-green); color: #fff; }
.tb-cart-btn { position: relative; background: var(--tb-green-dark); color: #fff; border: none; padding: 10px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.tb-cart-count { background: #fff; color: var(--tb-green-dark); border-radius: 999px; padding: 1px 7px; font-size: 12px; margin-left: 6px; }

/* Hero */
.tb-hero { background: linear-gradient(135deg, var(--tb-green-dark), var(--tb-green)); color: #fff; padding: 80px 0; text-align: center; }
.tb-hero h1 { font-size: 40px; }
.tb-hero-subtitle { font-size: 18px; opacity: .9; max-width: 600px; margin: 0 auto 28px; }

/* Sections */
.tb-section { padding: 64px 0; }
.tb-section-alt { background: var(--tb-bg); }
.tb-section h2 { font-size: 28px; margin-bottom: 24px; }
.tb-prose { color: var(--tb-text); max-width: 760px; }

/* Buttons */
.tb-btn { display: inline-block; border: none; padding: 12px 20px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.tb-btn-primary { background: var(--tb-green); color: #fff; }
.tb-btn-primary:hover { background: var(--tb-green-dark); }
.tb-btn-primary:disabled { background: #a9c9b9; cursor: not-allowed; }
.tb-btn-ghost { background: transparent; color: var(--tb-muted); border: 1px solid var(--tb-border); }
.tb-btn-lg { padding: 14px 28px; font-size: 16px; }
.tb-link-btn { background: none; border: none; color: var(--tb-green); font-weight: 600; cursor: pointer; padding: 0; }

/* Court grid */
.tb-court-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tb-court-card { border: 1px solid var(--tb-border); border-radius: var(--tb-radius); overflow: hidden; background: #fff; }
.tb-court-media { position: relative; height: 140px; display: flex; align-items: flex-end; padding: 10px; }
.tb-court-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tb-surface-hard { background: var(--tb-hard); }
.tb-surface-clay { background: var(--tb-clay); }
.tb-surface-grass { background: var(--tb-grass); }
.tb-surface-padel { background: var(--tb-padel); }
.tb-surface-diagram { position: absolute; inset: 10px; border: 2px solid rgba(255,255,255,.6); border-radius: 4px; }
.tb-surface-diagram::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.6); }
.tb-surface-label { position: relative; z-index: 1; background: rgba(0,0,0,.35); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.tb-court-body { padding: 16px; }
.tb-court-body h3 { font-size: 18px; }
.tb-badge { display: inline-block; background: #fdf1e7; color: var(--tb-clay); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; margin-bottom: 8px; }
.tb-court-body p { color: var(--tb-muted); font-size: 14px; }

/* Booking widget */
.tb-booking-widget { margin-top: 36px; border: 1px solid var(--tb-border); border-radius: var(--tb-radius); padding: 24px; background: var(--tb-bg); }
.tb-field { display: block; margin-bottom: 16px; }
.tb-field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.tb-field input, .tb-field select { width: 100%; max-width: 260px; padding: 10px 12px; border: 1px solid var(--tb-border); border-radius: 8px; font-size: 14px; }
.tb-radio { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-size: 14px; font-weight: 400; }

.tb-slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 16px 0; }
.tb-slot { border: 1px solid var(--tb-border); background: #fff; border-radius: 8px; padding: 10px 8px; text-align: center; cursor: pointer; font-size: 13px; }
.tb-slot .tb-slot-time { font-weight: 700; display: block; }
.tb-slot .tb-slot-price { display: block; color: var(--tb-muted); font-size: 12px; margin-top: 2px; }
.tb-slot.tb-slot-available:hover { border-color: var(--tb-green); }
.tb-slot.tb-slot-selected { background: var(--tb-green); color: #fff; border-color: var(--tb-green); }
.tb-slot.tb-slot-selected .tb-slot-price { color: rgba(255,255,255,.85); }
.tb-slot.tb-slot-booked, .tb-slot.tb-slot-unavailable { background: #f1f1f1; color: #aaa; cursor: not-allowed; }
.tb-slot.tb-slot-past { background: #f7f7f7; color: #ccc; cursor: not-allowed; text-decoration: line-through; }
.tb-slot.tb-slot-no_price { background: #fff; color: #ddd; cursor: not-allowed; border-style: dashed; }
.tb-slot.tb-slot-season_closed { background: #fff8ea; color: #c9a227; cursor: not-allowed; }
.tb-slot.tb-slot-in_cart { background: #dff2e6; border-color: var(--tb-green); color: var(--tb-green-dark); cursor: not-allowed; }

.tb-selection-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }

/* Cart modal */
.tb-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.tb-modal-overlay[hidden] { display: none; }
.tb-modal { background: #fff; width: 100%; max-width: 480px; max-height: 85vh; border-radius: var(--tb-radius); display: flex; flex-direction: column; }
.tb-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--tb-border); }
.tb-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--tb-muted); }
.tb-modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.tb-modal-footer { padding: 16px 20px; border-top: 1px solid var(--tb-border); }
.tb-cart-total-row { display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 12px; }
.tb-modal-actions { display: flex; justify-content: space-between; gap: 12px; }

.tb-cart-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--tb-border); gap: 10px; }
.tb-cart-item-info { font-size: 14px; }
.tb-cart-item-timer { font-size: 12px; color: var(--tb-danger); }
.tb-cart-item-remove { background: none; border: none; color: var(--tb-danger); cursor: pointer; font-size: 13px; }

/* Checkout */
.tb-checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.tb-checkout-summary-col { border: 1px solid var(--tb-border); border-radius: var(--tb-radius); padding: 20px; background: var(--tb-bg); }
.tb-summary-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--tb-border); font-size: 14px; }
.tb-summary-total { display: flex; justify-content: space-between; padding-top: 14px; font-size: 16px; font-weight: 700; }
.tb-checkout-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }

/* Confirmation */
.tb-confirmation { max-width: 560px; margin: 0 auto; text-align: center; }
.tb-confirmation-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--tb-green); color: #fff; font-size: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.tb-confirmation-card { text-align: left; border: 1px solid var(--tb-border); border-radius: var(--tb-radius); padding: 16px 20px; margin: 24px 0; }

.tb-muted { color: var(--tb-muted); }
.tb-small { font-size: 13px; }
.tb-error { color: var(--tb-danger); font-size: 13px; }
.tb-contacts-list { list-style: none; padding: 0; }
.tb-contacts-list li { margin-bottom: 8px; }

@media (max-width: 720px) {
  .tb-nav { display: none; }
  .tb-checkout-layout { grid-template-columns: 1fr; }
  .tb-hero h1 { font-size: 28px; }
}
