/* ============================================================
   Homestay.ma — CI3 App CSS (extends style.css)
   ============================================================ */

/* ── Alerts ── */
.alert { padding: 14px 18px; border-radius: 8px; margin: 16px 0; font-size: 0.9rem; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ── Filter Bar ── */
.filter-bar { background: var(--ivory); border-bottom: 1px solid rgba(30,20,16,0.1); padding: 14px 0; position: sticky; top: 0; z-index: 40; }
.filter-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 0.68rem; color: var(--stone); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.filter-group select, .filter-group input { padding: 8px 12px; border: 1px solid rgba(30,20,16,0.15); border-radius: 6px; font-size: 0.9rem; background: var(--ivory); color: var(--ink); font-family: var(--font-body); }
.filter-group select:focus, .filter-group input:focus { outline: none; border-color: var(--clay); }

/* ── Listings Grid (browse page) ── */
.listings-grid-browse { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }

/* ── Property Gallery ── */
.property-gallery { max-width: var(--max); margin: 0 auto; padding: 24px 2rem 0; }
.gallery-main img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 12px; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs img { width: 100px; height: 70px; object-fit: cover; border-radius: 6px; cursor: pointer; flex-shrink: 0; border: 2px solid transparent; transition: border-color 0.2s; }
.gallery-thumbs img:hover { border-color: var(--clay); }

/* ── Property Detail Body ── */
.property-detail { max-width: var(--max); margin: 0 auto; padding: 2rem; display: grid; grid-template-columns: 1fr 340px; gap: 3rem; }
.property-section { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(30,20,16,0.1); }
.property-section:last-child { border-bottom: none; }
.property-section h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.amenities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.amenity-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--cream); border-radius: 6px; font-size: 0.875rem; }
.amenity-item i { color: var(--clay); }

/* ── Booking Sidebar ── */
.booking-sidebar { position: sticky; top: 80px; }
.booking-card { background: var(--ivory); border: 1px solid rgba(30,20,16,0.1); border-radius: 12px; padding: 2rem; box-shadow: 0 4px 20px rgba(30,20,16,0.08); }
.booking-price strong { font-family: var(--font-display); font-size: 1.75rem; color: var(--clay); }
.booking-price span { color: var(--stone); font-size: 0.85rem; }

/* ── Reservation confirm ── */
.confirm-wrap { max-width: 560px; margin: 60px auto; padding: 0 2rem; }
.confirm-card { background: var(--ivory); border-radius: 16px; padding: 3rem; text-align: center; box-shadow: 0 8px 40px rgba(30,20,16,0.1); }
.confirm-icon { font-size: 3.5rem; color: #10b981; margin-bottom: 1rem; }
.confirm-card h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(30,20,16,0.08); font-size: 0.9rem; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; margin-top: 1.5rem; }

/* ── Blog teasers header ── */
.blog-teasers .section-header { display: flex; justify-content: space-between; align-items: baseline; }
.link-all { font-size: 0.875rem; color: var(--clay); text-decoration: none; font-weight: 500; }
.link-all:hover { text-decoration: underline; }

/* ── Pagination ── */
.pagination-wrap { display: flex; justify-content: center; margin-top: 3rem; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 5rem 2rem; color: var(--stone); }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; display: block; }

/* ── Utility ── */
.text-center { text-align: center; }
.mt-sm { margin-top: 8px; }
.btn-block { width: 100%; justify-content: center; border-radius: 8px; }
.btn-sm { padding: 0.6rem 1.2rem; font-size: 0.85rem; }

/* ── Browse Page Filters Bar ── */
.filters-bar { background: var(--ivory); padding: 1.5rem 0; border-bottom: 1px solid rgba(30,20,16,0.08); position: sticky; top: 72px; z-index: 50; backdrop-filter: blur(10px); }
.filters-inner { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.filters-form-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.filter-chip { padding: 0.6rem 1.2rem; border: 1px solid rgba(30,20,16,0.15); border-radius: 999px; font-size: 0.9rem; color: var(--ink-soft); cursor: pointer; transition: all 0.3s; background: var(--ivory); font-family: var(--font-body); appearance: none; }
.filter-chip:hover, .filter-chip.active { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.results-count { margin-left: auto; font-family: 'Instrument Serif', serif; font-style: italic; color: var(--stone); }

/* ── Listings Grid (browse page — 3 col) ── */
.listings-grid-4 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.listings-grid-browse { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }

/* ════════════════════════════════
   DETAIL PAGE
════════════════════════════════ */

/* Hero */
.detail-hero { position: relative; height: 92vh; min-height: 560px; background-size: cover; background-position: center; display: flex; align-items: flex-end; }
.detail-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,12,8,0.75) 0%, rgba(20,12,8,0.2) 50%, transparent 100%); }
.detail-hero-inner { position: relative; z-index: 1; padding-bottom: 3rem; }
.detail-hero-title { font-size: clamp(2.5rem, 6vw, 5.5rem); color: #fff; line-height: 1; margin-bottom: 0.75rem; font-variation-settings: "opsz" 144, "SOFT" 20; }
.detail-hero-sub { font-size: 1.1rem; color: rgba(255,255,255,0.75); margin-bottom: 1.5rem; }
.detail-photos-btn { background: rgba(255,255,255,0.15); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 0.6rem 1.4rem; border-radius: 999px; font-size: 0.9rem; cursor: pointer; font-family: var(--font-body); transition: background 0.2s; }
.detail-photos-btn:hover { background: rgba(255,255,255,0.25); }

/* Sticky Booking Bar */
.detail-booking-bar { background: var(--ivory); border-bottom: 1px solid rgba(30,20,16,0.1); padding: 1.25rem 0; position: sticky; top: 72px; z-index: 60; transition: box-shadow 0.3s; }
.detail-booking-bar.is-sticky { box-shadow: 0 4px 24px rgba(30,20,16,0.1); }
.detail-booking-bar-inner { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.detail-booking-price { display: flex; align-items: baseline; gap: 0.4rem; flex-shrink: 0; }
.detail-booking-price .price-from { font-size: 0.8rem; color: var(--stone); }
.detail-booking-price strong { font-family: var(--font-display); font-size: 2rem; color: var(--clay); font-variation-settings: "opsz" 48; line-height: 1; }
.detail-booking-price .price-unit { font-size: 0.85rem; color: var(--stone); }
.detail-rating-badge { background: var(--ink); color: #fff; font-size: 0.8rem; padding: 0.25rem 0.7rem; border-radius: 4px; margin-left: 1rem; font-weight: 600; white-space: nowrap; }
.detail-booking-form { display: flex; align-items: stretch; gap: 0; flex: 1; max-width: 700px; border: 1px solid rgba(30,20,16,0.15); border-radius: 8px; overflow: hidden; background: #fff; }
.detail-date-field { display: flex; flex-direction: column; padding: 0.6rem 1rem; border-right: 1px solid rgba(30,20,16,0.1); min-width: 140px; flex: 1; }
.detail-date-field label { font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--stone); margin-bottom: 3px; }
.detail-date-field input, .detail-date-field select { border: none; outline: none; font-size: 0.9rem; color: var(--ink); background: transparent; font-family: var(--font-body); padding: 0; }
.detail-book-btn { border-radius: 0; padding: 0 2rem; white-space: nowrap; flex-shrink: 0; }

/* Amenities icon grid */
.amenities-icon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem 2rem; }
.amenity-icon-item { display: flex; align-items: flex-start; gap: 1rem; }
.amenity-icon-wrap { width: 40px; height: 40px; border-radius: 50%; background: rgba(156,61,31,0.08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.amenity-icon-wrap i { color: var(--clay); font-size: 1rem; }
.amenity-icon-item strong { display: block; font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.amenity-icon-item p { font-size: 0.82rem; color: var(--stone); margin: 0.2rem 0 0; }

/* Gallery (dark section) */
.detail-gallery-section { background: var(--ink); padding: 4rem 0; }
.detail-gallery-heading { font-size: clamp(1.3rem, 2.5vw, 1.8rem); color: #fff; margin-bottom: 2rem; display: flex; align-items: center; gap: 0.75rem; }
.detail-gallery-count { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); font-size: 0.85rem; font-family: var(--font-body); padding: 0.2rem 0.7rem; border-radius: 999px; }
.detail-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail-gallery-cell { overflow: hidden; border-radius: 4px; aspect-ratio: 4/3; }
.detail-gallery-cell--wide { grid-column: span 2; aspect-ratio: 16/9; }
.detail-gallery-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.detail-gallery-cell:hover img { transform: scale(1.04); }

/* Reviews */
.detail-reviews-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.detail-review-card { background: var(--cream); border-radius: 10px; padding: 1.5rem; }

/* Related */
.detail-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.detail-related-card { border: 1px solid rgba(30,20,16,0.1); border-radius: 10px; overflow: hidden; transition: transform 0.3s; }
.detail-related-card:hover { transform: translateY(-4px); }
.detail-related-img { height: 180px; overflow: hidden; }
.detail-related-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-related-body { padding: 1.25rem; }
.detail-related-body h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }

/* Lightbox */
.gallery-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.gallery-overlay img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 4px; }
.gallery-overlay-close { position: absolute; top: 1.5rem; right: 1.5rem; background: rgba(255,255,255,0.1); border: none; color: #fff; font-size: 2rem; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gallery-overlay-prev, .gallery-overlay-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); border: none; color: #fff; font-size: 2.5rem; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.gallery-overlay-prev:hover, .gallery-overlay-next:hover { background: rgba(255,255,255,0.2); }
.gallery-overlay-prev { left: 1.5rem; }
.gallery-overlay-next { right: 1.5rem; }
.gallery-overlay-count { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.6); font-size: 0.85rem; }

/* ── Responsive additions ── */
@media (max-width: 1024px) {
  .property-detail { grid-template-columns: 1fr; }
  .booking-sidebar { position: static; }
  .listings-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .amenities-icon-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-related-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-reviews-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .property-detail { padding: 1rem; }
  .listings-grid-4 { grid-template-columns: 1fr; }
  .filters-bar { position: static; }
  .detail-hero { height: 70vh; }
  .detail-booking-bar-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .detail-booking-form { flex-direction: column; border-radius: 8px; max-width: 100%; }
  .detail-date-field { border-right: none; border-bottom: 1px solid rgba(30,20,16,0.1); }
  .detail-book-btn { border-radius: 0 0 8px 8px; padding: 1rem; }
  .amenities-icon-grid { grid-template-columns: 1fr; }
  .detail-gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-gallery-cell--wide { grid-column: span 2; }
  .detail-related-grid { grid-template-columns: 1fr; }
}
