/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary:   #C0392B;
  --color-secondary: #2C3E50;
  --color-accent:    #E67E22;
  --color-bg:        #F8F9FA;
  --color-surface:   #FFFFFF;
  --color-text:      #212529;
  --color-text-muted:#6C757D;
  --color-border:    #DEE2E6;
  --radius:          6px;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.08);
  --shadow-md:       0 4px 16px rgba(0,0,0,.12);
  --font-sans:       system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container-width: 1200px;
  --nav-height:      100px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--color-text); background: var(--color-bg); line-height: 1.6; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.25rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 2px solid transparent; transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { filter: brightness(1.1); text-decoration: none; color: #fff; }
.btn-secondary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary); color: #fff; text-decoration: none; }
.btn-accent { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-danger { background: #dc3545; color: #fff; border-color: #dc3545; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-secondary); height: var(--nav-height);
  box-shadow: var(--shadow-sm);
}
.nav-container {
  max-width: var(--container-width); margin: 0 auto;
  padding: 0 1.5rem; height: 100%;
  display: flex; align-items: center; gap: 2rem;
}
.nav-brand { display: flex; align-items: center; }
.nav-logo { height: 70px; width: auto; }
.nav-brand-text { color: #fff; font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.nav-links {
  display: flex; align-items: center; gap: .25rem;
  list-style: none; margin-left: auto;
}
.nav-links a { color: rgba(255,255,255,.85); padding: .4rem .75rem; border-radius: var(--radius); transition: all .15s; }
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: .2s; }

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; right: 0;
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-md); list-style: none; min-width: 180px;
  padding: .5rem 0; margin-top: .25rem; z-index: 50;
}
.nav-dropdown-menu a { color: var(--color-text); display: block; padding: .5rem 1rem; }
.nav-dropdown-menu a:hover { background: var(--color-bg); }
.nav-dropdown.open .nav-dropdown-menu { display: block; }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.messages-container { padding: .75rem 1.5rem; }
.alert {
  padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: .5rem;
  font-size: .9rem;
}
.alert-success { background: #d1e7dd; color: #0a3622; }
.alert-error, .alert-danger { background: #f8d7da; color: #58151c; }
.alert-info { background: #cff4fc; color: #055160; }
.alert-warning { background: #fff3cd; color: #664d03; }

/* ── Main content ─────────────────────────────────────────────────────────── */
#main-content { min-height: calc(100vh - var(--nav-height) - 120px); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer { background: var(--color-secondary); color: rgba(255,255,255,.7); padding: 2rem 0; }
.footer-container { max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; }
.footer-brand strong { color: #fff; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,.7); font-size: .9rem; }
.footer-links a:hover { color: #fff; text-decoration: none; }

/* ── Event cards ──────────────────────────────────────────────────────────── */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; padding: 2rem 0; }
.event-card {
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.event-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.event-card__image { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.event-card__image--placeholder { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--color-primary), var(--color-accent)); }
.event-card__body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.event-card__category { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--color-primary); }
.event-card__title { font-size: 1.1rem; font-weight: 700; color: var(--color-text); line-height: 1.3; }
.event-card__meta { font-size: .85rem; color: var(--color-text-muted); display: flex; flex-direction: column; gap: .2rem; }
.event-card__footer { padding: .75rem 1.25rem; border-top: 1px solid var(--color-border); display: flex; justify-content: space-between; align-items: center; }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-members { background: var(--color-accent); color: #fff; }
.badge-free { background: #d1e7dd; color: #0a3622; }
.badge-paid { background: #fff3cd; color: #664d03; }

/* ── Event detail ─────────────────────────────────────────────────────────── */
.event-detail { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem; }
.event-detail__hero { border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; aspect-ratio: 21/9; object-fit: cover; width: 100%; }
.event-detail__header { margin-bottom: 1.5rem; }
.event-detail__title { font-size: 2rem; font-weight: 800; line-height: 1.2; margin-bottom: .5rem; }
.event-detail__meta { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--color-text-muted); font-size: .9rem; }
.event-detail__body { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; }
.event-detail__description { line-height: 1.8; }
.event-detail__sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.event-sidebar-card { background: var(--color-surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.event-sidebar-card h3 { font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); margin-bottom: .75rem; }

/* ── Calendar page ────────────────────────────────────────────────────────── */
.calendar-page { max-width: var(--container-width); margin: 2rem auto; padding: 0 1.5rem; }
#calendar { background: var(--color-surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-card { background: var(--color-surface); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-sm); max-width: 640px; margin: 2rem auto; }
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.25rem; }
.form-label { font-size: .9rem; font-weight: 600; }
.form-control {
  padding: .5rem .75rem; border: 1px solid var(--color-border);
  border-radius: var(--radius); font-size: .95rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(192,57,43,.15); }
.form-help { font-size: .8rem; color: var(--color-text-muted); }
.form-error { font-size: .8rem; color: #dc3545; }

/* ── Check-in ─────────────────────────────────────────────────────────────── */
.checkin-page { max-width: 600px; margin: 2rem auto; padding: 0 1rem; }
.checkin-result { text-align: center; padding: 2rem; }
.checkin-result--success { color: #0a3622; }
.checkin-result--already { color: #664d03; }
.attendee-list { list-style: none; }
.attendee-item { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--color-border); }
.attendee-item:last-child { border-bottom: none; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header { background: var(--color-secondary); color: #fff; padding: 3rem 1.5rem; margin-bottom: 2rem; }
.page-header__container { max-width: var(--container-width); margin: 0 auto; }
.page-header h1 { font-size: 2.25rem; font-weight: 800; }
.page-header p { color: rgba(255,255,255,.75); margin-top: .5rem; }

/* ── Filter bar ───────────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filter-chip { padding: .3rem .9rem; border-radius: 999px; border: 2px solid var(--color-border); font-size: .85rem; cursor: pointer; transition: all .15s; }
.filter-chip:hover, .filter-chip.active { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
/* ── Product grid ─────────────────────────────────────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.product-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; text-decoration: none; color: var(--color-text); transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.product-card__image { aspect-ratio: 1; object-fit: cover; width: 100%; }
.product-card__image--placeholder { aspect-ratio: 1; background: var(--color-bg); }
.product-card__body { padding: 1rem; flex: 1; }
.product-card__title { font-size: .95rem; font-weight: 600; margin-bottom: .35rem; }
.product-card__price { font-size: 1rem; font-weight: 700; color: var(--color-primary); }

/* ── Cart drawer ──────────────────────────────────────────────────────────── */
.cart-drawer { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.cart-drawer.open { pointer-events: all; }
.cart-drawer__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); opacity: 0; transition: opacity .25s; }
.cart-drawer.open .cart-drawer__backdrop { opacity: 1; }
.cart-drawer__panel { position: absolute; top: 0; right: 0; width: 400px; max-width: 100vw; height: 100%; background: var(--color-surface); box-shadow: var(--shadow-md); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s; }
.cart-drawer.open .cart-drawer__panel { transform: translateX(0); }
.cart-drawer__header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--color-border); }
.cart-drawer__body { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-drawer__footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--color-border); }
.cart-drawer__item { display: flex; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--color-border); }
.cart-drawer__item:last-child { border-bottom: none; }

/* ── Nav avatar circle ────────────────────────────────────────────────────── */
.nav-avatar { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:50%; background:var(--color-accent); color:#fff; font-size:.75rem; font-weight:700; letter-spacing:.02em; flex-shrink:0; }

/* ── Cart icon in nav ─────────────────────────────────────────────────────── */
.nav-cart { position: relative; display: inline-flex; align-items: center; }
.nav-cart__badge { position: absolute; top: -6px; right: -8px; background: var(--color-accent); color: #fff; font-size: .65rem; font-weight: 700; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--color-secondary); padding: 1rem; gap: .25rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; margin-left: auto; }
  .event-detail__body { grid-template-columns: 1fr; }
  .event-detail__sidebar { order: -1; }
  .cart-drawer__panel { width: 100%; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
