/* Keep sticky headers relative to the viewport, not an overflow-hidden main. */
html,body{overflow-x:clip}
body .main{overflow:visible;min-width:0}
body .main>.topbar{position:sticky;top:0;margin-top:0;z-index:30}
.topbar-title,.topbar-actions,.panel-head>*,.main form{min-width:0}
.topbar-actions{flex-wrap:wrap}
.page-actions{flex-wrap:wrap}
.main .status-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px;align-items:end}
.main .status-filters label{min-width:0;margin:0}
.main .status-filters input,.main .status-filters select{min-width:0;max-width:100%}
.main .status-filters .primary{margin:0;white-space:normal}
.main .offer-tabs{width:100%;flex-wrap:wrap}
.main .offer-tabs a{white-space:normal}
.main .panel{overflow:visible}
.main .table-wrap thead th,.main .product-table-wrap thead th,.main .shoper-table-wrap thead th{top:0}

/* Laptop tables use the available width rather than desktop pixel widths.
   Tabela produktów jest wyjątkiem: zachowuje układ tabeli i przewija się
   poziomo wewnątrz panelu (patrz sekcja na końcu tego pliku). */
@media(min-width:768px) and (max-width:1600px){
  body .main{padding-left:14px;padding-right:14px}
  body .main>.topbar{margin-left:-14px;margin-right:-14px;padding-left:14px;padding-right:14px}
  .main .panel{padding:12px}
  .main table:not(.product-table),.main #offers{width:100%;min-width:0!important;table-layout:fixed}
  .main table:not(.product-table) th,.main table:not(.product-table) td{width:auto!important;min-width:0!important;max-width:none;white-space:normal;overflow-wrap:anywhere;padding:7px 4px;font-size:11px}
  .main table:not(.product-table) th{font-size:9px;letter-spacing:0}
  .main table:not(.product-table) .badge{white-space:normal;overflow-wrap:anywhere;font-size:9px;padding:3px 4px}
  .main table:not(.product-table) .button,.main table:not(.product-table) button{white-space:normal;min-width:0;max-width:100%;padding:5px;font-size:11px}
  .main table:not(.product-table) input:not([type=checkbox]):not([type=radio]),.main table:not(.product-table) select{min-width:0;max-width:100%}
  .main table:not(.product-table) img{max-width:100%;height:auto}
  .main .product-cell{min-width:0}
  .main .product-cell>*{min-width:0;max-width:100%}
  .main #offers th:first-child,.main #offers td:first-child{width:26px!important}
  .main .erli-name,.main .erli-identifiers{min-width:0;max-width:100%}
  .main .erli-thumb,.main .shoper-product-thumb{width:40px;height:40px;max-width:100%}
  .main .panel-head{flex-wrap:wrap}
  .main .filters-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .main .filters-grid input,.main .filters-grid select{min-width:0}
}
@media(max-width:1100px){
  /* A column flex container must not inherit a 360px vertical flex basis. */
  .topbar-actions,.topbar-title{flex:0 1 auto}
  .sidebar-foot{flex-wrap:wrap;gap:8px}
}
@media(max-width:767px){
  .main .topbar{position:relative;top:0}
  .topbar-actions,.topbar-title{flex:none}
  .main .panel:has(>table){overflow-x:auto}

  /* Produkty IDEA: na telefonie pokazuj każdy produkt jako kartę,
     zamiast wymagać poziomego przewijania jedenastu kolumn. */
  .main .product-table-wrap{overflow:visible}
  .main .product-table{display:block;width:100%!important;min-width:0!important;table-layout:auto}
  .main .product-table thead{display:none}
  .main .product-table tbody{display:block}
  .main .product-table tbody tr{position:relative;display:block;margin:0 0 12px;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface);box-shadow:var(--shadow-sm)}
  .main .product-table tbody td{display:grid!important;grid-template-columns:minmax(100px,25%) minmax(0,1fr);gap:8px;align-items:start;width:auto!important;min-width:0!important;max-width:none!important;padding:8px 4px;border-bottom:1px solid #eef0f5;overflow-wrap:anywhere;font-size:12px}
  .main .product-table tbody td:last-child{border-bottom:0}
  .main .product-table tbody td::before{font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);content:""}
  .main .product-table tbody td:nth-child(1){display:block!important;padding:2px 4px 6px;border-bottom:1px solid #eef0f5}
  .main .product-table tbody td:nth-child(1)::before{display:none}
  .main .product-table tbody td:nth-child(2)::before{content:"Produkt"}
  .main .product-table tbody td:nth-child(3)::before{content:"SKU / EAN"}
  .main .product-table tbody td:nth-child(4)::before{content:"Kompletność"}
  .main .product-table tbody td:nth-child(5)::before{content:"Ceny"}
  .main .product-table tbody td:nth-child(6)::before{content:"Stan"}
  .main .product-table tbody td:nth-child(7)::before{content:"Allegro"}
  .main .product-table tbody td:nth-child(8)::before{content:"Shoper"}
  .main .product-table tbody td:nth-child(9)::before{content:"ERLI"}
  .main .product-table tbody td:nth-child(10)::before{content:"Empik"}
  .main .product-table tbody td:nth-child(11)::before{content:"eMAG / akcje"}
  .main .product-table .product-cell{display:flex;flex-direction:row;align-items:flex-start;gap:8px}
  .main .product-table .product-cell img,.main .product-table .product-cell .image-placeholder{width:44px;height:44px}
  .main .product-table .badge{white-space:normal;text-align:left}
  .main .product-table .button{width:100%;max-width:180px}
}

/* Produkty IDEA: szerokości kolumn, czcionki i odstępy tabeli produktów są
   płynne i opisane w całości w idea-products.css. Tutaj zostaje tylko awaryjny
   przewój poziomy, gdyby okno było zbyt wąskie na jedenaście kolumn. */
@media(min-width:768px){
  .main .product-table-wrap{overflow-x:auto}
}
