<?php $pageTitle = 'Dịch vụ Spa - PET SPA'; require BASE_PATH . '/app/views/layouts/header.php'; require BASE_PATH . '/app/views/layouts/navbar.php'; ?>
<main class="container py-5"><div class="d-flex justify-content-between align-items-center mb-4"><div><h1>Dịch vụ Spa</h1><p class="text-muted mb-0">Chăm sóc thú cưng với lịch hẹn rõ ràng, thuận tiện.</p></div><a class="btn btn-primary" href="<?= BASE_URL ?>/?url=customer/booking/create">Đặt lịch</a></div>
<form class="row g-2 mb-4" method="get"><input type="hidden" name="url" value="services"><div class="col-md-5"><input class="form-control" name="search" value="<?= htmlspecialchars($search) ?>" placeholder="Tìm dịch vụ"></div><div class="col-md-4"><select class="form-select" name="category"><option value="">Tất cả danh mục</option><?php foreach ($categories as $item): ?><option value="<?= htmlspecialchars($item['slug']) ?>" <?= $category === $item['slug'] ? 'selected' : '' ?>><?= htmlspecialchars($item['name']) ?></option><?php endforeach; ?></select></div><div class="col-md-2"><button class="btn btn-outline-primary w-100">Lọc</button></div></form>
<div class="row g-4"><?php foreach ($services as $item): ?><div class="col-md-6 col-lg-4"><article class="card h-100 shadow-sm"><?php if ($item['featured_image']): ?><img class="card-img-top" style="height:190px;object-fit:cover" src="<?= BASE_URL ?>/<?= htmlspecialchars(ltrim($item['featured_image'], '/')) ?>" alt=""><?php endif; ?><div class="card-body d-flex flex-column"><small class="text-primary"><?= htmlspecialchars($item['category_name'] ?? 'Spa') ?></small><h2 class="h5 mt-2"><?= htmlspecialchars($item['name']) ?></h2><p class="text-muted"><?= htmlspecialchars($item['short_description'] ?? '') ?></p><div class="mt-auto"><strong><?= number_format((float) $item['price'], 0, ',', '.') ?>đ</strong> · <?= (int) $item['duration_minutes'] ?> phút<br><a class="btn btn-primary mt-3" href="<?= BASE_URL ?>/?url=service&slug=<?= urlencode($item['slug']) ?>">Xem & đặt lịch</a></div></div></article></div><?php endforeach; ?><?php if (!$services): ?><p class="text-muted">Chưa có dịch vụ phù hợp.</p><?php endif; ?></div></main>
<?php require BASE_PATH . '/app/views/layouts/footer.php'; ?>
