/* ============================================================================
   BAYİ ECZANELER — harita + filtre + kart ızgarası
   guclukal.com · Carmed İlaç
   ----------------------------------------------------------------------------
   Kaynak     : Güçlü Kal Kurumsal Kimlik Kılavuzu v1.0
   Bağımlılık : guclukal-components.css (→ tokens) + leaflet + markercluster
   Kapsam     : [impula_eczacilar] kısa kodu (.ecz-harita)
   ----------------------------------------------------------------------------
   Kanal dili: sayfa `.gk-b2b` kapsamındadır — eylem rengi petrol. Eczane
   tabelası ise petrol kapsamında bile KIRMIZI kalır; sektörü o söyler.
   ============================================================================ */

/* Panelin iç boşluğu.
   `.gk-scope` yalnızca token/tipografi kapsamı DEĞİL — `guclukal-tokens.css`
   ona `background-color: var(--gk-color-canvas)` (#F9F7F5) de basıyor, yani bu
   sarmalayıcı ekranda GÖRÜNÜR bir panel. Burada uzun süre sadece `padding-block`
   vardı; filtre çubuğu, harita ve kart ızgarası panelin sol/sağ kenarına yapışık
   duruyordu (ölçüldü: iki yanda da 0px). Yatay dolgu dikeyle simetrik verilir —
   `.ecz-app` / `.imp-app` ile aynı düzeltme. */
.ecz-harita {
    display: grid;
    gap: var(--gk-space-5);
    padding-block: var(--gk-space-6);
    padding-inline: var(--gk-space-6);
}

/* --- Filtre çubuğu ----------------------------------------------------- */
.ecz-harita__filtre {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--gk-space-4);
    padding: var(--gk-space-5);
    background: var(--gk-color-surface-sunken);
    border-radius: var(--gk-radius-md);
}
.ecz-harita__alan { flex: 1 1 220px; }
.ecz-harita__filtre .gk-btn { flex: none; }

/* Soft-corner identity (kit v1.1): dropdowns and buttons are pills.
   registration-form.css zeroes both with !important
   (`.gk-scope .gk-btn`, `.gk-scope.impula-eczacilar-wrapper select`) and
   guclukal-components.css does so for `:focus-visible`; these selectors are
   more specific than all of them, so the focus ring follows the pill too. */
.ecz-harita.gk-scope .gk-fld select,
.ecz-harita.gk-scope .gk-fld select:focus-visible,
.ecz-harita.gk-scope .gk-btn,
.ecz-harita.gk-scope .gk-btn:focus-visible { border-radius: var(--gk-radius-pill) !important; }

/* --- Harita ------------------------------------------------------------ */
.ecz-harita__map {
    height: 460px;
    border: var(--gk-border-hairline) solid var(--gk-color-border);
    border-radius: var(--gk-radius-md);
    overflow: hidden;
    background: var(--gk-color-surface-sunken);
    position: relative;
    z-index: 0;
}

/* Leaflet corners follow the identity scale: map frame = card radius,
   controls and popup = small radius, clusters = circles. */
.ecz-harita .leaflet-container { border-radius: var(--gk-radius-md); font-family: var(--gk-font-sans); }
.ecz-harita .leaflet-popup-content-wrapper,
.ecz-harita .leaflet-bar { border-radius: var(--gk-radius-sm) !important; }
.ecz-harita .leaflet-bar { overflow: hidden; }
.ecz-harita .leaflet-bar a,
.ecz-harita .leaflet-popup-tip { border-radius: 0 !important; }
.ecz-harita .leaflet-control-attribution { border-radius: var(--gk-radius-xs) 0 0 0 !important; }
.ecz-harita .marker-cluster,
.ecz-harita .marker-cluster div { border-radius: var(--gk-radius-full) !important; }

.ecz-harita .leaflet-bar { border: var(--gk-border-hairline) solid var(--gk-color-border); box-shadow: var(--gk-shadow-1); }
.ecz-harita .leaflet-bar a { color: var(--gk-color-text-strong); }
.ecz-harita .leaflet-bar a:hover { background: var(--gk-color-action); color: var(--gk-color-action-text); }
.ecz-harita .leaflet-popup-content-wrapper {
    border: var(--gk-border-hairline) solid var(--gk-color-border);
    box-shadow: var(--gk-shadow-2);
    font-size: var(--gk-fs-sm);
}
.ecz-harita .leaflet-popup-content { margin: var(--gk-space-3) var(--gk-space-4); line-height: var(--gk-lh-normal); }
.ecz-harita .leaflet-popup-content strong { color: var(--gk-color-text-strong); font-weight: var(--gk-fw-semibold); }
.ecz-harita .leaflet-popup-content em { color: var(--gk-color-text-muted); font-size: var(--gk-fs-2xs); font-style: normal; }
.ecz-harita .leaflet-control-attribution {
    background: rgba(255, 255, 255, .86);
    font-size: var(--gk-fs-3xs);
    color: var(--gk-color-text-muted);
}

/* Cluster badges — colour and size step up with density (pharmacy-map.js
   Harita.CLUSTER_LEVELS: 2–9 · 10–29 · 30+). Identity palette; white count
   on every level passes AA (9.6:1 · 12:1 · 5.1:1). The ring is the halo
   (outer box), the badge the inner div, centred with a 4–6px inset. */
.ecz-harita .marker-cluster div {
    display: grid;
    place-items: center;
    color: var(--gk-white);
    font-family: var(--gk-font-sans);
    font-weight: var(--gk-fw-bold);
    letter-spacing: .02em;
}
.ecz-harita .marker-cluster span { line-height: 1; }

.ecz-harita .ecz-cluster--sm { background: rgba(15, 76, 92, .18); }
.ecz-harita .ecz-cluster--sm div {
    width: 28px; height: 28px; margin: 4px 0 0 4px;
    background: var(--gk-petrol-500);
    font-size: 12px;
}

.ecz-harita .ecz-cluster--md { background: rgba(0, 52, 65, .26); }
.ecz-harita .ecz-cluster--md div {
    width: 36px; height: 36px; margin: 5px 0 0 5px;
    background: var(--gk-petrol-700);
    font-size: 13px;
}

/* Densest areas in the brand red — the pharmacy-sign colour, kept red even
   inside the petrol .gk-b2b scope (guide §11). */
.ecz-harita .ecz-cluster--lg { background: rgba(237, 50, 62, .24); }
.ecz-harita .ecz-cluster--lg div {
    width: 46px; height: 46px; margin: 6px 0 0 6px;
    background: var(--gk-red-600);
    font-size: 15px;
}

/* --- Durum satırı ------------------------------------------------------ */
.ecz-harita__durum { margin: 0; min-height: 1.2em; }
.ecz-harita__durum--stop { color: var(--gk-color-danger-text); }

/* --- Sonuç ızgarası ----------------------------------------------------
   Soft-cornered cards separated by a gap (kit v1.1 replaced the hairline grid).
   ------------------------------------------------------------------------ */
.ecz-harita__izgara {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--gk-products-gap);
}

/* Map selection (clicked pin/cluster): clear button above, "Show more" below */
.ecz-harita__selection {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--gk-space-4);
}
.ecz-harita__more-wrap {
    display: flex;
    justify-content: center;
    margin: var(--gk-space-5) 0 0;
}

.ecz-harita__sonuc[aria-busy="true"] { opacity: .55; transition: opacity var(--gk-dur-fast) var(--gk-ease-out); }

/* ============================================================================
   KART — görsel ÜSTTE, bilgi ALTTA
   ============================================================================ */
.ecz-kart {
    display: flex;
    flex-direction: column;
    overflow: hidden;   /* clips the image to the rounded corners */
    background: var(--gk-color-surface);
    border: var(--gk-border-hairline) solid var(--gk-color-border);
    border-radius: var(--gk-radius-md);
    box-shadow: var(--gk-shadow-1);
    transition: var(--gk-transition);
}
/* Hover lifts the card with a deeper shadow; no scaling. */
.ecz-kart:hover {
    box-shadow: var(--gk-shadow-lift);
    transform: translateY(-2px);
    position: relative;
    z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
    .ecz-kart:hover { transform: none; }
}

.ecz-kart__gorsel {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--gk-gray-200);
    border-bottom: var(--gk-border-hairline) solid var(--gk-color-border);
    /* Tabela metni kart genişliğine göre ölçeklenir */
    container-type: inline-size;
}
.ecz-kart__gorsel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.ecz-kart__govde {
    display: grid;
    gap: var(--gk-space-2);
    align-content: start;
    padding: var(--gk-space-4);
    flex: 1;
}

.ecz-kart__ad {
    margin: 0;
    font-size: var(--gk-fs-lg);
    font-weight: var(--gk-fw-semibold);
    line-height: var(--gk-lh-snug);
    letter-spacing: var(--gk-ls-tight);
    color: var(--gk-color-text-strong);
}

.ecz-kart__yer {
    margin: 0;
    font-family: var(--gk-font-mono);
    font-size: var(--gk-fs-3xs);
    font-weight: var(--gk-fw-medium);
    letter-spacing: var(--gk-ls-wider);
    text-transform: uppercase;
    color: var(--gk-color-text-subtle);
}

.ecz-kart__adres {
    margin: 0;
    font-size: var(--gk-fs-sm);
    line-height: var(--gk-lh-normal);
    color: var(--gk-color-text-muted);
    max-width: none;
}

.ecz-kart__tel { display: flex; flex-wrap: wrap; gap: var(--gk-space-2); }
.ecz-kart__telefon {
    display: inline-flex;
    align-items: center;
    padding: 4px var(--gk-space-3);
    border: var(--gk-border-hairline) solid var(--gk-color-border);
    border-radius: var(--gk-radius-pill);
    color: var(--gk-color-text-strong);
    font-size: var(--gk-fs-sm);
    font-variant-numeric: tabular-nums lining-nums;
    text-decoration: none;
    transition: var(--gk-transition);
}
.ecz-kart__telefon:hover {
    border-color: var(--gk-color-action);
    color: var(--gk-color-action);
    text-decoration: none;
}

.ecz-kart__goster { margin-top: var(--gk-space-2); justify-self: start; }
.ecz-kart__yaklasik { font-style: normal; }

/* ============================================================================
   ECZANE TABELASI — fotoğrafı olmayan kartın görseli, saf CSS
   ----------------------------------------------------------------------------
   Türkiye'deki eczane levhası konvansiyonu: gri zemin, arkada tam genişlikte
   kırmızı yatay bant, üzerinde beyaz plaka; plakada kırmızı "ECZANE" ve altında
   eczanenin adı. Oranlar referans levha görselinden alındı.

   Kırmızı, kimliğin marka kırmızısıdır (--gk-red-500) — kılavuz bölüm 11
   gereği levha `.gk-b2b` petrol kapsamında bile kırmızı kalır.
   ============================================================================ */
.ecz-tabela {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--gk-gray-200);
    overflow: hidden;
}

/* Arkadaki kırmızı bant — plakanın altından iki yana taşar */
.ecz-tabela__bant {
    position: absolute;
    left: 0;
    right: 0;
    top: 26%;
    bottom: 27%;
    background: var(--gk-red-500);
}

/* Beyaz plaka — "E" mark on the left, pharmacy name on the right */
.ecz-tabela__plaka {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 84%;
    height: 60%;
    padding: 0 18px;
    background: var(--gk-white);
    /* Soft plate corners; the "E" mark itself stays square (kit, regulation). */
    border-radius: var(--gk-radius-sm);
}

/* Sized from the plate height so a custom card height (Elementor) never
   lets the mark overflow the plate. */
.ecz-tabela__mark {
    flex: none;
    display: block;
    height: 40%;
    width: auto;
    aspect-ratio: 1;
}
.ecz-tabela__mark-bg     { fill: var(--gk-red-500); }
.ecz-tabela__mark-letter { fill: var(--gk-white); }

.ecz-tabela__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-transform: uppercase;
}

/* Eczane adı — grafit, versal; long names wrap to two lines, then clip */
.ecz-tabela__ad {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--gk-gray-900);
    font-weight: var(--gk-fw-bold);
    font-size: 16px;
    line-height: 1.1;
    letter-spacing: .005em;
    overflow-wrap: anywhere;
}

/* "ECZANESİ" — smaller, red, tracked out */
.ecz-tabela__suffix {
    color: var(--gk-red-500);
    font-weight: var(--gk-fw-semibold);
    font-size: 10px;
    line-height: 1;
    letter-spacing: .14em;
    white-space: nowrap;
}

/* Kart genişliğine göre ölçekleme. Kap birimi desteklenmiyorsa yukarıdaki
   sabit değerler geçerli kalır. */
@supports (font-size: 1cqw) {
    .ecz-tabela__plaka  { gap: 4cqw; padding: 0 5cqw; }
    .ecz-tabela__text   { gap: 1.4cqw; }
    .ecz-tabela__ad     { font-size: 6.2cqw; }
    .ecz-tabela__suffix { font-size: 3.6cqw; }
}

/* --- Mobil ------------------------------------------------------------- */
@media (max-width: 768px) {
    .ecz-harita__map { height: 340px; }
    .ecz-harita__alan { flex-basis: 100%; }
    .ecz-harita__filtre .gk-btn { width: 100%; }
    .ecz-harita__izgara { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 420px) {
    .ecz-harita__izgara { grid-template-columns: minmax(0, 1fr); }
}
