/* ======================================================================
   YZ DEFAULT — HEADER SECTION
   Tüm stiller .h- prefix'li → global çakışma yok.
   ====================================================================== */

.h-bar {
    position: sticky;
    top: 0;
    z-index: var(--z-overlay);  /* 300 — header dropdown'ları m-dm/m-search-trigger (sticky=200) üstünde, modal (400) altında kalsın */
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.h-inner {
    max-width: var(--container);
    margin-inline: auto;
    padding: 0 var(--sp-4);
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

@media (min-width: 768px) {
    .h-inner { padding: 0 var(--sp-6); gap: var(--sp-6); }
}

/* ─────────── Logo bölümü ─────────── */

.h-logo-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    color: var(--text);
    transition: opacity var(--t-fast);
    flex-shrink: 0;
}
.h-logo-link:hover { opacity: 0.85; color: var(--text); }

.h-logo-img {
    height: 36px;
    width: auto;
    max-width: 140px;
	border-radius:8px;
    object-fit: contain;
}

.h-logo-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    font-size: var(--fs-lg);
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.h-brand-name {
    font-family: var(--font-display);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-base);
    color: var(--text);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* Mobilde brand name gizlenebilir (logo yeterli) */
@media (max-width: 480px) {
    .h-brand-name { display: none; }
}

/* ─────────── Desktop Nav ─────────── */

.h-nav {
    display: none;
    align-items: center;
    gap: var(--sp-1);
    margin-inline-start: var(--sp-4);
}

@media (min-width: 1024px) {
    .h-nav { display: inline-flex; }
}

.h-nav-item {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-muted);
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
}
.h-nav-item:hover {
    background: var(--bg-soft);
    color: var(--text);
}
.h-nav-item.is-active {
    color: var(--primary-dk);
    background: var(--primary-lt);
}

/* ─────────── Sağ blok (actions) ─────────── */

.h-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-inline-start: auto;
}

/* Genel pill — tüm yuvarlak buton/badge'ler */
.h-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--t-fast);
    white-space: nowrap;
    line-height: 1;
}
.h-pill:hover {
    background: var(--bg-soft);
    color: var(--text);
    border-color: var(--border-strong);
}

/* ─────────── Servis Durumu Pill ─────────── */

.h-status {
    gap: 8px;
}

.h-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-soft);
    flex-shrink: 0;
}
.h-status.is-open .h-status-dot {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
    animation: h-pulse 2s infinite;
}
.h-status.is-warning .h-status-dot { background: var(--warning); }
.h-status.is-closed .h-status-dot  { background: var(--danger); }

@keyframes h-pulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(0.7); opacity: 0.6; }
}

.h-status-text {
    font-variant-numeric: tabular-nums;
}

/* Mobilde sadece nokta — metin gizli */
@media (max-width: 640px) {
    .h-status .h-status-text { display: none; }
    .h-status { padding: 7px 10px; }
}

/* ─────────── Dil & Para Switcher ─────────── */

.h-switcher {
    position: relative;
}

.h-switcher-trigger {
    /* h-pill inherit */
}

.h-switcher-chevron {
    width: 10px;
    height: 10px;
    margin-inline-start: 2px;
    opacity: 0.6;
    transition: transform var(--t-fast);
}
.h-switcher.is-open .h-switcher-chevron {
    transform: rotate(180deg);
}

.h-switcher-flag, .h-switcher-symbol {
    font-size: var(--fs-base);
    line-height: 1;
}

/* Bayrak özel: Windows/eski browser'ların dil kodu göstermesin diye
   Twemoji Country Flags font'u öncelikli yüklenir. @font-face base.css'te. */
.h-switcher-flag {
    font-family: 'Twemoji Country Flags',
                 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji',
                 system-ui, -apple-system, sans-serif;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    /* Biraz daha büyük göster — bayrak detayları görünsün */
    font-size: 1.15em;
}

.h-switcher-menu {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: var(--z-dropdown);
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
}
.h-switcher.is-open .h-switcher-menu {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

.h-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: var(--text);
    font-size: var(--fs-sm);
    text-decoration: none;
    transition: background var(--t-fast);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: start;
}
.h-switcher-item:hover {
    background: var(--bg-soft);
    color: var(--text);
}
.h-switcher-item.is-active {
    background: var(--primary-lt);
    color: var(--primary-dk);
}

.h-switcher-check {
    margin-inline-start: auto;
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

/* ─────────── Sepet Pill ─────────── */

.h-cart {
    position: relative;
    padding: 7px 11px;
}

/* Class'sız SVG'ler için açık kural — base.css'in
   `svg { display: block; max-width: 100%; }` davranışı flex
   container'da SVG'yi sıkıştırabiliyor. Bu garantili boyut + renk. */
.h-cart > svg,
.h-auth-link > svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text, #111827);
}

.h-cart-badge {
    position: absolute;
    top: -4px;
    inset-inline-end: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary);
    color: var(--primary-on);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: var(--fw-bold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
    line-height: 1;
}
.h-cart-badge[hidden],
.h-cart-badge.is-empty {
    display: none !important;
}

/* Badge update animation — sepete eklenince kısa puls */
@keyframes cart-badge-pulse {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.32); }
    100% { transform: scale(1); }
}
.h-cart-badge.is-pulse {
    animation: cart-badge-pulse 0.42s ease-out;
}

/* ─────────── Mobile Burger ─────────── */

.h-burger {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 1024px) {
    .h-burger { display: none; }
}

.h-burger-bars { display: inline-block; }
.h-burger-x    { display: none; }
.h-burger[aria-expanded="true"] .h-burger-bars { display: none; }
.h-burger[aria-expanded="true"] .h-burger-x    { display: inline-block; }

/* ─────────── Mobile Menu (drawer) ─────────── */

.h-mobile {
    display: none;
    position: fixed;
    top: var(--header-h);
    inset-inline: 0;
    bottom: 0;
    background: var(--bg-page);
    z-index: var(--z-modal);     /* sticky header'dan yüksek olmalı */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--sp-4);
    /* Header'dan ayrı stacking context — clean */
    isolation: isolate;
}
.h-mobile.is-open { display: block; }

@media (min-width: 1024px) {
    .h-mobile { display: none !important; }
}

.h-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.h-mobile-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    color: var(--text);
    text-decoration: none;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    transition: background var(--t-fast);
}
.h-mobile-item:hover  { background: var(--bg-soft); color: var(--text); }
.h-mobile-item.is-active {
    background: var(--primary-lt);
    color: var(--primary-dk);
}
.h-mobile-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Body scroll lock — JS class'ı */
body.h-mobile-locked {
    overflow: hidden;
}

/* RTL desteği */
[dir="rtl"] .h-switcher-chevron {
    transform: scaleX(-1);
}
[dir="rtl"] .h-switcher.is-open .h-switcher-chevron {
    transform: scaleX(-1) rotate(180deg);
}

/* ============================================================
   HEADER — Auth Pill (Hesabım dropdown + Giriş linki)
============================================================ */
.h-auth-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    text-decoration: none;
}

.h-account {
    position: relative;
}

.h-account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    user-select: none;
}

.h-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary, #f97316);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.h-account-name {
    font-size: 13px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .h-account-name { display: none; }
}

.h-account-chevron {
    transition: transform 0.15s;
    flex-shrink: 0;
}

.h-account.is-open .h-account-chevron {
    transform: rotate(180deg);
}

.h-account-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px;
    z-index: 1100;  /* mobile drawer trigger ve sticky header'ın üstünde */
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}

.h-account-menu:not([hidden]) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.h-account-menu[hidden] {
    display: block; /* CSS animasyon için */
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    visibility: hidden;
}

.h-account-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--text, #111827);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.1s;
}

.h-account-item:hover {
    background: var(--bg-page, #f3f4f6);
}

.h-account-item svg {
    color: var(--muted, #6b7280);
    flex-shrink: 0;
}

.h-account-item-logout {
    color: #dc2626;
}

.h-account-item-logout svg {
    color: #dc2626;
}

.h-account-sep {
    height: 1px;
    background: var(--border, #e5e7eb);
    margin: 6px 4px;
}
