/**
 * Araba Kirala — tablet / mobil düzen
 * Sadece rent/index.blade.php üzerinden yüklenir; diğer sayfalara dokunmaz.
 */

/* Beyaz zemin kaynaklarını kapat (tüm genişlikler) */
.cs-rentcar-section-1 .cs-search-locDate-area-1{
  background: var(--dp-bg-surface, #101a2e) !important;
}

.cs-rentcar-section-2.active::before{
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  z-index: 1100 !important;
  background-color: rgba(4, 7, 15, 0.78) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  backdrop-filter: blur(6px) !important;
}

.cs-rentcar-section-2 .csrcr1-col-1,
.cs-rentcar-section-2 .cs-page-list-1,
.cs-rentcar-section-2 .cs-page-list-1 .inner-pl-1{
  background: transparent !important;
}

.cs-rentcar-section-2 .cs-page-filter-d-1{
  background: var(--dp-bg-card, rgba(16, 26, 46, 0.94)) !important;
}

.cs-rentcar-section-2 .leaflet-container{
  background: var(--dp-bg-surface, #101a2e) !important;
}

/* Harita popup — masaüstü dahil, yalnızca bu sayfa */
.leaflet-popup-content{
  margin: 12px 14px 14px;
  width: auto;
  min-width: 260px;
  max-width: min(92vw, 340px);
}

/* Tablet (768px – 1023px) */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .cs-rentcar-section-1 .cs-search-locDate-area-1 .inn-cont-1,
  .cs-rentcar-section-2 .cs-page-filter-d-1 .inner-f-div-1,
  .cs-rentcar-section-2 .cs-page-list-1{
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    margin-left: auto;
    margin-right: auto;
  }

  .cs-rentcar-section-1 .cs-loc-date-d-1{
    flex-wrap: wrap;
    max-width: 100%;
  }

  .cs-rentcar-section-1 .cs-loc-date-d-1 .csld1-col-1,
  .cs-rentcar-section-1 .cs-loc-date-d-1 .csld1-col-2,
  .cs-rentcar-section-1 .cs-loc-date-d-1 .csld1-col-3{
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
  }

  .cs-rentcar-section-1 .csld1-col-3 .cs-secondary-btn-1{
    width: 100%;
  }

  .cs-rentcar-section-2 .cs-page-filter-d-1 .fmm-f-div-1{
    min-width: 0;
    max-width: min(100%, 520px);
  }

  .cs-rentcar-section-2 .cs-page-filter-d-1 .fmm-f-div-1 .fmm-middle-area-1{
    max-height: 55vh;
    min-height: 0 !important;
    overflow-y: auto;
  }

  .cs-rentcar-section-2 .cs-page-filter-d-1 .fmm-f-div-1:not(.active){
    display: none !important;
  }

  .cs-rentcar-section-2 .cs-page-filter-d-1 .fmm-f-div-1.active{
    display: block !important;
    z-index: 1200;
  }

  .cs-rentcar-section-2 .csrcr1-col-2 #map{
    min-height: 300px;
  }

  .cs-rentcar-section-2 .cs-car-box-1 .cscb-bottm-area-1{
    flex-wrap: wrap;
    gap: 10px;
  }

  .cs-rentcar-section-2 .cs-list-row-1 .cslr1-col-1{
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Tablet + mobil — sol sütun gereksiz min-height kaldır */
@media (max-width: 1023.98px) {
  .cs-rentcar-section-2 .csrcr1-col-1{
    min-height: 0 !important;
  }
}

/* Mobil (≤767px) */
@media (max-width: 767.98px) {
  .cs-rentcar-section-1,
  .cs-rentcar-section-2{
    overflow-x: clip;
  }

  .cs-rentcar-section-1 .cs-search-locDate-area-1 .inn-cont-1,
  .cs-rentcar-section-2 .cs-page-filter-d-1 .inner-f-div-1,
  .cs-rentcar-section-2 .cs-page-list-1{
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }

  .cs-rentcar-section-1 .cs-loc-date-d-1{
    max-width: 100%;
  }

  .cs-rentcar-section-1 .cs-loc-date-d-1 .csld1-col-1,
  .cs-rentcar-section-1 .cs-loc-date-d-1 .csld1-col-2,
  .cs-rentcar-section-1 .cs-loc-date-d-1 .csld1-col-3{
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  .cs-rentcar-section-2 .cs-page-filter-d-1 .filter-mm-1 .fmm-item-1{
    position: static;
  }

  /* Kapalı filtre paneli yer kaplamasın ve beyaz blok oluşturmasın */
  .cs-rentcar-section-2 .cs-page-filter-d-1 .fmm-f-div-1:not(.active){
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .cs-rentcar-section-2 .cs-page-filter-d-1 .fmm-f-div-1.active{
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(82vh, 680px);
    z-index: 1200;
  }

  .cs-rentcar-section-2 .cs-page-filter-d-1 .fmm-f-div-1.active .fmm-middle-area-1{
    max-height: calc(min(82vh, 680px) - 128px);
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cs-rentcar-section-2 .csrcr1-col-2 #map{
    min-height: 260px;
    height: 40vh;
  }

  .cs-rentcar-section-2 .cs-page-list-1 .inner-pl-1{
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .cs-rentcar-section-2 .cs-page-filter-d-1 .fmm-f-div-1 .fmm-middle-area-1{
    min-height: 0 !important;
  }

  .cs-rentcar-section-2 .cs-page-filter-d-1 .fmm-f-div-1.active{
    background: var(--dp-bg-card, rgba(16, 26, 46, 0.98)) !important;
  }

  .cs-rentcar-section-2 .cs-page-filter-d-1 .cs-white-btn-1{
    background: var(--dp-bg-elevated, #151f35) !important;
    color: var(--dp-text, #f8fafc) !important;
    border: 1px solid var(--dp-border-soft, rgba(148, 163, 184, 0.14)) !important;
  }

  .cs-rentcar-section-2 .cs-list-row-1 .cslr1-col-1{
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  .cs-rentcar-section-2 .cs-car-box-1{
    margin-bottom: 16px;
  }

  .cs-rentcar-section-2 .cs-car-box-1 .cscb-bottm-area-1{
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 10px;
    padding: 14px 12px;
  }

  .cs-rentcar-section-2 .cs-car-box-1 .cscb-bottm-area-1 .desc-2{
    font-size: 17px;
    line-height: 1.3;
  }

  .cs-rentcar-section-2 .cs-car-box-1 .cscb-middle-area-1 .info-div-1 .info-drow-1{
    flex-wrap: wrap;
    gap: 8px;
  }

  .cs-rentcar-section-2 .cs-car-box-1 .cscb-middle-area-1 .info-div-1 .idr1-col-1{
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  /* Harita popup — yalnızca bu sayfada yüklendiği için güvenli */
  .leaflet-popup-content-wrapper{
    max-width: calc(100vw - 24px);
  }

  .leaflet-popup-content{
    margin: 10px 12px 12px;
    width: auto;
    min-width: 0;
    max-width: calc(100vw - 48px);
  }

  .leaflet-popup-content .cs-car-box-1{
    width: 100%;
    max-width: 300px;
  }

  .leaflet-popup-content .cs-car-box-1 .cscb-bottm-area-1{
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .leaflet-popup-content .cs-car-box-1 .img-div-1 img{
    max-height: 160px;
  }
}

/* Çok dar ekranlar */
@media (max-width: 380px) {
  .cs-rentcar-section-2 .cs-page-filter-d-1 .fmm-f-div-1.active{
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .cs-rentcar-section-2 .cs-car-box-1 .cscb-middle-area-1 .info-div-1 .idr1-col-1{
    flex: 1 1 100%;
  }
}
