.services-section {
  padding: 3.5rem 0 3rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header .section-header {
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--muted-foreground);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}

/* ── Category Tabs ─────────────────────────────────────────── */
.category-tabs-wrapper {
  margin-bottom: 1.25rem;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--muted-foreground);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.category-tab:hover {
  background-color: var(--accent);
  color: var(--foreground);
  border-color: var(--ring);
}

.category-tab.active {
  background-color: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
  font-weight: 600;
}

.category-tab i {
  font-size: 0.75rem;
  opacity: 0.8;
}

.category-tab.active i {
  opacity: 1;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0 0.3rem;
  height: 1.125rem;
  border-radius: 9999px;
  background-color: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

.category-tab.active .tab-count {
  background-color: rgba(255, 255, 255, 0.18);
  color: inherit;
}

/* ── Search + Sort toolbar ──────────────────────────────────── */
.search-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.search-toolbar .search-container {
  flex: 1;
  margin-bottom: 0;
}

.sort-select {
  padding: 0.75rem 2.25rem 0.75rem 0.875rem;
  border-radius: var(--radius);
  border: 1px solid var(--input);
  background-color: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  white-space: nowrap;
  min-width: 175px;
}

.sort-select:focus {
  outline: none;
  border-color: var(--ring);
}

/* ── Balance Widget ─────────────────────────────────────────── */
.balance-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  background-color: var(--card);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
  flex-shrink: 0;
}

.balance-widget-icon {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.balance-widget-label {
  color: var(--muted-foreground);
  font-size: 0.8rem;
}

.balance-widget-amount {
  font-weight: 700;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.balance-widget-deposit {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  margin-left: 0.25rem;
  border-radius: 9999px;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.balance-widget-deposit:hover {
  opacity: 0.9;
  color: var(--primary-foreground);
}

.balance-widget-deposit i {
  font-size: 0.625rem;
}

/* ── Search input ───────────────────────────────────────────── */
.search-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  font-size: 0.875rem;
  padding: 0.75rem 2.5rem 0.75rem 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--input);
  background-color: var(--background);
  color: var(--foreground);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  font-size: 0.8rem;
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: all 0.15s ease;
  display: none;
  border: none;
  background: none;
  line-height: 1;
}

.search-clear:hover {
  color: var(--foreground);
  background-color: var(--accent);
}

.search-clear.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Results count ──────────────────────────────────────────── */
.results-info {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
  display: none;
}

.results-info.visible {
  display: block;
}

/* ── Service cards ──────────────────────────────────────────── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.service-card-container {
  opacity: 0;
  transform: translateY(12px);
  animation: cardFadeIn 0.4s ease forwards;
}

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-card {
  background-color: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.service-card:hover {
  border-color: var(--ring);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.card-body {
  padding: 1.25rem 1.25rem 1rem;
  flex: 1;
}

.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.service-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--foreground);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-description {
  color: var(--muted-foreground);
  font-size: 0.8rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-meta {
  display: flex;
  align-items: center;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.service-meta i {
  margin-right: 0.5rem;
  color: var(--foreground);
}

.service-image-container {
  height: 140px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.service-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.service-card:hover .service-image {
  transform: scale(1.05);
}

.btn-order {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  padding: 0.625rem 1rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  font-size: 0.8rem;
  border: none;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-order:hover {
  opacity: 0.9;
  color: var(--primary-foreground);
}

.btn-order i {
  margin-right: 0.5rem;
  font-size: 0.75rem;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.empty-state i {
  font-size: 2.5rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.empty-state-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

.empty-state-text {
  color: var(--muted-foreground);
  max-width: 400px;
  margin: 0 auto;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ── Search highlight ───────────────────────────────────────── */
mark.search-highlight {
  background-color: rgba(255, 213, 0, 0.22);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── Search empty state ─────────────────────────────────────── */
.search-empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: var(--card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  display: none;
}

.search-empty-state.visible {
  display: block;
}

.empty-state-search-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.empty-state-search-icon i {
  font-size: 1.375rem;
  color: var(--muted-foreground);
  opacity: 0.7;
}

.empty-state-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.empty-state-subtext {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.btn-reset-search {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset-search:hover {
  background-color: var(--accent);
  border-color: var(--ring);
}

/* ── Pricing section ────────────────────────────────────────── */
.service-pricing {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.price-starting {
  font-size: 0.65rem;
  color: var(--muted-foreground);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

/* ── Package pill toggle ────────────────────────────────────── */
.pkg-toggle {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
}

.pkg-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--muted-foreground);
  font-size: 0.7rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pkg-pill:hover {
  border-color: var(--foreground);
  color: var(--foreground);
}

.pkg-pill.active {
  background-color: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}

.pkg-price-display {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── Unit price display ─────────────────────────────────────── */
.unit-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.unit-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.unit-price-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 400;
}

/* ── Delivery badge ─────────────────────────────────────────── */
.delivery-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background-color: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  white-space: nowrap;
}

.delivery-badge-inline i {
  font-size: 0.6rem;
  color: hsl(142, 60%, 45%);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .services-section {
    padding: 2rem 0;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .search-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .search-toolbar .search-container {
    order: 1;
    width: 100%;
    flex: none;
  }

  .balance-widget {
    order: 2;
    width: 100%;
    flex: none;
    justify-content: center;
  }

  .balance-widget-label {
    display: none;
  }

  .sort-select {
    order: 3;
    min-width: unset;
    flex: 1;
  }

}

/* ============================================================
   Phase 3: Mobile Optimizations
   ============================================================ */

/* Two-column grid at 577–768px (overrides the 1-col rule above) */
@media (min-width: 577px) and (max-width: 768px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Full-width Order Now on small mobile */
@media (max-width: 576px) {
  .btn-order {
    width: 100%;
  }
}

/* ---- Skeleton loading ---- */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 577px) and (max-width: 768px) {
  .skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.skeleton-card {
  background-color: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-image {
  height: 140px;
  background: linear-gradient(
    90deg,
    var(--muted) 0%,
    var(--accent) 50%,
    var(--muted) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

.skeleton-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.skeleton-line {
  height: 0.875rem;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--muted) 0%,
    var(--accent) 50%,
    var(--muted) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

.skeleton-line.skeleton-title {
  width: 70%;
  height: 1rem;
}

.skeleton-line.skeleton-price {
  width: 38%;
  height: 1.125rem;
  animation-delay: 0.1s;
}

.skeleton-line.skeleton-desc {
  width: 100%;
  animation-delay: 0.2s;
}

.skeleton-line.skeleton-desc.short {
  width: 58%;
  animation-delay: 0.3s;
}

.skeleton-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.skeleton-btn {
  height: 2rem;
  border-radius: var(--radius);
  background: linear-gradient(
    90deg,
    var(--muted) 0%,
    var(--accent) 50%,
    var(--muted) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
  animation-delay: 0.4s;
}

/* Disable re-animation when category/filter changes after initial load */
.service-grid.no-anim .service-card-container {
  animation: none;
  opacity: 1;
  transform: none;
}

/* ---- Lazy image placeholder ---- */
.img-lazy {
  background: linear-gradient(135deg, var(--muted) 0%, var(--accent) 100%);
  transition: opacity 0.3s ease;
}

/* ---- Mobile Filter Button (static, inside toolbar) ---- */
.mobile-filter-fab {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--background);
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.mobile-filter-fab:hover {
  background-color: var(--accent);
  border-color: var(--ring);
}

.mobile-filter-fab i {
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .mobile-filter-fab {
    display: inline-flex;
    order: 4;
    flex: 1;
  }
}

/* ---- Mobile Bottom Sheet ---- */
.mobile-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-sheet-backdrop.is-open {
  display: block;
  opacity: 1;
}

.mobile-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background-color: var(--card);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--border);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.mobile-bottom-sheet.is-open {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background-color: var(--muted-foreground);
  opacity: 0.3;
  margin: 0.75rem auto 0;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sheet-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.sheet-close {
  background: none;
  border: none;
  color: var(--muted-foreground);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: color 0.15s ease, background-color 0.15s ease;
  line-height: 1;
  font-family: inherit;
}

.sheet-close:hover {
  color: var(--foreground);
  background-color: var(--accent);
}

.sheet-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.sheet-section {
  margin-bottom: 1.5rem;
}

.sheet-section:last-child {
  margin-bottom: 0;
}

.sheet-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.sheet-categories {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sheet-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  color: var(--foreground);
  background-color: transparent;
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sheet-cat-item:hover {
  background-color: var(--accent);
  color: var(--foreground);
}

.sheet-cat-item.active {
  background-color: var(--accent);
  border-color: var(--border);
  font-weight: 600;
}

.sheet-cat-item i {
  margin-right: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

.sheet-cat-item.active i {
  opacity: 1;
}

.sheet-cat-badge {
  display: inline-flex;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  background-color: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 1.5rem;
  justify-content: center;
}

.sheet-sort-options {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sheet-sort-btn {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background-color: transparent;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sheet-sort-btn:hover {
  background-color: var(--accent);
}

.sheet-sort-btn.active {
  background-color: var(--accent);
  border-color: var(--border);
  font-weight: 600;
}

.sheet-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sheet-reset-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sheet-reset-btn:hover {
  background-color: var(--accent);
  border-color: var(--ring);
}

.sheet-apply-btn {
  flex: 2;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  border: none;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.sheet-apply-btn:hover {
  opacity: 0.9;
}
