/* ============================================================
   HEADER
   ============================================================ */
.header-wrapper {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.flex-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* ============================================================
   DESKTOP NAV
   ============================================================ */
.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links > li > a,
.nav-links > li > form > a {
    text-decoration: none;
    color: #444;
    font-weight: 600;
    white-space: nowrap;
    font-size: 14px;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.nav-links > li > a::after,
.nav-links > li > form > a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--brand, #245e83);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links > li > a:hover,
.nav-links > li > form > a:hover {
    color: var(--brand, #245e83);
}

.nav-links > li > a:hover::after,
.nav-links > li > form > a:hover::after {
    width: 100%;
}

.nav-links > li > a svg {
    transition: transform 0.3s ease;
}

.nav-links > li.has-child:hover > a svg {
    transform: rotate(180deg);
}

/* ============================================================
   DROPDOWN (CHILD MENU)
   ============================================================ */
.child-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 10px;
    border-radius: 8px;
    min-width: 220px;
    border: 1px solid #f5f5f5;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;

    visibility: hidden;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1001;
}

.has-child:hover .child-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.child-menu a {
    display: block;
    padding: 8px 15px;
    color: #555 !important;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.child-menu a::after {
    display: none !important;
}

.child-menu a:hover {
    background-color: #f8f9fa;
    color: var(--brand, #245e83) !important;
    padding-left: 22px;
}

.child-menu::-webkit-scrollbar {
    width: 6px;
}

.child-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.child-menu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.child-menu::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-container {
    position: relative;
    flex-grow: 1;
    max-width: 300px;
    min-width: 120px;
}

.modern-search {
    position: relative;
}

.modern-search input {
    width: 220px;
    padding: 10px 40px 10px 15px;
    border-radius: 25px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    transition: all 0.25s ease;
    font-size: 14px;
    outline: none;
}

.modern-search input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    width: 260px;
}

.modern-search .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

/* ============================================================
   CART BUTTON
   ============================================================ */
.cart-btn {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    gap: 5px;
}

.modern-cart {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--brand, #245e83);
    color: #fff;
    transition: all 0.25s ease;
    text-decoration: none;
}

.modern-cart:hover {
    background: #1d4f6b;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    color: #fff;
}

.modern-cart svg {
    transition: transform 0.2s ease;
}

.modern-cart:hover svg {
    transform: scale(1.1);
}

/* ============================================================
   MOBİL SIDEBAR
   ============================================================ */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 86vw;
    height: 100%;
    background: #fff;
    z-index: 2000;
    /* left yerine transform: GPU ile akıcı, reflow yok */
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 0 40px rgba(15, 23, 42, .22);
    border-radius: 0 18px 18px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-sidebar.active {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 16px 18px;
    border-bottom: 1px solid #eef2f7;
    background: #f9fbfd;
    flex-shrink: 0;
}

.sidebar-header img {
    max-height: 44px !important;
    width: auto;
    object-fit: contain;
}

.close-sidebar {
    cursor: pointer;
    color: #64748b;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    transition: all .15s;
}

.close-sidebar:hover {
    background: var(--brand, #245e83);
    border-color: var(--brand, #245e83);
    color: #fff;
}

.close-sidebar svg { width: 18px; height: 18px; }

.sidebar-menu {
    list-style: none;
    padding: 10px 12px calc(24px + env(safe-area-inset-bottom));
    margin: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-menu li {
    margin-bottom: 2px;
    list-style: none;
}

.sidebar-menu a {
    text-decoration: none;
    color: #334155;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 11px;
    transition: background .15s, color .15s;
}

.sidebar-menu a:hover,
.sidebar-menu a:active {
    background: #f1f6fa;
    color: var(--brand, #245e83);
}

.sidebar-menu a svg { flex-shrink: 0; opacity: .55; }

/* Alt menüler: masaüstünde absolute + hover ile açılan dropdown'lar mobilde
   hover olmadığı için hiç görünmüyordu. Sidebar içinde akışa alınıp
   sola çizgiyle bağlı girintili bir grup olarak gösterilir. */
.mobile-sidebar .child-menu {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    background: transparent;
    min-width: 0;
    border-radius: 0;
    margin: 2px 0 6px 14px;
    padding: 0 0 0 12px;
    border-left: 2px solid #eef2f7;
}

.mobile-sidebar .child-menu a {
    display: flex;
    font-size: 14px;
    font-weight: 500;
    color: #64748b !important;
    padding: 8px 12px;
    border-radius: 9px;
}

.mobile-sidebar .child-menu a:hover {
    background: #f1f6fa;
    color: var(--brand, #245e83) !important;
}

.sidebar-menu hr {
    margin: 6px 12px;
    border: 0;
    border-top: 1px solid #eef2f7;
    opacity: 1;
}

/* Çıkış gibi form içinde gelen butonlar da menü satırı gibi görünsün */
.sidebar-menu form button {
    width: 100%;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    padding: 11px 14px;
    border-radius: 11px;
    background: none;
    border: none;
    color: #b91c1c;
    cursor: pointer;
    transition: background .15s;
}

.sidebar-menu form button:hover { background: #fdeaea; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    .nav-links {
        display: none;
    }

    .search-container {
        max-width: none;
    }

    .logo-desktop {
        display: none;
    }
}
