/* ============================================================
   BMpro - CSS GLOBAL
   Digunakan oleh: index.html, search.html, detail.html
   ============================================================ */

   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  :root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #1a252f;
    --gray: #7f8c8d;
    --shadow: 0 4px 12px rgba(0,0,0,0.15);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
  }
  
  body {
    font-family: 'Poppins', sans-serif;
    background: #f8f9fa;
    color: #2c3e50;
    line-height: 1.4;
    font-size: 14px;
    overflow-x: hidden;        /* ✅ Cegah scroll horizontal */
    max-width: 100vw;          /* ✅ Batasi lebar maksimal */
  }
  
  /* ============================================================
     HEADER
     ============================================================ */
  .mobile-header {
    position: relative;
    width: 100%;
    height: 50vh;
    min-height: 280px;
    max-height: 400px;
    background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.55)), 
                url('https://images.unsplash.com/photo-1564013799919-ab600027ffc6?w=800&q=80');
    background-size: cover;
    background-position: center;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  
  .header-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(44,62,80,0.6) 0%, rgba(52,152,219,0.3) 100%);
  }
  
  .hamburger-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  
  .hamburger-btn i {
    font-size: 22px;
    color: var(--primary);
  }
  
  .header-content {
    position: absolute;
    bottom: 28px;
    left: 0; right: 0;
    padding: 0 20px;
    color: white;
    z-index: 5;
  }
  
  .header-content .badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
  }
  
  .header-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 6px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
  }
  
  .header-content p {
    font-size: 0.85rem;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  
  /* ============================================================
     SIDEBAR MENU
     ============================================================ */
  .sidebar-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 300px;
    height: 100vh;
    background: white;
    z-index: 2000;
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    transition: left 0.3s;
    overflow-y: auto;
  }
  
  .sidebar-menu.active {
    left: 0;
  }
  
  .menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
  }
  
  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  .sidebar-header {
    padding: 20px 16px 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
  }
  
  .sidebar-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
  }
  
  .sidebar-logo {
    width: 45px;
    height: 40px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    overflow: hidden;
  }
  
  .sidebar-logo img {
    width: 70%;
    height: 70%;
    object-fit: cover;
  }
  
  .sidebar-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
  }
  
  .sidebar-header p {
    font-size: 0.7rem;
    opacity: 0.9;
    margin-left: 60px;
  }
  
  .menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .menu-item i {
    width: 22px;
    color: var(--secondary);
    font-size: 1.1rem;
  }
  
  .sidebar-footer {
    padding: 16px;
    border-top: 1px solid #eee;
    font-size: 0.7rem;
    color: var(--gray);
    text-align: center;
  }
  
  /* ============================================================
     SEARCH BAR
     ============================================================ */
  .search-section {
    padding: 12px 12px 6px;
    margin-top: -18px;
    position: relative;
    z-index: 10;
  }
  
  .search-box {
    background: white;
    border-radius: 30px;
    padding: 2px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.04);
    min-width: 0;
  }
  
  .search-box i {
    color: var(--gray);
    font-size: 0.8rem;
    margin-left: 8px;
    margin-right: 2px;
    flex-shrink: 0;
  }
  
  .search-box input {
    flex: 1;
    border: none;
    padding: 8px 2px;
    font-size: 0.75rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    background: transparent;
    min-width: 0;
  }
  
  .search-box input::placeholder {
    color: #bdc3c7;
    font-size: 0.7rem;
  }
  
  .search-box button {
    background: var(--secondary);
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.65rem;
    cursor: pointer;
    white-space: nowrap;
    margin: 1px;
    flex-shrink: 0;
  }
  
  .search-box .filter-btn-inside {
    background: transparent;
    color: var(--gray);
    border: none;
    padding: 6px 8px;
    border-radius: 30px;
    font-size: 0.8rem;
    cursor: pointer;
    margin: 1px;
    flex-shrink: 0;
  }
  
  .search-box .filter-btn-inside i {
    font-size: 0.8rem;
    margin: 0;
    color: var(--gray);
  }
  
  /* ============================================================
     SECTION CONTAINER
     ============================================================ */
     .section-container {
      padding: 18px 14px;
      overflow: hidden;          /* ✅ Cegah overflow */
      max-width: 100%;
    }
  
  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
  }
  
  .section-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .section-header h4 i {
    color: var(--accent);
    font-size: 1rem;
  }
  
  .section-header a {
    color: var(--secondary);
    font-size: 0.75rem;
    text-decoration: none;
  }
  
  /* ============================================================
     PROPERTY CARDS
     ============================================================ */
  .property-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  
  .property-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.03);
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
  }
  
  .property-card:active {
    transform: scale(0.99);
  }
  
  .card-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
  }
  
  .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    color: white;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
  }
  
  .tab-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
  }
  
  .favorite-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255,255,255,0.95);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  
  .favorite-btn i {
    color: var(--accent);
    font-size: 1rem;
  }
  
  .card-content {
    padding: 14px;
  }
  
  .property-price {
    font-size: 1.10rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
    line-height: 1.2;
  }
  
  .property-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark);
    line-height: 1.3;
  }
  
  .property-address {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--gray);
    font-size: 0.7rem;
    margin-bottom: 10px;
  }
  
  .property-address i {
    color: var(--secondary);
    font-size: 0.65rem;
  }
  
  .property-features {
    display: flex;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
  }
  
  .feature {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #666;
  }
  
  .feature i {
    color: var(--secondary);
    font-size: 0.8rem;
  }
  
  /* ============================================================
     GALERI GRID
     ============================================================ */
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  }
  
  .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .gallery-item .overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    color: white;
    padding: 8px 6px 6px;
    font-size: 0.65rem;
    font-weight: 500;
  }
  
  /* ============================================================
     BOTTOM NAVIGATION
     ============================================================ */
  .bottom-nav {
    position: sticky;
    bottom: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 14px calc(8px + var(--safe-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    border-top: 1px solid #eee;
    z-index: 100;
  }
  
  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray);
    font-size: 0.6rem;
  }
  
  .nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
  }
  
  .nav-item.active {
    color: var(--secondary);
  }
  
  /* ============================================================
     LOADING & EMPTY STATE
     ============================================================ */
  .loading {
    text-align: center;
    padding: 30px 16px;
    color: var(--gray);
  }
  
  .loading i {
    font-size: 1.8rem;
    color: var(--secondary);
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  
  .empty-state {
    text-align: center;
    padding: 30px 16px;
    background: white;
    border-radius: 16px;
  }
  
  .empty-state i {
    font-size: 2.5rem;
    color: #ddd;
    margin-bottom: 10px;
  }
  
  .empty-state p {
    color: var(--gray);
    font-size: 0.8rem;
  }
  
  /* ============================================================
     FILTER SHEET (Digunakan di search.html)
     ============================================================ */
  .filter-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 20px 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 4000;
    transform: translateY(100%);
    transition: transform 0.3s;
    max-height: 70vh;
    overflow-y: auto;
  }
  
  .filter-sheet.active {
    transform: translateY(0);
  }
  
  .filter-sheet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
  }
  
  .filter-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  .filter-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  
  .filter-sheet-header h4 {
    font-size: 1rem;
    font-weight: 600;
  }
  
  .filter-group {
    margin-bottom: 18px;
  }
  
  .filter-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--primary);
  }
  
  .filter-group select,
  .filter-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    background: white;
  }
  
  .range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .range-inputs input {
    flex: 1;
  }
  
  .filter-sheet-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-bottom: 10px;
  }
  
  .btn-reset {
    flex: 1;
    background: #eee;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
  }
  
  .btn-apply {
    flex: 1;
    background: var(--secondary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
  }
  
  /* ============================================================
     DETAIL PAGE (Digunakan di detail.html)
     ============================================================ */
  .detail-main-image {
    width: 100%;
    height: 280px;
    position: relative;
  }
  
  .detail-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .image-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
  }
  
  .detail-thumbnails {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    overflow-x: auto;
  }
  
  .thumbnail {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
  }
  
  .thumbnail.active {
    border-color: var(--secondary);
  }
  
  .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .detail-info {
    background: white;
    padding: 20px 16px;
    margin-top: 8px;
  }
  
  .detail-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
  }
  
  .detail-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
  }
  
  .detail-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 16px;
  }
  
  .detail-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    text-align: center;
  }
  
  .detail-feature i {
    font-size: 1.2rem;
    color: var(--secondary);
    margin-bottom: 4px;
  }
  
  .detail-feature .value {
    font-size: 0.9rem;
    font-weight: 600;
  }
  
  .detail-feature .label {
    font-size: 0.6rem;
    color: var(--gray);
  }
  
  .detail-description {
    background: white;
    padding: 20px 16px;
    margin-top: 8px;
  }
  
  .detail-description h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
  }
  
  .detail-description p {
    color: #555;
    font-size: 0.85rem;
    line-height: 1.6;
  }
  
  .detail-specs {
    background: white;
    padding: 20px 16px;
    margin-top: 8px;
  }
  
  .spec-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .spec-label {
    width: 120px;
    color: var(--gray);
    font-size: 0.8rem;
  }
  
  .spec-value {
    flex: 1;
    font-weight: 500;
    font-size: 0.85rem;
  }
  
  .detail-contact {
    background: white;
    padding: 20px 16px;
    margin-top: 8px;
    margin-bottom: 20px;
  }
  
  .contact-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
  }
  
  .btn-wa {
    flex: 1;
    background: #25D366;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  .btn-call {
    flex: 1;
    background: var(--secondary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  /* ============================================================
     RESPONSIVE
     ============================================================ */
  @media (min-width: 480px) {
    .header-content h1 { font-size: 2rem; }
    .property-title { font-size: 1rem; }
    .property-price { font-size: 1.35rem; }
  }
  
  @media (min-width: 768px) {
    .property-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
    }
    .gallery-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  @media (min-width: 1024px) {
    .property-grid {
      grid-template-columns: repeat(3, 1fr);
    }
    .gallery-grid {
      grid-template-columns: repeat(4, 1fr);
    }
  }

/* ============================================================
   CAROUSEL / SLIDER FINAL- TETAP DALAM FRAME MOBILE
   ============================================================ */
   .featured-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 8px;
    padding: 4px 0 8px 0;
  }
  
  .carousel-container {
    display: flex;
    transition: transform 0.4s ease;
    width: 100%;
  }
  
  .carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    padding: 8px 4px 12px 4px;
  }
  
  .carousel-slide .property-card {
    margin: 0;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border: none;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .carousel-slide .property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  }
  
  .carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 4px;
  }
  
  .carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    transition: all 0.3s;
    cursor: pointer;
  }
  
  .carousel-dot.active {
    width: 20px;
    border-radius: 10px;
    background: var(--secondary);
  }
  
  .carousel-arrow {
    position: absolute;
    top: 0;
    bottom: 55%;
    height: 26px;
    width: 26px;
    margin: auto 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: background 0.2s ease;
  }
  
  .carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.85);
  }
  
  .carousel-arrow.prev { left: 6px; }
  .carousel-arrow.next { right: 6px; }
  
  .carousel-arrow i {
    font-size: 0.7rem;
    color: rgba(44, 62, 80, 0.7);
    transition: color 0.2s ease;
  }
  
  .carousel-arrow:hover i {
    color: rgba(44, 62, 80, 1);
  }
