/* ===========================================================================
   LISTE HARITASI — liste sayfasinin tam ekran harita gorunumu
   ---------------------------------------------------------------------------
   list.php'deki "Haritayi Ac" (masaustu) ve yuzen "Haritada Goster" (mobil)
   dugmeleri bu katmani acar. Yerlesim liste-vitrin.php?v=m4'ten ("Alt
   Tepsi") alindi: harita tum ekran, liste alttan cekilen tepside.

   Adres DEGISMEZ; katman ayni sayfanin ustunde acilir. Acilis/kapanis
   hareketleri assets/js/liste-harita.js'te (WAAPI) — burada yalnizca
   duragan durumlar var, boylece hareket kapaliyken de sayfa dogru gorunur.

   Marka dili: Outfit, #FF344F, #2c3e50, 14px kart, 50px hap.
   =========================================================================== */

.lh {
    --lh-kirmizi: #FF344F;
    --lh-lacivert: #2c3e50;
    --lh-altin: #f5a623;
    --lh-soluk: #66727d;
    --lh-silik: #8a97a3;
    --lh-beyaz: #fff;
    --lh-zemin: #e9edef;

    position: fixed;
    inset: 0;
    /* Header 1000, yuzen harita dugmesi 9000, cerez kutusu 99999:
       katman ikisinin arasinda. Cerez onayi erisilebilir kalmali. */
    z-index: 9500;
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--lh-lacivert);
    overscroll-behavior: contain;
}

.lh[hidden] { display: none; }

/* Katman acikken arkadaki sayfa kaymaz. Lenis'in kendi overflow:clip
   kurali html'de; ikisi cakismaz, ikisi de kaydirmayi kapatir. */
html.lh-acik,
html.lh-acik body {
    overflow: hidden;
}

/* NOT: scrollbar-gutter: stable KULLANILMAZ. Cubuk olmasa da (Lenis onu
   zaten gizliyor) sagda cubuk genisliginde yer ayiriyor, tam ekran katman
   o seridin disinda kaldigi icin beyaz bir dikey cizgi goruluyordu.
   Gercek bir cubuk varsa telafi JS'te: govdeye cubuk kadar sag bosluk. */

/* Arkadaki sayfayi hafifce karartan perde: harita kutudan yayilirken
   sayfa "geri cekilir", toplanirken geri gelir. */
.lh-perde {
    position: absolute;
    inset: 0;
    background: rgba(18, 27, 36, 0.32);
}

.lh-sahne {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: var(--lh-zemin);
    transform-origin: 50% 50%;
}

/* ---------------------------------------------------------------
   Harita
   --------------------------------------------------------------- */
.lh-harita {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 35%, rgba(255, 255, 255, 0.55) 0, rgba(255, 255, 255, 0) 38%),
        radial-gradient(circle at 72% 62%, rgba(255, 255, 255, 0.45) 0, rgba(255, 255, 255, 0) 34%),
        var(--lh-zemin);
}

/* Harita dosemeleri yuklenene kadar sakin, hafifce nefes alan bir tuval.
   Google kendi kabini basinca uzerini tamamen kapatir. */
.lh-harita:not([data-hazir])::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(44, 62, 80, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(44, 62, 80, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    animation: lh-nefes 2.4s ease-in-out infinite;
}

@keyframes lh-nefes {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.lh-harita .gm-style { font-family: 'Outfit', system-ui, sans-serif; }

.lh-hata {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--lh-beyaz);
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 14px;
    color: var(--lh-soluk);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    text-align: center;
    max-width: calc(100% - 48px);
}

/* Fiyat balonu */
.lh-balon {
    display: block;
    background: var(--lh-beyaz);
    border: 0;
    border-radius: 50px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--lh-lacivert);
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.lh-balon:hover { transform: scale(1.07); }

.lh-balon.on {
    background: var(--lh-kirmizi);
    color: #fff;
    box-shadow: 0 5px 14px rgba(255, 52, 79, 0.45);
    transform: scale(1.1);
}

.lh-balon:focus-visible {
    outline: 2px solid var(--lh-lacivert);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------
   Ust kontroller
   --------------------------------------------------------------- */
.lh-geri {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 46px;
    padding: 0 20px 0 16px;
    border: 0;
    border-radius: 50px;
    background: var(--lh-beyaz);
    color: var(--lh-lacivert);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.lh-geri:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.lh-geri:focus-visible {
    outline: 2px solid var(--lh-kirmizi);
    outline-offset: 3px;
}

.lh-geri svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--lh-kirmizi);
}

.lh-alan {
    position: absolute;
    top: 20px;
    left: 50%;
    z-index: 2;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 420px);
    padding: 9px 18px;
    border-radius: 50px;
    background: var(--lh-beyaz);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    font-size: 13px;
    color: var(--lh-soluk);
    white-space: nowrap;
    overflow: hidden;
}

.lh-alan[hidden] { display: none; }

.lh-alan strong { color: var(--lh-lacivert); font-weight: 800; }

.lh-alan-yuk {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--lh-kirmizi);
    font-weight: 600;
}

.lh-alan-yuk[hidden] { display: none; }

.lh-alan-yuk::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 52, 79, 0.25);
    border-top-color: var(--lh-kirmizi);
    animation: lh-don 0.7s linear infinite;
}

@keyframes lh-don {
    to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------
   Alt tepsi
   --------------------------------------------------------------- */
.lh-tepsi {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    height: 336px;
    padding: 8px 40px 18px;
    background: var(--lh-beyaz);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.18);
    transition: height 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.lh-tepsi[data-acik="1"] { height: calc(100% - 92px); }

.lh-tepsi-tut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 4px 0 8px;
    border: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

.lh-tepsi-cizgi {
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: #dfe3e7;
    transition: background-color 0.2s ease, width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.lh-tepsi-tut:hover .lh-tepsi-cizgi { width: 56px; background: #c9d0d6; }

.lh-tepsi-metin {
    font-size: 12px;
    font-weight: 600;
    color: var(--lh-kirmizi);
}

.lh-tepsi-bas {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-bottom: 12px;
}

.lh-tepsi-bas h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--lh-lacivert);
    line-height: 1.3;
}

.lh-tepsi-bas p {
    margin: 0;
    font-size: 13px;
    color: var(--lh-soluk);
}

.lh-tepsi-bas strong { color: var(--lh-lacivert); }

/* Kapali: tek sira yatay serit. Acik: izgara. */
.lh-tepsi-ic {
    position: relative;
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    /* Secili kartin 2.5px halkasi ve uzerine gelince 2px yukselmesi icin
       pay: kaydirma kabi tasani kirptigi icin cerceve kenarlarda kesiliyordu.
       Negatif kenar boslugu hizayi korur. */
    padding: 7px 7px 10px;
    margin: -7px -7px -2px;
    scrollbar-width: none;
    overscroll-behavior: contain;
    transition: opacity 0.2s ease;
}

.lh-tepsi-ic::-webkit-scrollbar { display: none; }

.lh-tepsi-ic.is-yukleniyor { opacity: 0.55; }

.lh-tepsi[data-acik="1"] .lh-tepsi-ic {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    /* max-content: kartlar overflow:hidden oldugu icin 'auto' satirlar
       kabin yuksekligine sigdirilmak uzere eziliyor, fiyat satiri
       kirpiliyordu. Satir her zaman kartin tam boyu kadar. */
    grid-auto-rows: max-content;
    align-content: start;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

.lh-bos {
    align-self: center;
    margin: 0 auto;
    padding: 0 16px;
    font-size: 14px;
    color: var(--lh-soluk);
    text-align: center;
}

/* ---------------------------------------------------------------
   Kart — liste kartiyla ayni bilgi, ayni baglanti
   --------------------------------------------------------------- */
.lh-kart {
    position: relative;
    flex: 0 0 236px;
    /* Seritte kart kendi boyunda kalir; tepsiye gerilip ici bosalmaz */
    align-self: flex-start;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    background: var(--lh-beyaz);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.lh-kart:hover {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.13);
    transform: translateY(-2px);
}

.lh-kart.on {
    box-shadow: 0 0 0 2.5px var(--lh-kirmizi), 0 10px 26px rgba(255, 52, 79, 0.18);
}

.lh-kart:focus-visible {
    outline: 2.5px solid var(--lh-lacivert);
    outline-offset: 2px;
}

.lh-kart-img {
    position: relative;
    display: block;
    height: 124px;
    background: #eceff1;
    overflow: hidden;
}

.lh-tepsi[data-acik="1"] .lh-kart-img { height: 156px; }

.lh-kart-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.lh-kart:hover .lh-kart-img img { transform: scale(1.04); }

.lh-kart-tip {
    position: absolute;
    top: 10px;
    left: 10px;
    max-width: calc(100% - 80px);
    overflow: hidden;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--lh-beyaz);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--lh-lacivert);
}

.lh-kart-puan {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
    font-size: 11px;
    font-weight: 700;
    color: var(--lh-lacivert);
}

.lh-kart-puan i { color: var(--lh-altin); font-size: 10px; }

.lh-kart-govde {
    display: block;
    padding: 10px 12px 12px;
}

.lh-kart-ad {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--lh-lacivert);
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.lh-kart-konum {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    font-size: 11.5px;
    color: var(--lh-soluk);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lh-kart-fiyat {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 5px;
    margin-top: 7px;
    font-size: 15px;
    font-weight: 800;
    color: var(--lh-lacivert);
}

.lh-kart-fiyat i {
    font-style: normal;
    font-size: 10.5px;
    font-weight: 400;
    color: var(--lh-silik);
}

/* Hafta sonu fiyati (TzFiyat) kendi sinifini getiriyor; kartta tek satir */
.lh-kart-fiyat .kart-hafta-sonu {
    flex-basis: 100%;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--lh-silik);
}

/* ---------------------------------------------------------------
   Dar ekran
   --------------------------------------------------------------- */
@media (max-width: 900px) {
    .lh-geri {
        top: calc(12px + env(safe-area-inset-top, 0px));
        left: 12px;
        height: 42px;
        padding: 0 16px 0 13px;
        font-size: 13.5px;
    }

    /* Hap ortada geri dugmesiyle cakisiyor; altina iner */
    .lh-alan {
        top: calc(64px + env(safe-area-inset-top, 0px));
        max-width: calc(100% - 24px);
        padding: 7px 14px;
        font-size: 12px;
    }

    .lh-tepsi {
        /* Kart (gorsel 110 + govde ~97) + tutamak + baslik tam sigsin */
        height: 322px;
        padding: 6px 16px calc(14px + env(safe-area-inset-bottom, 0px));
        border-radius: 20px 20px 0 0;
    }

    .lh-tepsi[data-acik="1"] { height: calc(100% - 64px); }

    .lh-tepsi-bas h2 { font-size: 15.5px; }

    .lh-tepsi-ic { gap: 12px; }

    .lh-kart { flex-basis: 206px; }

    .lh-kart-img { height: 110px; }

    .lh-tepsi[data-acik="1"] .lh-tepsi-ic {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .lh-tepsi[data-acik="1"] .lh-kart-img { height: 120px; }
}

@media (prefers-reduced-motion: reduce) {
    .lh-harita:not([data-hazir])::before,
    .lh-alan-yuk::before { animation: none; }

    .lh-tepsi,
    .lh-kart,
    .lh-kart-img img,
    .lh-balon,
    .lh-geri { transition: none; }
}
