/* ================================================================
   mobile.css  —  Sadece mobil görünüm (≤ 991.98px)
   Masaüstü tasarımına DOKUNMAZ.
   ================================================================ */

/* --- View Transitions (MPA, Chrome 126+) --------------------- */
@view-transition {
    navigation: auto;
}

/* ================================================================
   1.  Footer & Masaüstü Navbar — Mobilde Gizle
   ================================================================ */
@media (max-width: 991.98px) {

    :root {
        --kw-mobile-bg: #f5f6f8;
        --kw-mobile-surface: rgba(255, 255, 255, 0.96);
        --kw-mobile-border: rgba(15, 23, 42, 0.08);
        --kw-mobile-text: #0f172a;
        --kw-mobile-muted: #64748b;
        --kw-mobile-accent: var(--kw-red, #B40101);
        --kw-mobile-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    }

    header > nav.navbar {
        display: none !important;
    }

    .kw-footer {
        height: calc(56px + env(safe-area-inset-bottom));
        min-height: 0;
        overflow: hidden;
        border: none !important;
        background: transparent !important;
    }

    .kw-footer > * {
        display: none !important;
    }

    /* Bottom nav için alan — footer spacer karşılar */
    body {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        background: linear-gradient(180deg, #fbfbfc 0%, var(--kw-mobile-bg) 100%);
    }
}

/* ================================================================
   2.  Mobil Header
   ================================================================ */
.kw-mobile-header {
    display: none;
}

@media (max-width: 991.98px) {

    .kw-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--kw-mobile-border);
        position: sticky;
        top: 0;
        z-index: 1020;
        box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
        min-height: 64px;
    }

    .kw-mh-left {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex: 1;
    }

    .kw-mh-avatar {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.85);
        background: linear-gradient(135deg, color-mix(in srgb, var(--kw-mobile-accent) 14%, white), var(--kw-mobile-accent));
        color: #fff;
        font-weight: 600;
        font-size: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        object-fit: cover;
        box-shadow: 0 8px 18px rgba(180, 1, 1, 0.18);
    }

    .kw-mh-name {
        font-size: 14px;
        font-weight: 600;
        color: var(--kw-mobile-text);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kw-mh-user-meta {
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }

    .kw-mh-user-label {
        font-size: 11px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--kw-mobile-muted);
        font-weight: 700;
    }

    .kw-mh-right {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .kw-mh-logo {
        height: 30px;
        width: auto;
    }

    .kw-mh-logo-link {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: inherit;
    }

    .kw-mh-brand-text {
        font-size: 16px;
        font-weight: 700;
        color: var(--kw-mobile-text);
        letter-spacing: -0.01em;
    }

    .kw-mh-user-btn {
        display: flex;
        align-items: center;
        gap: 10px;
        background: rgba(255, 255, 255, 0.82);
        border: 1px solid var(--kw-mobile-border);
        border-radius: 999px;
        padding: 6px 6px 6px 12px;
        cursor: pointer;
        max-width: min(56vw, 240px);
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    }

    .kw-mh-user-btn::after {
        display: none;
    }
}

/* ================================================================
   3.  Mobil Card Grid  (header menu öğeleri)
   ================================================================ */
.kw-mobile-cards {
    display: none;
}

@media (max-width: 991.98px) {

    .kw-mobile-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 18px 16px 28px;
    }

    .kw-mobile-card {
        --card-color: var(--kw-red, #B40101);
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        min-height: 132px;
        padding: 18px 16px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, color-mix(in srgb, var(--card-color) 3%, white) 100%);
        border-radius: 20px;
        border: 1px solid color-mix(in srgb, var(--card-color) 14%, var(--kw-mobile-border));
        text-decoration: none;
        color: var(--kw-mobile-text);
        font-size: 14px;
        font-weight: 600;
        text-align: left;
        box-shadow: var(--kw-mobile-shadow);
        opacity: 0;
        animation: kw-card-in .35s ease forwards;
        transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    }

    .kw-mobile-card:hover,
    .kw-mobile-card:active {
        transform: translateY(-2px);
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
        color: var(--kw-mobile-text);
        text-decoration: none;
    }

    .kw-mobile-card-icon {
        width: 50px;
        height: 50px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        background: color-mix(in srgb, var(--card-color) 10%, white);
        color: var(--card-color);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card-color) 16%, transparent);
    }

    .kw-mobile-card i {
        font-size: 24px;
        color: inherit;
        line-height: 1;
    }

    .kw-mobile-card-title {
        display: block;
        line-height: 1.4;
        letter-spacing: -0.01em;
    }

    /* Stagger delays */
    .kw-mobile-card:nth-child(1)  { animation-delay: .04s; }
    .kw-mobile-card:nth-child(2)  { animation-delay: .09s; }
    .kw-mobile-card:nth-child(3)  { animation-delay: .14s; }
    .kw-mobile-card:nth-child(4)  { animation-delay: .19s; }
    .kw-mobile-card:nth-child(5)  { animation-delay: .24s; }
    .kw-mobile-card:nth-child(6)  { animation-delay: .29s; }
    .kw-mobile-card:nth-child(7)  { animation-delay: .34s; }
    .kw-mobile-card:nth-child(8)  { animation-delay: .39s; }
    .kw-mobile-card:nth-child(9)  { animation-delay: .44s; }
    .kw-mobile-card:nth-child(10) { animation-delay: .49s; }
    .kw-mobile-card:nth-child(11) { animation-delay: .54s; }
    .kw-mobile-card:nth-child(12) { animation-delay: .59s; }
    .kw-mobile-card:nth-child(13) { animation-delay: .64s; }
    .kw-mobile-card:nth-child(14) { animation-delay: .69s; }
    .kw-mobile-card:nth-child(15) { animation-delay: .74s; }
    .kw-mobile-card:nth-child(16) { animation-delay: .79s; }

}

@keyframes kw-card-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ================================================================
   4.  Sticky Bottom Navigation Bar
   ================================================================ */
.kw-bottom-nav {
    display: none;
}

@media (max-width: 991.98px) {

    .kw-bottom-nav {
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1040;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(16px);
        border-top: 1px solid var(--kw-mobile-border);
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    }

    .kw-bn-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        text-decoration: none;
        color: #7b8798;
        font-size: 10px;
        font-weight: 600;
        padding: 6px 4px;
        min-height: 58px;
        transition: color .15s ease, transform .15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .kw-bn-icon-wrap {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        transition: background-color .15s ease, color .15s ease;
    }

    .kw-bn-item i {
        font-size: 17px;
        transition: color .15s ease, transform .15s ease;
    }

    .kw-bn-item.active {
        color: var(--kw-mobile-accent);
    }

    .kw-bn-item.active i {
        color: var(--kw-mobile-accent);
    }

    .kw-bn-item.active .kw-bn-icon-wrap {
        background: color-mix(in srgb, var(--kw-mobile-accent) 12%, white);
    }

    /* FAB  —  Ana Sayfa (orta, yukarı çıkmış) */
    .kw-bn-fab {
        margin-top: -20px;
        position: relative;
    }

    .kw-bn-fab-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(180deg, #ca1111 0%, var(--kw-mobile-accent) 100%);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 4px solid rgba(255, 255, 255, 0.92);
        box-shadow: 0 14px 28px rgba(180, 1, 1, 0.24);
        transition: box-shadow .15s ease, transform .15s ease;
    }

    .kw-bn-fab-btn i {
        font-size: 20px;
        color: #fff !important;
        transform: none !important;
    }

    .kw-bn-fab.active .kw-bn-fab-btn {
        box-shadow: 0 16px 30px rgba(180, 1, 1, 0.3);
    }

    .kw-bn-fab .kw-bn-label {
        font-size: 10px;
        color: var(--kw-mobile-accent);
        font-weight: 600;
    }

    .kw-bn-item:active .kw-bn-fab-btn {
        transform: scale(.93);
    }

    .kw-bn-label {
        line-height: 1;
    }
}

/* ================================================================
   5.  View Transitions — Sayfa geçiş animasyonları
   ================================================================ */
@media (max-width: 991.98px) {

    ::view-transition-old(root) {
        animation: kw-vt-out .18s ease forwards;
    }

    ::view-transition-new(root) {
        animation: kw-vt-in .22s ease forwards;
    }
}

@keyframes kw-vt-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-5px); }
}

@keyframes kw-vt-in {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   6.  Hero bölümü ve FAQ — Mobilde Gizle (kart grid alır)
   ================================================================ */
@media (max-width: 991.98px) {

    .kw-mobile-hide,
    .manage-sidebar-nav {
        display: none !important;
    }

    /* Auth: kartlar görünür, hero gizli */
    body.is-auth .hero-wrap {
        display: none !important;
    }

    /* Guest: hero görünür, kart grid gizli */
    body.is-guest .kw-mobile-cards {
        display: none !important;
    }

    /* Background: site.css'in mobil override'ını geri al */
    body.home-bg::before {
        background: rgba(248, 250, 252, .9) !important;
    }


    /* Ana içerik container'ına mobilde padding azalt */
    .container > main {
        padding-left: 0;
        padding-right: 0;
    }

    .hero-wrap {
        padding: 20px 16px 12px;
    }

    .hero-wrap > .row {
        --bs-gutter-x: 0;
    }

    .kw-home-hero-copy {
        padding: 22px 20px;
        border-radius: 28px;
        border: 1px solid var(--kw-mobile-border);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.94) 100%);
        box-shadow: var(--kw-mobile-shadow);
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 2.7rem);
        line-height: 1.05;
        margin-bottom: 14px !important;
        background: none;
        color: var(--kw-mobile-text);
    }

    .hero-sub {
        font-size: 0.98rem;
        line-height: 1.65;
        color: var(--kw-mobile-muted);
    }

    .badge-soft {
        padding: 0.5rem 0.8rem;
        background: rgba(255, 255, 255, 0.78);
        border-color: var(--kw-mobile-border);
        color: var(--kw-mobile-text);
    }

    .hero-cta {
        gap: 10px !important;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
        border-radius: 16px;
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        box-shadow: none;
    }

    .kw-home-feature-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .kw-home-feature-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid var(--kw-mobile-border);
        color: var(--kw-mobile-text);
        font-size: 0.93rem;
    }

    .kw-home-feature-item i {
        width: 22px;
        text-align: center;
    }

    .hero-image-wrapper {
        margin-top: 2px;
    }

    .hero-image-frame {
        border-radius: 24px;
        border: 1px solid var(--kw-mobile-border);
        box-shadow: var(--kw-mobile-shadow);
    }

    .kw-home-section-head {
        margin-bottom: 18px;
        padding: 0 2px;
    }

    .kw-home-section-head h4 {
        font-size: 1.15rem;
        letter-spacing: -0.01em;
    }

    .kw-home-section-head .lead {
        font-size: 0.9rem;
        color: var(--kw-mobile-muted);
    }
}
