/* Yavuz Plastik StockOS v1.6.92
   Mobil / tablet hata düzeltme paketi
   Amaç: görünüm bozulmalarını çözmek, taşmaları engellemek,
   kritik kartları 2 / 3 / 5 yapısına taşımak ve koyu zeminlerde
   metin okunurluğunu zorlamaktır.
*/

/* ---------------------------------------------------------
   1) Genel okunabilirlik ve taşma güvenliği
--------------------------------------------------------- */
html body :where(
    .mxso-wrap,
    .mxso-standalone,
    .mxstockos-public-catalog-page,
    .mxso-sector-pos-shell,
    .mxso-dashboard-movements-panel,
    .mxso-panel,
    .mxso-card,
    .mxso-kpi,
    .mxso-pos-live-drawer,
    .mxso-pos-wa-drawer,
    .mxso-market-panel,
    .mxso-market-card,
    .mxso-section-title,
    .mxso-pos-stock-kpis article,
    .mxso-sector-total-box article,
    .mxso-online-report-v1568 article,
    .mxso-v1594-side-kpis article,
    .mxso-v1596-side-kpis article
) :where(strong,b,small,span,p,h1,h2,h3,h4){
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
}

html body :where(
    .mxso-pos-stock-kpis article strong,
    .mxso-sector-total-box article strong,
    .mxso-online-report-v1568 article strong,
    .mxso-v1594-side-kpis article strong,
    .mxso-v1596-side-kpis article strong,
    .mxso-pos-live-kpis b,
    .mxso-dashboard-metric-card strong,
    .mxso-kpi-value,
    [data-scale-display]
){
    line-height:1.08!important;
    white-space:normal!important;
}

/* ---------------------------------------------------------
   2) Koyu zemin üstünde metin kontrastı
--------------------------------------------------------- */
html body :where(
    .mxso-dashboard-movements-panel > .mxso-section-title,
    .mxso-pos-live-drawer header,
    .mxso-pos-wa-drawer header,
    .mxso-sector-pos-topcard,
    .mxso-sector-pos-hero,
    .mxso-sector-pos-sale-hero,
    .mxso-market-hero,
    .mxso-online-hero,
    .mxso-wa-hero,
    .mxso-blue-title,
    .mxso-pos-summary-card,
    .mxso-market-summary-card,
    .mxso-pos-stock-hero,
    .mxso-public-campaign-top,
    .mxstockos-yavuz-catalog-mobile-copy
) :where(h1,h2,h3,h4,strong,b,p,small,span,em,label){
    color:#fff!important;
    -webkit-text-fill-color:#fff!important;
}

html body :where(
    .mxso-dashboard-movements-panel > .mxso-section-title,
    .mxso-pos-live-drawer header,
    .mxso-pos-wa-drawer header,
    .mxso-sector-pos-topcard,
    .mxso-market-hero,
    .mxso-pos-stock-hero,
    .mxso-blue-title
) small,
html body :where(
    .mxso-dashboard-movements-panel > .mxso-section-title,
    .mxso-pos-live-drawer header,
    .mxso-pos-wa-drawer header,
    .mxso-sector-pos-topcard,
    .mxso-market-hero,
    .mxso-pos-stock-hero,
    .mxso-blue-title
) p{
    color:rgba(255,255,255,.86)!important;
    -webkit-text-fill-color:rgba(255,255,255,.86)!important;
}

/* Son stok hareketleri başlığı mobilde görünür olsun */
html body .mxso-dashboard-movements-panel > .mxso-section-title{
    background:linear-gradient(135deg,#0b3f97 0%,#126cef 100%)!important;
    border-color:rgba(255,255,255,.14)!important;
}

/* ---------------------------------------------------------
   3) Dashboard focus ikonları: dashicons font zorlaması
--------------------------------------------------------- */
html body .mxso-dashboard-focus-card > .dashicons,
html body .mxso-dashboard-focus-card > .dashicons:before,
html body .mxso-focus-mode-head > .dashicons,
html body .mxso-focus-mode-head > .dashicons:before{
    font-family:dashicons!important;
    speak:none!important;
    font-style:normal!important;
    font-weight:400!important;
    text-transform:none!important;
    line-height:1!important;
    -webkit-font-smoothing:antialiased!important;
    -moz-osx-font-smoothing:grayscale!important;
}

/* ---------------------------------------------------------
   4) KPI / özet kartları: mobil 2, tablet 3, web 5
--------------------------------------------------------- */
html body :where(
    .mxso-pos-stock-kpis,
    .mxso-online-report-v1568,
    .mxso-v1594-side-kpis,
    .mxso-v1596-side-kpis,
    .mxso-pos-live-kpis,
    .mxso-sector-total-box,
    .mxso-management-kpis,
    .mxso-scorecard-grid,
    .mxso-executive-score-grid,
    .mxso-kpi-grid-5,
    .mxso-kpi-grid-responsive
){
    display:grid!important;
    gap:12px!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
}

html body :where(
    .mxso-pos-stock-kpis,
    .mxso-online-report-v1568,
    .mxso-v1594-side-kpis,
    .mxso-v1596-side-kpis,
    .mxso-pos-live-kpis,
    .mxso-sector-total-box,
    .mxso-management-kpis,
    .mxso-scorecard-grid,
    .mxso-executive-score-grid,
    .mxso-kpi-grid-5,
    .mxso-kpi-grid-responsive
) > *{
    min-width:0!important;
}

@media (min-width:761px) and (max-width:1180px){
    html body :where(
        .mxso-pos-stock-kpis,
        .mxso-online-report-v1568,
        .mxso-v1594-side-kpis,
        .mxso-v1596-side-kpis,
        .mxso-pos-live-kpis,
        .mxso-sector-total-box,
        .mxso-management-kpis,
        .mxso-scorecard-grid,
        .mxso-executive-score-grid,
        .mxso-kpi-grid-5,
        .mxso-kpi-grid-responsive
    ){
        grid-template-columns:repeat(3,minmax(0,1fr))!important;
        gap:11px!important;
    }
}

@media (max-width:760px){
    html body :where(
        .mxso-pos-stock-kpis,
        .mxso-online-report-v1568,
        .mxso-v1594-side-kpis,
        .mxso-v1596-side-kpis,
        .mxso-pos-live-kpis,
        .mxso-sector-total-box,
        .mxso-management-kpis,
        .mxso-scorecard-grid,
        .mxso-executive-score-grid,
        .mxso-kpi-grid-5,
        .mxso-kpi-grid-responsive
    ){
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:9px!important;
    }

    html body :where(
        .mxso-pos-stock-kpis article,
        .mxso-online-report-v1568 article,
        .mxso-v1594-side-kpis article,
        .mxso-v1596-side-kpis article,
        .mxso-pos-live-kpis a,
        .mxso-sector-total-box article
    ){
        padding:12px!important;
        border-radius:16px!important;
    }
}

/* ---------------------------------------------------------
   5) Sektör POS: grup filtreleri, sayaç rozeti, ürün gridi
--------------------------------------------------------- */
html body .mxso-sector-product-groups{
    align-items:center!important;
}

html body .mxso-sector-product-groups button[data-pos-group]{
    min-width:max-content!important;
    column-gap:7px!important;
}

html body .mxso-sector-product-groups button[data-pos-group] small{
    flex:0 0 auto!important;
    min-width:22px!important;
    padding:0 5px!important;
    font-size:10px!important;
}

/* Ürün gridi: mobilde 2, tablette 3, webde 5 */
html body .mxso-sector-product-grid{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    align-content:start!important;
}
@media (min-width:761px) and (max-width:1180px){
    html body .mxso-sector-product-grid{
        grid-template-columns:repeat(3,minmax(0,1fr))!important;
    }
}
@media (max-width:760px){
    html body .mxso-sector-product-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:10px!important;
        padding-bottom:38px!important;
    }
}

/* ---------------------------------------------------------
   6) Canlı sipariş / WhatsApp drawer mobil çakışma düzeltmesi
--------------------------------------------------------- */
html body .mxso-pos-live-head-actions{
    flex-wrap:wrap!important;
}

html body .mxso-pos-live-head-actions :where(button,select){
    color:#fff!important;
}

@media (max-width:760px){
    html body .mxso-pos-live-hub-v140{
        right:10px!important;
        bottom:94px!important;
    }
    html body .mxso-pos-live-toggle{
        width:58px!important;
        height:58px!important;
        border-radius:18px!important;
    }
    html body .mxso-pos-live-drawer{
        left:10px!important;
        right:10px!important;
        width:auto!important;
        max-width:none!important;
        bottom:162px!important;
        max-height:56vh!important;
        border-radius:22px!important;
    }
    html body .mxso-pos-wa-tab{
        top:auto!important;
        right:10px!important;
        bottom:162px!important;
        transform:none!important;
        writing-mode:horizontal-tb!important;
        text-orientation:initial!important;
        flex-direction:row!important;
        border-radius:16px!important;
        padding:10px 12px!important;
        gap:8px!important;
    }
    html body .mxso-pos-wa-tab b{
        min-width:22px!important;
        height:22px!important;
    }
    html body .mxso-pos-wa-drawer{
        left:10px!important;
        right:10px!important;
        top:auto!important;
        bottom:162px!important;
        width:auto!important;
        max-width:none!important;
        height:auto!important;
        max-height:56vh!important;
        border:1px solid #dbe7f4!important;
        border-radius:22px!important;
        box-shadow:0 24px 58px rgba(7,27,58,.22)!important;
    }
    html body .mxso-pos-live-drawer header,
    html body .mxso-pos-wa-drawer header{
        align-items:flex-start!important;
    }
    html body .mxso-pos-live-head-actions{
        width:100%!important;
        justify-content:flex-start!important;
        margin-top:10px!important;
    }
}

/* ---------------------------------------------------------
   7) Katalog hero: boş mavi blok yerine gerçek ürün görseli
--------------------------------------------------------- */
html body.mxstockos-public-catalog-page .mxstockos-yavuz-catalog-visual{
    position:relative!important;
    overflow:hidden!important;
}

html body.mxstockos-public-catalog-page .mxstockos-yavuz-catalog-visual > img{
    display:block!important;
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    object-position:center center!important;
    opacity:1!important;
}

html body.mxstockos-public-catalog-page .mxstockos-yavuz-catalog-mobile-copy{
    position:relative!important;
    z-index:2!important;
    background:linear-gradient(90deg,rgba(3,20,47,.93) 0%,rgba(3,20,47,.78) 52%,rgba(3,20,47,.10) 100%)!important;
}

@media (max-width:1180px){
    html body.mxstockos-public-catalog-page .mxstockos-yavuz-catalog-visual{
        min-height:220px!important;
    }
    html body.mxstockos-public-catalog-page .mxstockos-yavuz-catalog-mobile-copy{
        display:flex!important;
    }
}

@media (max-width:760px){
    html body.mxstockos-public-catalog-page .mxstockos-yavuz-catalog-hero{
        border-radius:18px!important;
        margin-top:8px!important;
    }
    html body.mxstockos-public-catalog-page .mxstockos-yavuz-catalog-visual{
        min-height:210px!important;
    }
    html body.mxstockos-public-catalog-page .mxstockos-yavuz-catalog-mobile-copy strong{
        max-width:88%!important;
        font-size:21px!important;
    }
    html body.mxstockos-public-catalog-page .mxstockos-yavuz-catalog-mobile-copy em{
        max-width:84%!important;
    }
}

/* ---------------------------------------------------------
   8) Alt sabit menü / güvenli boşluklar
--------------------------------------------------------- */
@media (max-width:760px){
    html body :where(.mxso-standalone,.mxso-sector-pos-shell,.mxstockos-public-catalog-page){
        padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))!important;
    }
}
