/* Kamenium mobile v2 (2026-10-06): kompaktní hlavička + 2sloupcový výpis produktů.
   Platí jen pro telefony (max-width 767.98px). Desktop a tablet beze změny.
   Vypnutí: odebrat <link> na tento soubor v @layout.latte. */

.kh-searchbtn, .kh-login, .kh-chips { display: none; }
.product .img picture { display: contents; }

@media (max-width: 767.98px) {

  /* ---------- HLAVIČKA ---------- */
  #userbar-container { display: none !important; }

  #header-container {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    box-shadow: 0 1px 0 #e9ecef, 0 4px 14px rgba(0, 0, 0, .05);
  }
  #header-container > .container { padding-left: 4px; padding-right: 6px; }

  #header-container #header {
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
  }

  /* hamburger vlevo */
  #header-container #header .menu-toggler {
    order: 1;
    width: 44px; height: 44px; padding: 0; margin: 0;
    border: 0 !important; background: none !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    color: #212529 !important; font-size: 22px; box-shadow: none !important;
  }
  /* logo uprostřed */
  #header-container #header .logo {
    order: 2; flex: 1 1 auto; margin: 0 !important;
    height: 56px; display: flex; align-items: center; justify-content: center;
  }
  #header-container #header .logo a { display: flex; align-items: center; }
  #header-container #header .logo a img { height: 38px; width: auto; max-width: none; }
  #header-container.headroom--not-top #header .logo a img { transform: none; }

  /* ikony vpravo: lupa, účet, košík */
  #header-container #header .kh-searchbtn,
  #header-container #header .kh-login {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 44px; padding: 0; border: 0; background: none;
    color: #212529; font-size: 21px; cursor: pointer; text-decoration: none;
  }
  #header-container #header .kh-searchbtn { order: 3; }
  #header-container #header .kh-login { order: 4; }
  #header-container.kh-search-open #header .kh-searchbtn { color: #956C58; }

  #header-container #header .right { order: 5; margin: 0; }
  #header-container #header .cart { margin-left: 0; order: 0; }
  #header-container #header .cart a {
    width: 44px !important; height: 44px; padding: 0 !important;
    background: none !important; border: 0 !important; color: #212529 !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    font-size: 21px; position: relative; box-shadow: none !important;
  }
  #header-container #header .cart a .price { display: none; }
  #header-container #header .cart a .badge {
    position: absolute; top: 3px; right: 0; transform: none;
    width: auto; height: auto; min-width: 18px; padding: 3px 5px;
    background: #956C58 !important; color: #fff !important;
    font: 700 11px/12px Arial, sans-serif; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px;
  }
  #header-container #header .right .socials,
  #header-container #header .right .langs,
  #header-container #header .right .userbar { display: none !important; }

  /* vyhledávání: celý řádek, rozbalí se lupou */
  #header-container #header .search {
    order: 10; flex: 0 0 100%; width: 100%; margin: 0 !important; height: auto;
    display: none; padding: 0 8px 10px; position: relative;
  }
  #header-container.kh-search-open #header .search { display: block; }
  #header-container #header .search #search {
    position: static !important; width: 100% !important; margin: 0 !important;
    overflow: visible; display: block; transition: none;
  }
  #header-container #header .search #search form { width: 100% !important; display: flex; }
  #header-container #header .search #search form .form-control {
    width: auto !important; flex: 1 1 auto; min-width: 0; height: 44px;
    font-size: 16px; /* 16px = iOS nezoomuje při fokusu */
    border: 1.5px solid #956C58; border-right: 0; border-radius: 6px 0 0 6px;
  }
  #header-container #header .search #search form .btn {
    flex: 0 0 52px; width: 52px !important; height: 44px; padding: 0;
    background: #956C58; border: 1.5px solid #956C58; color: #fff; border-radius: 0 6px 6px 0;
  }
  #header-container #header .search #search .results {
    left: 0; right: 0; max-height: 60vh; overflow: auto; box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
  }

  /* rychlé kategorie (odjíždí s obsahem) */
  .kh-chips {
    display: flex; gap: 8px; overflow-x: auto; white-space: nowrap;
    padding: 8px 12px; background: #fff; border-bottom: 1px solid #e9ecef;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .kh-chips::-webkit-scrollbar { display: none; }
  .kh-chips a {
    flex: none; padding: 8px 14px; border-radius: 999px; background: #f4eeea;
    color: #65493c; font-weight: 700; font-size: 14px; line-height: 1; text-decoration: none;
  }
  .kh-chips a.sale { background: #65493c; color: #fff; }

  /* mobilní menu (mmenu): telefon na konci seznamu */
  #mm-menu .kh-tel a { background: #956C58; color: #fff !important; text-align: center; }

  /* ---------- KATEGORIE ---------- */
  .category h1 { font-size: 26px; }

  /* podkategorie = posuvné dlaždice */
  #categories-grid-in-category {
    flex-wrap: nowrap !important; overflow-x: auto; margin: 0 -12px !important;
    padding: 0 12px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  #categories-grid-in-category::-webkit-scrollbar { display: none; }
  #categories-grid-in-category { position: relative; }
  #categories-grid-in-category .category {
    /* ~2,5 dlaždice na šířku: další dlaždice vždy vykukuje zpoza okraje = nápověda k rolování */
    flex: 0 0 calc((100vw - 24px) / 2.5) !important; max-width: calc((100vw - 24px) / 2.5) !important;
    padding: 0 6px !important; margin: 0 !important;
  }
  /* jemný bílý přechod + šipka na pravém okraji; po doroluování na konec zmizí (třída kh-end) */
  #categories-grid-in-category::after {
    content: "\203A"; flex: 0 0 44px; margin-left: -44px; align-self: stretch;
    position: sticky; right: -12px; z-index: 2; pointer-events: none;
    display: flex; align-items: center; justify-content: flex-end; padding-right: 6px;
    background: linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0));
    color: #956C58; font-size: 30px; line-height: 1; transition: opacity .2s;
  }
  #categories-grid-in-category.kh-end::after { opacity: 0; }
  #categories-grid-in-category .category .row {
    flex-direction: column; border: 1px solid #e9ecef; border-radius: 8px; overflow: hidden; background: #fff;
  }
  #categories-grid-in-category .category .col-3 { flex: none; max-width: 100%; width: 100%; }
  #categories-grid-in-category .category .img { width: 100%; aspect-ratio: 1 / 1; margin: 0; }
  #categories-grid-in-category .category .img img { width: 100%; height: 100%; object-fit: cover; }
  #categories-grid-in-category .category .name { padding: 0 !important; width: 100%; flex: none; max-width: 100%; background: #fff !important; }
  #categories-grid-in-category .category .name p {
    padding: 8px !important; font-size: 13px !important; line-height: 1.2; min-height: 46px;
    justify-content: center !important; text-align: center;
  }
  #categories-grid-in-category .category .name i { display: none; }

  /* Řazení + Filtrace vedle sebe */
  .category > .row.mt-5 { margin-top: 18px !important; }
  .category .sorters .btn, .category .filters-toggle .btn {
    width: 100%; height: 44px; font-size: 14px; padding: 0 8px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  .category .sorters .dropdown { width: 100%; }
  .category .filters-toggle { text-align: center !important; }

  /* produkty: 2 sloupce, kompaktní karta */
  .category-products { margin: 0 -5px !important; }
  .category-products .product { padding: 5px !important; position: relative; }
  .category-products .product > div { border: 1px solid #e9ecef; border-radius: 8px; overflow: hidden; background: #fff; }
  .category-products .product .img p { margin: 0; }
  .category-products .product .img p a { height: auto; }
  .category-products .product .img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
  .category-products .product .discount {
    position: absolute !important; top: 8px !important; left: 8px !important; transform: none !important;
    width: auto !important; padding: 4px 8px !important; border-radius: 4px; font-size: 13px; line-height: 1;
    z-index: 15; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  }
  .category-products .product .name h3 {
    font-size: 14px !important; line-height: 1.25; margin: 8px 8px 0 !important; font-weight: 700;
    overflow-wrap: anywhere; hyphens: auto;
  }
  .category-products .product .description { display: none !important; }
  .category-products .product .mt-auto { padding: 6px 8px 10px !important; }
  .category-products .product .price { font-size: 16px; font-weight: 700; color: #65493c; }
  .category-products .product .price del { display: block !important; font-size: 12px; font-weight: 400; color: #6c757d; }

  /* stránkování */
  .sorting-paging.bottom { padding-bottom: 8px; }
  .pagination { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .pagination .page-item .page-link {
    min-width: 42px; height: 42px; margin: 0; border-radius: 6px; border: 1px solid #e9ecef;
  }
  .pagination .page-item.active .page-link { background: #65493c; border-color: #65493c; color: #fff; }
}

/* počet zobrazených produktů pod stránkováním */
.paginator-info { text-align: center; color: #6c757d; font-size: 14px; margin: 0 0 10px; }
