.public-header {
  position: sticky;
  top: 0;
  min-height: 64px;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 900;
}

.public-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.public-logo-img {
  height: 34px;
  width: auto;
  display: block;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.public-nav .btn {
  white-space: nowrap;
}

.public-footer {
  text-align: center;
  padding: 32px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 48px;
}

/* Category filter chips row on the homepage */
.category-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 12px;
  margin: 0 -4px 20px;
  scrollbar-width: none;
}
.category-chips::-webkit-scrollbar { display: none; }

.category-chip {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  min-width: 74px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.category-chip:hover {
  border-color: var(--border-purple);
  color: var(--text-primary);
}
.category-chip i {
  font-size: 18px;
  color: var(--text-secondary);
}
.category-chip.is-active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--purple-primary);
  color: var(--purple-light);
}
.category-chip.is-active i {
  color: var(--purple-light);
}

/* Category label pill on individual event cards */
.event-card-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
  color: var(--purple-light);
  background: rgba(124, 58, 237, 0.12);
}
.event-card-category.cat-music   { color: #A78BFA; background: rgba(124, 58, 237, 0.14); }
.event-card-category.cat-comedy  { color: #FBBF24; background: rgba(245, 158, 11, 0.14); }
.event-card-category.cat-theatre { color: #F472B6; background: rgba(236, 72, 153, 0.14); }
.event-card-category.cat-sports  { color: #34D399; background: rgba(16, 185, 129, 0.14); }
.event-card-category.cat-other   { color: #94A3B8; background: rgba(148, 163, 184, 0.14); }

.hero-gradient-text {
  background: linear-gradient(135deg, #A78BFA, #06B6D4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Event cards */
.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  height: 100%;
}

.event-card:hover {
  border-color: var(--border-purple);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15);
}

.event-card-cover {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, #1A1A2E, #2D1B69);
}

.event-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-card-price-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  padding: 4px 10px;
  border-radius: 0 16px 0 10px;
  font-size: 12px;
  font-weight: 600;
}

.event-card-body {
  padding: 16px;
}

.event-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.event-card-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.event-card-meta i {
  color: var(--purple-light);
  width: 14px;
}

.event-card-divider {
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tickets-left-chip {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 20px;
}

/* "Almost sold out" urgency badge — orange so it reads as a nudge to buy
   without leaking the exact remaining count. Shown only when >=95% sold. */
.tickets-left-chip.almost-sold-out {
  color: #FBBF24;
  background: rgba(245, 158, 11, 0.14);
  font-weight: 600;
}
.tickets-left-chip.almost-sold-out i {
  color: #F97316;
}

/* Event detail hero */
.event-hero {
  position: relative;
  height: 360px;
  overflow: hidden;
}

.event-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13,17,23,0.2) 0%, rgba(13,17,23,0.95) 100%);
}

.event-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px;
}

.event-hero-title {
  color: #fff;
  font-size: 32px;
  font-weight: 700;
}

.ticket-type-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.ticket-type-card:hover {
  border-color: var(--border-purple);
}

.ticket-type-card.sold-out {
  opacity: 0.55;
}

.ticket-perk {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.ticket-perk i {
  color: var(--success);
}

/* Quantity selector */
.qty-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.08);
  color: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qty-btn.qty-plus {
  background: var(--purple-primary);
  color: #fff;
  border: none;
}

.qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qty-input {
  width: 48px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 6px;
}

/* Physical ticket card: art / info / QR three-panel stub */
.physical-ticket {
  display: flex;
  background: var(--bg-card);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .physical-ticket {
    flex-wrap: wrap;
  }
}

/* Left: generative poster panel, colored per-event */
.ticket-art {
  width: 30%;
  min-width: 148px;
  flex-shrink: 0;
  position: relative;
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  background: var(--ticket-art-from, #7C3AED);
  background-image:
    radial-gradient(circle at 30% 20%, var(--ticket-art-mid, #EC4899) 0%, transparent 55%),
    linear-gradient(160deg, var(--ticket-art-from, #7C3AED), var(--ticket-art-to, #F97316));
}

.ticket-art::before {
  content: '';
  position: absolute;
  inset: -30%;
  background-image: repeating-radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.10) 0, rgba(255, 255, 255, 0.10) 1px, transparent 2px, transparent 34px);
  pointer-events: none;
}

.ticket-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 2px, transparent 2.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 2px, transparent 2.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 1.5px, transparent 2px);
  background-size: 70px 70px, 100px 100px, 54px 54px;
  background-position: 12px 18px, 50px 82px, 30px 130px;
  opacity: 0.6;
  pointer-events: none;
}

/* Left panel variant: event's own banner image instead of the generative pattern */
.ticket-art.has-cover {
  justify-content: flex-end;
  background-image:
    linear-gradient(180deg, rgba(13, 17, 23, 0.4) 0%, rgba(13, 17, 23, 0.55) 45%, rgba(13, 17, 23, 0.95) 100%),
    var(--ticket-art-image);
  background-size: cover;
  background-position: center;
}

.ticket-art.has-cover::before,
.ticket-art.has-cover::after {
  display: none;
}

.ticket-art.has-cover .ticket-art-badge {
  display: none;
}

.ticket-art.has-cover .ticket-art-title {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 1px 12px rgba(0, 0, 0, 0.6);
}

.ticket-art-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.ticket-art-badge i {
  font-size: 24px;
  color: #fff;
}

.ticket-art-title {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

/* Middle: event details */
.ticket-info {
  flex: 1;
  min-width: 0;
  padding: 24px 22px;
}

.ticket-info-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 6px;
}

.ticket-info-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ticket-info-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.ticket-info-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
}

.ticket-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-bottom: 16px;
}

.ticket-info-grid .label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 4px;
}

.ticket-info-grid .value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.ticket-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 100px;
  background: rgba(236, 72, 153, 0.16);
  color: #F472B6;
}

/* Right: perforated QR stub */
.physical-ticket-divider {
  position: relative;
  border-left: 2px dashed rgba(255, 255, 255, 0.14);
}

.physical-ticket-divider::before,
.physical-ticket-divider::after {
  content: '';
  position: absolute;
  left: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-primary);
}

.physical-ticket-divider::before {
  top: -10px;
}

.physical-ticket-divider::after {
  bottom: -10px;
}

.ticket-qr {
  width: 200px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ticket-qr-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warning);
  margin-bottom: 12px;
}

.ticket-qr img {
  width: 148px;
  height: 148px;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

.ticket-qr-verify {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 10px;
}

.ticket-number-mono {
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .ticket-art { width: 100%; }
  .physical-ticket-divider {
    border-left: none;
    border-top: 2px dashed rgba(255, 255, 255, 0.14);
  }
  .physical-ticket-divider::before,
  .physical-ticket-divider::after {
    display: none;
  }
  .ticket-qr { width: 100%; }
}

/* ============================================================
   Mobile bottom nav bar — app-style tab bar for phone viewports.
   ============================================================ */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 17, 23, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 950;
    justify-content: space-around;
    align-items: stretch;
  }
  .mbn-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    border-radius: 12px;
    min-height: 52px;
  }
  .mbn-item i {
    font-size: 20px;
  }
  .mbn-item.is-active {
    color: var(--purple-light);
    background: rgba(124, 58, 237, 0.08);
  }
  .mbn-item.is-active i {
    color: var(--purple-light);
  }

  /* Reserve room at the bottom of every page so the fixed tab bar doesn't
     overlap the last card / footer text. Also hide the desktop top nav
     items — the logo alone stays in the header. */
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .public-nav {
    display: none;
  }
  .public-footer {
    padding-bottom: 24px;
  }

  /* Header on mobile: just the logo, tighter padding */
  .public-header {
    padding: 10px 14px;
    gap: 8px;
    min-height: 56px;
  }
  .public-logo-img {
    height: 28px;
  }

  /* Hero heading (homepage) */
  .hero-gradient-text {
    font-size: 26px !important;
  }

  /* Event hero (event detail) */
  .event-hero {
    height: 240px;
  }
  .event-hero-content {
    padding: 16px;
  }
  .event-hero-title {
    font-size: 22px;
  }

  /* Ticket type card on event detail: stack vertically */
  .ticket-type-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }
  .ticket-type-card .text-end {
    text-align: left !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }
  .ticket-type-card .btn {
    padding: 10px 18px;
    white-space: nowrap;
  }

  /* Event card on mobile: full-width cover banner on top, details below.
     The banner is the hero — big, tappable, gives the event room to breathe. */
  .event-card {
    display: block;
    height: auto;
  }
  .event-card-cover {
    width: 100%;
    height: 220px;
    min-width: 0;
    flex-shrink: 0;
  }
  .event-card-price-badge {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 0 16px 0 12px;
  }
  .event-card-body {
    padding: 16px;
    display: block;
  }
  .event-card-title {
    font-size: 18px;
    margin-bottom: 10px;
    /* Long event titles clip to two lines instead of pushing the meta rows down */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .event-card-meta {
    font-size: 13px;
    margin-bottom: 4px;
  }
  .event-card-divider {
    margin: 12px 0;
  }
  .event-card-footer {
    gap: 12px;
    flex-wrap: wrap;
  }
  .event-card-footer .btn {
    padding: 8px 18px;
    font-size: 13px;
  }
  .tickets-left-chip {
    font-size: 12px;
    padding: 4px 10px;
  }

  /* Public footer padding */
  .public-footer {
    padding: 24px 12px;
    margin-top: 32px;
  }

  /* Bigger tap targets for quantity +/- on mobile — the default 32px round
     buttons were noticeably fiddly to hit on a phone. */
  .qty-btn {
    width: 40px;
    height: 40px;
  }
  .qty-input {
    width: 56px;
    font-size: 16px;
    padding: 8px;
  }
  .qty-selector {
    gap: 8px;
    justify-content: flex-end;
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  .public-logo-img {
    height: 26px;
  }
  .public-nav .btn {
    padding: 5px 8px;
    font-size: 12px;
  }
  .hero-gradient-text {
    font-size: 22px !important;
  }
}
