/* ── Variables ──────────────────────────────────── */
:root {
  --es-green:      #006d36;
  --es-green-lt:   #00c461;
  --es-green-bg:   #edfaf3;
  --es-text:       #1a1a2e;
  --es-muted:      #6b7280;
  --es-border:     #e5e7eb;
  --es-card-bg:    #ffffff;
  --es-page-bg:    #f7f8fa;
  --es-radius:     16px;
  --es-radius-sm:  10px;
  --es-shadow:     0 2px 12px rgba(0,0,0,.07);
  --es-shadow-h:   0 8px 28px rgba(0,0,0,.13);
}

/* ── Page wrapper ───────────────────────────────── */
.es-page {
  min-height: 100vh;
  background: var(--es-page-bg);
  padding: 94px 20px 60px; /* 70px navbar + 24px gap */
}

/* ── Top bar ────────────────────────────────────── */
.es-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.es-topbar-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--es-text);
  margin: 0;
}
.es-topbar-count {
  font-size: .85rem;
  color: var(--es-muted);
}
/* Floating filter button — hidden on desktop */
.es-filter-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1030;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--es-green);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,109,54,.45);
  transition: background .2s, box-shadow .2s, transform .15s;
  white-space: nowrap;
}
.es-filter-fab:hover {
  background: var(--es-green-lt);
  box-shadow: 0 8px 24px rgba(0,196,97,.45);
  transform: translateX(-50%) translateY(-2px);
}

/* ── Layout ─────────────────────────────────────── */
.es-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

/* ── Filter sidebar ─────────────────────────────── */
.es-sidebar {
  position: sticky;
  top: 88px;
  background: var(--es-card-bg);
  border-radius: var(--es-radius);
  border: 1.5px solid var(--es-border);
  padding: 24px 20px;
  box-shadow: var(--es-shadow);
}
.es-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.es-sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--es-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.es-sidebar-title i {
  color: var(--es-green);
  font-size: .9rem;
}
.es-clear-btn {
  font-size: .78rem;
  color: var(--es-green);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.es-clear-btn:hover { color: var(--es-green-lt); }

.es-sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.es-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--es-page-bg);
  border: 1.5px solid var(--es-border);
  border-radius: 50%;
  font-size: .9rem;
  color: var(--es-text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.es-sidebar-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.es-filter-group { margin-bottom: 24px; }
.es-filter-group:last-child { margin-bottom: 0; }
.es-filter-group-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--es-muted);
  margin-bottom: 12px;
  display: block;
}

/* Custom radio / checkbox */
.es-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--es-radius-sm);
  cursor: pointer;
  transition: background .15s;
  font-size: .88rem;
  color: var(--es-text);
  user-select: none;
}
.es-filter-option:hover { background: var(--es-green-bg); }
.es-filter-option input[type="radio"],
.es-filter-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px; height: 17px;
  border: 2px solid var(--es-border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
  position: relative;
}
.es-filter-option input[type="checkbox"] { border-radius: 5px; }
.es-filter-option input[type="radio"]:checked,
.es-filter-option input[type="checkbox"]:checked {
  background: var(--es-green);
  border-color: var(--es-green);
}
.es-filter-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
}
.es-filter-option input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-55%) rotate(45deg);
  width: 4px; height: 7px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}
.es-filter-option:has(input:checked) {
  background: var(--es-green-bg);
  color: var(--es-green);
  font-weight: 600;
}

/* Date custom input */
.es-date-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--es-border);
  border-radius: var(--es-radius-sm);
  font-size: .85rem;
  color: var(--es-text);
  margin-top: 6px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.es-date-input:focus {
  border-color: var(--es-green-lt);
  box-shadow: 0 0 0 3px rgba(0,196,97,.1);
}

/* ── Results area ───────────────────────────────── */
.es-results-area { min-width: 0; }
.es-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.es-results-count {
  font-size: .88rem;
  color: var(--es-muted);
}
.es-results-count strong { color: var(--es-text); }

/* ── Grid ───────────────────────────────────────── */
.es-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

/* ── Event card ─────────────────────────────────── */
.es-card {
  background: var(--es-card-bg);
  border-radius: var(--es-radius);
  overflow: hidden;
  border: 1.5px solid var(--es-border);
  box-shadow: var(--es-shadow);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s;
  text-decoration: none;
  display: block;
  animation: cardIn .35s ease both;
}
.es-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--es-shadow-h);
  border-color: rgba(0,196,97,.35);
  text-decoration: none;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger via nth-child */
.es-card:nth-child(1)  { animation-delay: .03s; }
.es-card:nth-child(2)  { animation-delay: .07s; }
.es-card:nth-child(3)  { animation-delay: .11s; }
.es-card:nth-child(4)  { animation-delay: .15s; }
.es-card:nth-child(5)  { animation-delay: .19s; }
.es-card:nth-child(6)  { animation-delay: .23s; }
.es-card:nth-child(7)  { animation-delay: .27s; }
.es-card:nth-child(8)  { animation-delay: .31s; }
.es-card:nth-child(9)  { animation-delay: .35s; }

/* Card image area */
.es-card-img-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
}
.es-card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.es-card:hover .es-card-img-wrap img { transform: scale(1.06); }

/* Date badge */
.es-card-date-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--es-text);
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.es-card-date-badge i { color: var(--es-green); font-size: .7rem; }

/* Price badge */
.es-card-price-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--es-green);
  color: #fff;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.es-card-price-badge.free {
  background: var(--es-green-lt);
}

/* Card overlay gradient */
.es-card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.35) 0%, transparent 55%);
}

/* Card body */
.es-card-body {
  padding: 14px 16px 16px;
}
.es-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .76rem;
  color: var(--es-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.es-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.es-card-meta i { font-size: .7rem; color: var(--es-green); }
.es-card-title {
  font-size: .98rem;
  font-weight: 700;
  color: var(--es-text);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.es-card-subtitle {
  font-size: .82rem;
  color: var(--es-muted);
  margin: 0 0 12px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.es-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.es-card-price {
  font-size: .82rem;
  font-weight: 700;
  color: var(--es-green);
}
.es-card-cta {
  font-size: .78rem;
  font-weight: 600;
  color: var(--es-green);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
}
.es-card:hover .es-card-cta {
  opacity: 1;
  transform: translateX(0);
}

/* ── Skeleton loader ────────────────────────────── */
.es-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.es-skeleton-card {
  background: var(--es-card-bg);
  border-radius: var(--es-radius);
  overflow: hidden;
  border: 1.5px solid var(--es-border);
}
.es-skeleton-img {
  height: 180px;
  background: #e9ecef;
  background: linear-gradient(90deg, #e9ecef 25%, #f1f3f5 50%, #e9ecef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.es-skeleton-body { padding: 14px 16px 16px; }
.es-skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: #e9ecef;
  background: linear-gradient(90deg, #e9ecef 25%, #f1f3f5 50%, #e9ecef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 10px;
}
.es-skeleton-line.short { width: 55%; }
.es-skeleton-line.tall  { height: 16px; margin-bottom: 8px; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty / error state ────────────────────────── */
.es-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--es-muted);
}
.es-empty i {
  font-size: 2.5rem;
  color: #d1d5db;
  margin-bottom: 16px;
  display: block;
}
.es-empty h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--es-text);
  margin-bottom: 6px;
}
.es-empty p { font-size: .88rem; margin: 0; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 991px) {
  .es-layout {
    grid-template-columns: 1fr;
  }

  /* Filter Sidebar as Mobile Drawer */
  .es-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    z-index: 1060;
    background: #fff;
    border-radius: 0;
    border: none;
    box-shadow: 4px 0 30px rgba(0,0,0,0.15);
    transition: left 0.3s ease-in-out;
    display: block;
    overflow-y: auto;
    padding: 24px 20px;
  }

  .es-sidebar.open {
    left: 0;
  }

  .es-filter-fab {
    display: flex;
  }

  .es-sidebar-close {
    display: flex;
  }

  /* Backdrop Overlay */
  .es-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  body.filters-open .es-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
  }

  body.filters-open {
    overflow: hidden;
  }

  body.filters-open .es-filter-fab {
    display: none;
  }
}

@media (max-width: 560px) {
  .es-page { padding: 86px 14px 90px; } /* extra bottom for FAB */
  .es-grid, .es-skeleton-grid {
    grid-template-columns: 1fr;
  }
  .es-topbar-title { font-size: 1.1rem; }

  .es-sidebar {
    width: 85%;
    left: -90%;
  }
}
