:root {
  color-scheme: light;
  --bg: #eeebde;
  --surface: #ffffff;
  --surface-strong: #eeebde;
  --ink: #2e3161;
  --muted: #62658b;
  --line: #dcd7c6;
  --brand: #ff625b;
  --brand-dark: #2e3161;
  --accent: #ff625b;
  --green: #2e3161;
  --green-soft: #eeebde;
  --shadow: 0 18px 42px rgba(46, 49, 97, 0.12);
  --radius: 22px;
  --tap: 48px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Exo 2", "muli", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.app-shell {
  position: relative;
  width: min(100%, 470px);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(92px + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(220, 215, 198, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 84px;
  height: auto;
}

.cart-link {
  display: grid;
  min-width: var(--tap);
  height: var(--tap);
  place-items: center;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(46, 49, 97, 0.08);
}

.hero {
  padding: 12px 0 10px;
}

.eyebrow,
.status-label,
.meta-label {
  margin: 0;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  color: var(--brand);
  font-family: "Abril Fatface", Georgia, serif;
  font-weight: 400;
  max-width: 12ch;
  margin: 0 0 6px;
  font-size: clamp(2.2rem, 10vw, 2.85rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 31rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.quick-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 14px;
  padding: 12px;
  color: #fff;
  background: var(--brand-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.quick-status strong {
  display: block;
  margin-top: 2px;
  font-size: 0.98rem;
}

.quick-status .status-label {
  color: #ffd9d5;
}

.quick-status a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: var(--brand-dark);
  background: #fff;
  border-radius: 999px;
  font-weight: 800;
}

.controls {
  position: sticky;
  top: 73px;
  z-index: 15;
  margin: 0 -16px;
  padding: 10px 16px 12px;
  background: rgba(238, 235, 222, 0.92);
  border-bottom: 1px solid rgba(220, 215, 198, 0.9);
  backdrop-filter: blur(18px);
}

.calendar-panel {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar-head strong {
  color: var(--brand);
  font-family: "Abril Fatface", Georgia, serif;
  font-size: 1.28rem;
  font-weight: 400;
}

.calendar-head button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--brand-dark);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.calendar-head button:disabled {
  opacity: 0.36;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-grid {
  gap: 4px;
  margin-top: 6px;
}

.calendar-day,
.calendar-blank {
  height: 34px;
}

.calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 900;
}

.calendar-day.has-event {
  color: var(--brand-dark);
  background: var(--surface-strong);
  border-color: var(--line);
}

.calendar-day.has-event::after {
  position: absolute;
  right: 8px;
  bottom: 4px;
  width: 5px;
  height: 5px;
  background: var(--brand);
  border-radius: 50%;
  content: "";
}

.calendar-day.is-selected {
  color: #fff;
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.calendar-day.is-selected::after {
  background: #fff;
}

.calendar-day.is-sold-out {
  opacity: 0.62;
}

.calendar-day:disabled:not(.has-event) {
  opacity: 0.3;
}

.calendar-summary {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.calendar-summary button {
  min-height: 34px;
  padding: 0 12px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}

.event-list {
  display: grid;
  gap: 14px;
  padding-top: 12px;
}

.event-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(234, 220, 205, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(46, 49, 97, 0.08);
}

.event-card.is-sold-out {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(220, 215, 198, 0.72);
}

.event-card.is-sold-out .event-image img {
  filter: grayscale(0.55) saturate(0.82);
  opacity: 0.74;
}

.event-card.is-sold-out .event-body {
  opacity: 0.78;
}

.event-card.is-sold-out .button.primary {
  background: #d8d4c8;
  color: var(--brand-dark);
}

.event-image {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: 16px;
}

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

.date-tile {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  min-width: 46px;
  padding: 6px 7px;
  place-items: center;
  color: #fff;
  background: rgba(46, 49, 97, 0.9);
  border-radius: 12px;
}

.date-tile strong {
  font-size: 1.15rem;
  line-height: 1;
}

.date-tile span {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-body {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 10px;
}

.event-body h2 {
  display: -webkit-box;
  margin: 0;
  color: var(--brand);
  font-family: "Abril Fatface", Georgia, serif;
  font-weight: 400;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 1.06rem;
  line-height: 1.16;
}

.event-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.event-meta span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.event-meta svg {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  color: var(--brand);
}

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

.price {
  font-size: 1rem;
  font-weight: 900;
}

.stock {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.stock.is-sold-out {
  color: var(--brand-dark);
  background: #ffe3df;
}

.card-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: var(--tap);
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 0;
  border-radius: 15px;
  font-weight: 900;
  text-align: center;
}

.button.primary {
  color: #fff;
  background: var(--brand);
}

.button.secondary {
  color: var(--brand-dark);
  background: var(--surface-strong);
}

.empty-state {
  padding: 30px 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.bottom-nav {
  position: fixed;
  right: max(12px, calc((100vw - 470px) / 2 + 12px));
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: max(12px, calc((100vw - 470px) / 2 + 12px));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 446px;
  margin: 0 auto;
  padding: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(234, 220, 205, 0.94);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(46, 49, 97, 0.18);
  backdrop-filter: blur(18px);
}

.bottom-nav a {
  display: grid;
  min-height: 58px;
  place-items: center;
  color: var(--muted);
  border-radius: 18px;
  font-size: 0.75rem;
  font-weight: 800;
}

.bottom-nav a.is-active {
  color: #fff;
  background: var(--brand);
}

.bottom-nav svg {
  margin-bottom: 2px;
}

.event-dialog {
  width: min(100%, 470px);
  max-width: none;
  max-height: 86vh;
  margin: auto auto 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.event-dialog::backdrop {
  background: rgba(46, 49, 97, 0.48);
  backdrop-filter: blur(4px);
}

.detail-sheet {
  overflow: hidden;
  background: #fff;
  border-radius: 28px 28px 0 0;
}

.detail-hero {
  position: relative;
  aspect-ratio: 1.65;
  background: var(--surface-strong);
}

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

.close-dialog {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: rgba(46, 49, 97, 0.78);
  border: 0;
  border-radius: 50%;
}

.detail-content {
  display: grid;
  gap: 16px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}

.detail-content h2 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.05;
}

.detail-summary {
  margin: 0;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.detail-meta {
  min-height: 74px;
  padding: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.detail-meta strong {
  display: block;
  margin-top: 2px;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 700px) {
  .app-shell {
    min-height: calc(100vh - 36px);
    margin-top: 18px;
    margin-bottom: 18px;
    border: 1px solid rgba(234, 220, 205, 0.9);
    border-radius: 34px;
    box-shadow: 0 28px 80px rgba(43, 29, 36, 0.18);
  }

  .app-header {
    border-radius: 34px 34px 0 0;
  }
}
