/* =========================================================
   ALYA V4.14 — MOBİL MAĞAZA KARARLILIK + 2'Lİ ÇÖZÜM KARTLARI
   - Mağaza sayfasının sağa/sola kaçmasını engeller.
   - Mobil görünümü uygulama gibi sabit tutar.
   - Mağaza ve kurumsal ana sayfadaki çözüm kartlarını 2'li gösterir.
   - Demo ve iletişim sayfalarına müdahale etmez.
========================================================= */

html.store-root,
html.store-root body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip !important;
    overscroll-behavior-x: none;
}

@supports not (overflow: clip) {
    html.store-root,
    html.store-root body {
        overflow-x: hidden !important;
    }
}

html.store-root body.store-body {
    position: relative;
    min-width: 0;
}

html.store-root body.store-body *,
html.store-root body.store-body *::before,
html.store-root body.store-body *::after {
    box-sizing: border-box;
}

html.store-root body.store-body img,
html.store-root body.store-body video,
html.store-root body.store-body iframe,
html.store-root body.store-body svg,
html.store-root body.store-body picture {
    max-width: 100%;
}

/* İç blokların viewport dışına taşmasını engeller. */
html.store-root body.store-body main,
html.store-root body.store-body #main-content,
html.store-root body.store-body .site-header,
html.store-root body.store-body .theme2-store-header,
html.store-root body.store-body .theme2-tools,
html.store-root body.store-body .theme2-category-nav,
html.store-root body.store-body .theme2-home-hero,
html.store-root body.store-body .storefront-v44-hero,
html.store-root body.store-body .storefront-v4-benefits,
html.store-root body.store-body .storefront-v4-overview,
html.store-root body.store-body .theme2-promo-grid,
html.store-root body.store-body .theme2-products-section,
html.store-root body.store-body .theme2-brands-section {
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 820px) {
    /* -----------------------------
       MOBİL ÜST ALAN
    ----------------------------- */
    html.store-root .theme-2 .theme2-store-header {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    html.store-root .theme-2 .theme2-tools > .wrap {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        grid-template-columns: 42px minmax(0, 1fr) 92px !important;
    }

    html.store-root .theme-2 .theme2-tools .store-logo,
    html.store-root .theme-2 .theme2-tools .store-logo a,
    html.store-root .theme-2 .theme2-tools .store-logo img,
    html.store-root .theme-2 .theme2-search,
    html.store-root .theme-2 .theme2-search form,
    html.store-root .theme-2 .theme2-search input {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    html.store-root .theme-2 .theme2-tools .store-logo img {
        width: auto !important;
        height: auto !important;
        max-height: 64px !important;
    }

    html.store-root .theme-2 .theme2-category-nav {
        width: 100%;
        max-width: 100%;
        overflow: hidden !important;
    }

    html.store-root .theme-2 .theme2-category-nav > .wrap {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    html.store-root .theme-2 .theme2-category-nav > .wrap::-webkit-scrollbar {
        display: none;
    }

    html.store-root .theme-2 .theme2-category-nav a,
    html.store-root .theme-2 .theme2-category-nav button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* -----------------------------
       ANA SLIDER + SAĞ KAMPANYA
    ----------------------------- */
    html.store-root .storefront-v44-hero {
        width: 100% !important;
        max-width: 100% !important;
        overflow: clip !important;
        padding: 10px 0 8px !important;
    }

    html.store-root .storefront-v44-hero > .storefront-v44-hero-grid {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 10px !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
        overflow: hidden !important;
    }

    html.store-root .storefront-v44-main-slider,
    html.store-root .storefront-v44-main-slider > *,
    html.store-root .storefront-v44-main-slider .advanced-slider,
    html.store-root .storefront-v44-main-slider .alya-slide,
    html.store-root .storefront-v44-main-slider .advanced-slide-media,
    html.store-root .storefront-v44-main-slider picture,
    html.store-root .storefront-side-campaigns {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    html.store-root .storefront-v44-main-slider {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        aspect-ratio: 750 / 400 !important;
        overflow: hidden !important;
        border-radius: 12px !important;
    }

    html.store-root .storefront-v44-main-slider img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    html.store-root .storefront-side-campaigns {
        height: 180px !important;
        min-height: 180px !important;
        max-height: 180px !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    html.store-root .storefront-side-campaign,
    html.store-root .storefront-side-campaign > a {
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* -----------------------------
       AVANTAJ ŞERİDİ
    ----------------------------- */
    html.store-root .theme-2 .storefront-v4-benefits {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin: 8px 10px 16px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    html.store-root .theme-2 .storefront-v4-benefits article {
        min-width: 0 !important;
        padding: 12px 10px !important;
        gap: 9px !important;
    }

    html.store-root .theme-2 .storefront-v4-benefits article:first-child {
        grid-column: 1 / -1 !important;
    }

    html.store-root .theme-2 .storefront-v4-benefits article > span {
        width: 38px !important;
        height: 38px !important;
        flex-basis: 38px !important;
    }

    html.store-root .theme-2 .storefront-v4-benefits b,
    html.store-root .theme-2 .storefront-v4-benefits p {
        overflow-wrap: anywhere;
    }

    /* -----------------------------
       MAĞAZA İÇERİK ALANI
    ----------------------------- */
    html.store-root .theme-2 .storefront-v4-overview {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0 10px 22px !important;
        display: block !important;
    }

    html.store-root .theme-2 .storefront-v4-main,
    html.store-root .theme-2 .storefront-v4-popular,
    html.store-root .theme-2 .storefront-v4-solutions {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    html.store-root .theme-2 .storefront-v4-heading {
        width: 100%;
        min-width: 0;
        align-items: flex-end !important;
        gap: 10px !important;
    }

    html.store-root .theme-2 .storefront-v4-heading > div {
        min-width: 0;
    }

    html.store-root .theme-2 .storefront-v4-heading h2 {
        font-size: 21px !important;
        overflow-wrap: anywhere;
    }

    html.store-root .theme-2 .storefront-v4-heading > a {
        flex: 0 0 auto;
        max-width: 42%;
        white-space: normal !important;
        text-align: right;
        line-height: 1.35;
    }

    /* Popüler kategoriler yatay kayabilir; yalnız kendi alanı hareket eder. */
    html.store-root .theme-2 .storefront-v4-category-grid {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    html.store-root .theme-2 .storefront-v4-category-grid::-webkit-scrollbar {
        display: none;
    }

    /* Kurumsal çözümler mobilde daima 2 kart yan yana. */
    html.store-root .theme-2 .storefront-v4-solution-grid {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 9px !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    html.store-root .theme-2 .storefront-v4-solution-grid > a {
        width: auto !important;
        min-width: 0 !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 8px !important;
        border-radius: 12px !important;
    }

    html.store-root .theme-2 .storefront-v4-solution-grid > a > span {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 10 !important;
        flex: 0 0 auto !important;
        border-radius: 9px !important;
    }

    html.store-root .theme-2 .storefront-v4-solution-grid > a > div {
        width: 100%;
        min-width: 0;
    }

    html.store-root .theme-2 .storefront-v4-solution-grid b {
        font-size: 11px !important;
        line-height: 1.25 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    html.store-root .theme-2 .storefront-v4-solution-grid p {
        min-height: 0 !important;
        margin: 4px 0 6px !important;
        font-size: 8px !important;
        line-height: 1.35 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    html.store-root .theme-2 .storefront-v4-solution-grid small {
        font-size: 8px !important;
    }

    /* -----------------------------
       ÜRÜN/PROMOSYON/MARKA BLOKLARI
    ----------------------------- */
    html.store-root .theme-2 .theme2-promo-grid,
    html.store-root .theme-2 .theme2-products-section,
    html.store-root .theme-2 .theme2-brands-section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    html.store-root .theme-2 .theme2-promo-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    html.store-root .theme-2 .store-product-grid,
    html.store-root .theme-2 .catalog-product-grid.view-grid {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 9px !important;
    }

    html.store-root .theme-2 .commerce-card,
    html.store-root .theme-2 .theme2-product-card {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    html.store-root .theme-2 .commerce-card h3,
    html.store-root .theme-2 .theme2-product-card h3 {
        overflow-wrap: anywhere;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    html.store-root .theme-2 .theme2-brand-rail {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
    }

    html.store-root .theme-2 .theme2-brand-rail::-webkit-scrollbar {
        display: none;
    }

    /* Sabit mobil alt menü viewport dışına taşmaz. */
    html.store-root .mobile-bottom-nav {
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: 100% !important;
    }

    html.store-root .theme2-floating-whatsapp {
        right: 12px !important;
        max-width: calc(100% - 24px) !important;
    }
}

/* Çok dar telefonlarda da iki çözüm kartı korunur. */
@media (max-width: 380px) {
    html.store-root .theme-2 .storefront-v4-solution-grid {
        gap: 7px !important;
    }

    html.store-root .theme-2 .storefront-v4-solution-grid > a {
        padding: 7px !important;
    }

    html.store-root .theme-2 .storefront-v4-solution-grid p {
        display: none !important;
    }
}

/* =========================================================
   KURUMSAL ANA SAYFA — MOBİLDE 2'Lİ KURUMSAL ÇÖZÜMLER
   Yalnız corporate sayfalarda çalışır; mağaza/demoya karışmaz.
========================================================= */
@media (max-width: 560px) {
    html.corporate-root body.corporate-body .home-managed-section .services-grid,
    html.corporate-root body.corporate-body main .services-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    html.corporate-root body.corporate-body .services-grid .service-card {
        min-width: 0 !important;
        border-radius: 12px !important;
    }

    html.corporate-root body.corporate-body .services-grid .service-card img {
        width: 100% !important;
        height: 112px !important;
        object-fit: cover !important;
    }

    html.corporate-root body.corporate-body .services-grid .service-card-body {
        padding: 11px !important;
    }

    html.corporate-root body.corporate-body .services-grid .service-card h3 {
        margin: 0 0 5px !important;
        font-size: 13px !important;
        line-height: 1.25 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    html.corporate-root body.corporate-body .services-grid .service-card p {
        margin: 0 !important;
        font-size: 10px !important;
        line-height: 1.4 !important;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}
