/* Shared layout rules previously duplicated inline in the main template. */
header > div > div > div.ml-auto > a,
header > nav > div > a {
    font-size: 15px;
    font-weight: 600;
}
/* =========================================================
   MOBİL DENEYİM İYİLEŞTİRMELERİ
   Yalnızca 767px ve altındaki ekranları etkiler.
   Masaüstü yerleşimi ve ölçüleri değiştirilmez.
   ========================================================= */
@media (max-width: 767px) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    img,
    svg,
    video,
    canvas {
        max-width: 100%;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }

    /* Mobil başlık: logo ve hesap/sepet üst sırada, arama alt sırada. */
    header > div:first-child > div.flex.min-h-20 {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px !important;
        padding-top: 8px;
        padding-bottom: 10px;
    }

    header > div:first-child > div.flex.min-h-20 > a:first-child img {
        height: 40px;
        width: auto;
    }

    header > div:first-child > div.flex.min-h-20 > div:nth-child(2) {
        display: block !important;
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    header > div:first-child > div.flex.min-h-20 > div:nth-child(2) form {
        width: 100%;
        max-width: none;
    }

    header > div:first-child > div.flex.min-h-20 > div:nth-child(2) input {
        min-height: 42px;
        padding: 10px 44px 10px 14px;
        font-size: 14px;
    }

    header > div:first-child > div.flex.min-h-20 > div.ml-auto {
        flex: 0 0 auto;
        gap: 2px;
        margin-left: auto;
    }

    /* İlk üç bağlantı alt navigasyonda zaten bulunduğundan üst sırayı sadeleştir. */
    header > div:first-child > div.flex.min-h-20 > div.ml-auto > a:nth-of-type(-n+3) {
        display: none !important;
    }

    header > div:first-child > div.flex.min-h-20 > div.ml-auto > a:nth-of-type(n+4) {
        min-height: 40px;
        gap: 4px;
        padding: 7px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    header > nav > div {
        gap: 20px !important;
        padding: 10px 16px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    header > nav > div::-webkit-scrollbar {
        display: none;
    }

    header > nav > div > a {
        display: inline-flex;
        align-items: center;
        min-height: 28px;
        flex: 0 0 auto;
        font-size: 13px !important;
    }

    /* Ana içeriklerde dikey boşlukları mobil ekranla dengeler. */
    main > section > div.mx-auto.max-w-7xl {
        padding-top: 24px !important;
        padding-bottom: 28px !important;
    }

    /* Footer bağlantıları daha rahat dokunulabilir ve daha az sıkışık olsun. */
    footer > div.mx-auto.max-w-7xl {
        padding: 30px 16px 18px !important;
    }

    footer > div.mx-auto.max-w-7xl > div:first-child {
        gap: 22px;
    }

    footer > div.mx-auto.max-w-7xl > div:last-child {
        gap: 12px;
        margin-top: 22px !important;
        padding-top: 16px !important;
    }

    footer a {
        min-height: 24px;
    }

    /* Hesap sayfası: masaüstü yan menüsü mobilde üstte, iki sütunlu kısa menü olur. */
    main > section.bg-zinc-50.py-8 > div[style*="max-width: 1232px"] {
        width: calc(100% - 32px) !important;
    }

    main > section.bg-zinc-50.py-8 > div[style*="max-width: 1232px"] > div.flex.items-start {
        flex-direction: column;
        gap: 16px;
    }

    main > section.bg-zinc-50.py-8 > div[style*="max-width: 1232px"] > div.flex.items-start > aside,
    main > section.bg-zinc-50.py-8 > div[style*="max-width: 1232px"] > div.flex.items-start > main {
        width: 100% !important;
        min-width: 0;
    }

    main > section.bg-zinc-50.py-8 > div[style*="max-width: 1232px"] aside nav.p-2 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
    }

    main > section.bg-zinc-50.py-8 > div[style*="max-width: 1232px"] aside nav.p-2 > a {
        min-height: 40px;
        margin-top: 0 !important;
        padding: 9px 10px;
        gap: 7px;
    }

    /* Sepet kartları ve checkout formları mobilde daha verimli alan kullanır. */
    main > section.bg-zinc-50 > div.mx-auto.max-w-7xl > div.grid.gap-8 > div.space-y-4 > div.rounded-2xl.border {
        padding: 12px !important;
    }

    main main > form > div.grid.gap-8 {
        gap: 20px;
    }

    main main section.rounded-2xl.border.p-6 {
        padding: 16px !important;
    }

    main main .sticky.top-6 {
        position: static !important;
        top: auto !important;
    }
}

@media (max-width: 380px) {
    header > div:first-child > div.flex.min-h-20 > div.ml-auto > a:nth-of-type(n+4) {
        padding-right: 5px;
        padding-left: 5px;
        font-size: 11px;
    }

    header > nav > div {
        gap: 16px !important;
    }
}


/* CLS: Mobil header satır ölçülerini font yüklemesinden bağımsız sabitle. */
@media (max-width: 767px) {
    header > div:first-child > div.flex.min-h-20 {
        box-sizing: border-box;
        height: 108px;
        min-height: 108px;
        align-content: space-between;
        row-gap: 8px !important;
    }

    header > nav > div {
        box-sizing: border-box;
        height: 48px;
        min-height: 48px;
    }
}
