/* MakaziHub UI additions: Airbnb-style photo gallery, card carousel, room tiles.
   Plain CSS (no build step needed). */

/* ---------- Gallery (property page) ---------- */
.mh-gallery { position: relative; margin-bottom: 1.5rem; }
.mh-grid { display: grid; gap: 8px; border-radius: 24px; overflow: hidden; height: clamp(260px, 42vw, 440px); }
.mh-grid > button { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #dfe3f1; cursor: pointer; overflow: hidden; }
.mh-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease, filter .25s ease; }
.mh-grid > button:hover img { filter: brightness(.9); }
.mh-grid > button:first-child:hover img { transform: scale(1.02); }
/* 1 photo */
.mh-grid.n1 { grid-template-columns: 1fr; }
/* 2 photos */
.mh-grid.n2 { grid-template-columns: 1fr 1fr; }
/* 3 photos: big left, two stacked right */
.mh-grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.mh-grid.n3 > button:first-child { grid-row: span 2; }
/* 4 photos */
.mh-grid.n4 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mh-grid.n4 > button:first-child { grid-row: span 2; }
.mh-grid.n4 > button:nth-child(4) { grid-column: 2 / span 2; }
/* 5 photos or more: 1 large + 4 small (Airbnb) */
.mh-grid.n5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mh-grid.n5 > button:first-child { grid-row: span 2; }

.mh-showall { position: absolute; right: 16px; bottom: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px; border: 1px solid #222; background: #fff; color: #222; font-weight: 800; font-size: 13px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.mh-showall:hover { background: #f4f4f7; }

/* Mobile: full-width swipe carousel with a counter, like the Airbnb app */
.mh-swipe { display: none; position: relative; border-radius: 22px; overflow: hidden; }
.mh-swipe-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mh-swipe-track::-webkit-scrollbar { display: none; }
.mh-swipe-track button { flex: 0 0 100%; scroll-snap-align: center; padding: 0; border: 0; background: #dfe3f1; aspect-ratio: 4 / 3; }
.mh-swipe-track img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mh-counter { position: absolute; right: 12px; bottom: 12px; padding: 4px 11px; border-radius: 999px; background: rgba(20,20,30,.72); color: #fff; font-weight: 800; font-size: 12px; }
@media (max-width: 767px) {
    .mh-grid, .mh-showall { display: none; }
    .mh-swipe { display: block; }
}

/* Full-screen viewer */
.mh-modal { position: fixed; inset: 0; z-index: 90; background: #101014; color: #fff; display: flex; flex-direction: column; }
.mh-modal-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font-weight: 800; }
.mh-modal-top button { border: 0; background: rgba(255,255,255,.12); color: #fff; width: 40px; height: 40px; border-radius: 999px; cursor: pointer; font-size: 16px; }
.mh-modal-top button:hover { background: rgba(255,255,255,.22); }
.mh-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 64px; }
.mh-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.mh-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 999px; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; cursor: pointer; }
.mh-nav:hover { background: rgba(255,255,255,.26); }
.mh-nav.prev { left: 12px; } .mh-nav.next { right: 12px; }
.mh-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px 18px; justify-content: center; }
.mh-thumbs button { flex: 0 0 auto; width: 74px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; opacity: .55; background: none; cursor: pointer; }
.mh-thumbs button.on { opacity: 1; border-color: #fff; }
.mh-thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) { .mh-stage { padding: 0 8px; } .mh-nav { display: none; } }

/* ---------- Property card media carousel ---------- */
.mh-card-media { position: relative; overflow: hidden; border-radius: 22px; }
.mh-card-media img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; display: block; transition: opacity .25s ease; }
.mh-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 999px; border: 0; background: rgba(255,255,255,.92); color: #222; font-size: 12px; cursor: pointer; opacity: 0; box-shadow: 0 1px 6px rgba(0,0,0,.25); transition: opacity .2s; }
.mh-arrow.prev { left: 8px; } .mh-arrow.next { right: 8px; }
.mh-card-media:hover .mh-arrow, .mh-arrow:focus-visible { opacity: 1; }
@media (hover: none) { .mh-arrow { opacity: 1; } }
.mh-dots { position: absolute; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.mh-dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.6); }
.mh-dots i.on { background: #fff; transform: scale(1.25); }

/* ---------- Horizontal scroll rows (home page "Stay in <region>") ---------- */
.mh-scroll-row { scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
.mh-scroll-row::-webkit-scrollbar { display: none; }

/* ---------- Room tiles: allow names and letters ---------- */
.room-tile { overflow: hidden; }
.room-tile.is-name { font-size: 11px; line-height: 1.15; text-align: center; word-break: break-word; }

/* ---------- Price breakdown (booking card) ---------- */
.mh-price { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
.mh-price > div { display: flex; justify-content: space-between; gap: 12px; }
.mh-price .total { border-top: 1px solid rgba(0,0,0,.1); padding-top: 8px; margin-top: 2px; font-size: 15px; font-weight: 900; }
