:root {
    --green: #0F5132;
    --green-light: #16A34A;
    --bg: #F8FAFC;
    --text: #1F2937;
    --muted: #6B7280;
    --border: #E5E7EB;
    --card: #FFFFFF;
    --shadow: 0 4px 12px rgba(0,0,0,.06);
    --shadow-hover: 0 8px 20px rgba(0,0,0,.10);
}
* { box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; justify-content: space-between; align-items: center; background: white; padding: 14px 28px; border-bottom: 1px solid var(--border); }
.brand { font-size: 18px; }
.link-out { color: var(--muted); font-size: 14px; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* ===== Home hero ===== */
.hero { text-align: center; padding: 32px 12px 24px; }
.hero h1 { font-size: 32px; margin: 0 0 8px; }
.hero p  { color: var(--muted); margin: 0 0 22px; font-size: 16px; }
.filter-row { display: flex; gap: 10px; max-width: 720px; margin: 0 auto; }
.filter-row select, .filter-row input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }

.btn { display: inline-block; padding: 10px 18px; border: 1px solid var(--border); background: white; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--text); }
.btn:hover { background: #F1F5F9; }
.btn.primary { background: var(--green); color: white; border-color: var(--green); }
.btn.primary:hover { background: #0a3d27; }
.btn.big { font-size: 16px; padding: 12px 28px; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ===== Franchise card grid ===== */
.franchise-grid { margin-top: 24px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.franchise-card { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); display: block; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.franchise-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); text-decoration: none; }
.franchise-card .hero { position: relative; height: 180px; background-size: cover; background-position: center; background-color: #DCFCE7; }
.franchise-card .hero.placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--green), #2D6A4F); }
.franchise-card .hero-icon { font-size: 56px; color: rgba(255,255,255,.7); }
.franchise-card .price-badge { position: absolute; bottom: 10px; left: 10px; background: rgba(15,81,50,.95); color: white; padding: 5px 11px; border-radius: 14px; font-size: 12.5px; }
.franchise-card .price-badge b { font-size: 13.5px; }
.franchise-card .body { padding: 14px 16px; }
.franchise-card .card-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 4px; }
.franchise-card h3 { margin: 0; font-size: 17px; }
.franchise-card .bay-count { font-size: 11px; color: var(--muted); background: #F1F5F9; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.franchise-card .loc { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.franchise-card .addr { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.franchise-card .desc { font-size: 13.5px; margin: 6px 0 0; line-height: 1.4; }
.amenities-row { display: flex; gap: 4px; margin-top: 8px; }
.amenity-chip { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: #F1F5F9; border-radius: 6px; font-size: 14px; }

.loading, .empty { padding: 40px; text-align: center; color: var(--muted); }
.empty a { color: var(--green); }

/* ===== Venue page ===== */
.venue-page { padding-bottom: 60px; }
.venue-hero-img { height: 320px; background-size: cover; background-position: center; border-radius: 14px; margin-bottom: 18px; box-shadow: var(--shadow); background-color: #DCFCE7; }
.venue-hero-img.placeholder { display: flex; align-items: center; justify-content: center; font-size: 80px; color: white; background: linear-gradient(135deg, var(--green), #2D6A4F); }
.venue-hero-img.placeholder span { opacity: .65; }
.venue-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.venue-header h1 { margin: 0 0 6px; font-size: 30px; }
.loc-row { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.contact-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.contact-row a { color: var(--green); }
.from-price { background: var(--green); color: white; padding: 10px 18px; border-radius: 10px; font-size: 14px; white-space: nowrap; }
.from-price b { font-size: 22px; }

.venue-about p { margin: 0 0 18px; line-height: 1.55; max-width: 760px; color: var(--text); }

.venue-amenities { margin-bottom: 22px; }
.venue-amenities h3 { margin: 0 0 10px; font-size: 16px; }
.amenity-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.amenity-tag { background: white; border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; font-size: 13px; }

.venue-gallery { margin-bottom: 28px; }
.gallery-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.gallery-thumb { display: block; height: 150px; background-size: cover; background-position: center; border-radius: 10px; cursor: zoom-in; transition: opacity .15s ease; }
.gallery-thumb:hover { opacity: .85; }

.venue-book { background: white; border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 22px; }
.venue-book h2 { margin: 0 0 6px; font-size: 22px; }
.venue-book .policy { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.venue-book .policy span { margin-right: 6px; }

.bay-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.bay-card { background: white; border: 2px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.bay-card:hover { border-color: var(--green-light); transform: translateY(-1px); }
.bay-card.sel { border-color: var(--green); background: #ECFDF5; }
.bay-img { height: 120px; background-size: cover; background-position: center; background-color: #DCFCE7; }
.bay-img.placeholder { display: flex; align-items: center; justify-content: center; font-size: 36px; color: rgba(255,255,255,.7); background: linear-gradient(135deg, var(--green), #2D6A4F); }
.bay-body { padding: 12px 14px; }
.bay-name { font-weight: 600; margin-bottom: 4px; font-size: 14.5px; }
.bay-desc { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; line-height: 1.4; }
.bay-price { color: var(--text); font-size: 14px; font-weight: 600; }

.booking-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.booking-controls label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.booking-controls input, .booking-controls select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }

.slots-box { margin-bottom: 6px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.slot-btn { padding: 10px; border: 1px solid var(--green); background: white; color: var(--green); border-radius: 8px; cursor: pointer; font-weight: 600; font-family: Menlo, Consolas, monospace; }
.slot-btn:hover { background: var(--green); color: white; }

#checkoutBox { background: white; border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow); }
#checkoutBox h2 { margin-top: 0; }
#checkoutBox .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#checkoutBox label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
#checkoutBox input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }
.price-summary { background: #F1F5F9; border-radius: 8px; padding: 12px 16px; margin: 14px 0; }
.price-summary .grand { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 17px; }
.err { color: #B91C1C; font-size: 14px; margin-top: 8px; }

/* Confirm + cancel pages */
.confirm-card { background: white; border-radius: 12px; padding: 28px; max-width: 560px; margin: 30px auto; box-shadow: var(--shadow); text-align: center; }
.confirm-card h1 { margin: 0 0 6px; font-size: 26px; }
.confirm-card .venue-name { color: var(--muted); margin: 0 0 4px; }
.confirm-card .when { font-size: 17px; margin: 0 0 18px; }
.code-box { background: #ECFDF5; border-radius: 10px; padding: 18px; margin: 18px 0; }
.code-box .lbl { font-size: 12px; color: var(--muted); }
.code-box .code { font-family: Menlo, Consolas, monospace; font-size: 38px; font-weight: 700; color: var(--green); letter-spacing: 8px; }
.code-box small { color: var(--muted); }
.total { font-size: 15px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; vertical-align: middle; }
.badge.ok { background: #16A34A; color: white; }
.badge.warn { background: #F59E0B; color: white; }
.actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.ok-banner { background: #ECFDF5; border: 1px solid #BBF7D0; color: var(--green); padding: 12px; border-radius: 8px; margin-top: 14px; }

footer { text-align: center; color: var(--muted); padding: 20px; font-size: 12px; }

@media (max-width: 720px) {
    .filter-row { flex-direction: column; }
    .venue-hero-img { height: 200px; }
    .booking-controls { grid-template-columns: 1fr; }
    #checkoutBox .row { grid-template-columns: 1fr; }
    .venue-header { flex-direction: column; }
}
