/* Medical Szczecin – kompaktowy nagłówek i menu na telefonie (< 992 px) */

/* Elementy mobilne są ukryte na komputerze */
.xb-mburger,
.xb-micon,
.xb-drawer { display: none; }

@media (max-width: 991px) {

  /* --- nagłówek przyklejony do góry, jedna linia --- */
  #header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 8px rgba(5, 31, 96, .08);
  }
  #header .header-top { padding: 0 !important; position: relative; }
  #header .header-top .container { padding-left: 8px; padding-right: 8px; }
  #header .header-top .row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin: 0;
    min-height: 60px;
  }

  /* przycisk Menu */
  .xb-mburger {
    order: 3;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 48px;
    height: 48px;
    padding: 0 6px;
    margin: 0;
    border: 0;
    background: transparent;
    color: #051f60;
    cursor: pointer;
    line-height: 1;
  }
  .xb-mburger .icon { font-size: 26px; line-height: 26px; }
  .xb-mburger span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 2px;
  }

  /* logo */
  #header .header_logo {
    order: 1;
    flex: 1 1 auto;
    width: auto !important;
    max-width: none;
    padding: 13px 10px 10px 10px !important;
    margin: 0 !important;
    text-align: left !important;
    float: none !important;
  }
  #header .header_logo img.logo {
    max-height: 38px;
    width: auto;
    margin: 0 !important;
  }

  /* ikony po prawej */
  #header .display_top {
    order: 2;
    display: flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    position: static;
  }
  .xb-micon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 48px;
    border: 0;
    background: transparent;
    color: #051f60;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
  }
  .xb-micon:hover, .xb-micon:focus { color: #de0000; }

  /* koszyk – mniejsza ikona */
  #header .display_top .blockcart {
    order: 10;
    float: none !important;
    margin: 0 0 0 2px !important;
    padding: 0 !important;
    border: 0 !important;
    width: 44px;
    height: 48px;
    position: relative;
  }
  #header .display_top .blockcart .header > a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 48px;
    padding: 0 !important;
  }
  #header .display_top .blockcart .header .icon {
    font-size: 26px !important;
    line-height: 48px !important;
    height: 48px !important;
    color: #051f60;
  }
  #header .display_top .blockcart .item_count {
    position: absolute !important;
    top: 6px !important;
    right: 2px !important;
    left: auto !important;
    min-width: 18px;
    width: auto !important;
    height: 18px !important;
    line-height: 18px !important;
    padding: 0 4px;
    font-size: 11px !important;
    border-radius: 9px;
  }
  #header .display_top .blockcart .body { display: none !important; }

  /* wyszukiwarka – rozwijana pod nagłówkiem */
  #header .display_top #search_widget {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 10px 12px 12px;
    background: #fff;
    box-shadow: 0 8px 14px rgba(5, 31, 96, .12);
    border-top: 1px solid #eef1f6;
    float: none !important;
  }
  body.xb-search-open #header .display_top #search_widget { display: block; }
  #header .display_top #search_widget form { width: 100% !important; max-width: none !important; }
  #header .display_top #search_widget input[type="text"] { width: 100% !important; font-size: 16px; }
  body.xb-search-open .xb-msearch-toggle { color: #de0000; }

  /* chowamy język, rozwijane konto i starą belkę „Kategoria” */
  #header .display_top .language-selector-wrapper,
  #header .display_top .user-info-block,
  #header .header-bottom,
  #header .header-nav { display: none !important; }

  /* --- wysuwane menu --- */
  .xb-drawer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2000;
    visibility: hidden;
    pointer-events: none;
  }
  .xb-drawer.is-open { visibility: visible; pointer-events: auto; }
  .xb-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 31, 96, .45);
    opacity: 0;
    transition: opacity .25s ease;
  }
  .xb-drawer.is-open .xb-drawer-backdrop { opacity: 1; }
  .xb-drawer-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: auto !important;
    right: 0;
    width: 86%;
    max-width: 360px;
    background: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform .28s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, .18);
  }
  .xb-drawer.is-open .xb-drawer-panel { transform: translateX(0); }
  body.xb-drawer-open { overflow: hidden; }

  .xb-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 0 20px;
    min-height: 60px;
    background: #051f60;
    color: #fff;
  }
  .xb-drawer-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .02em;
  }
  .xb-drawer-close {
    width: 48px;
    height: 48px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
  }

  .xb-drawer-links,
  .xb-drawer-catlist {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .xb-drawer-links li a,
  .xb-drawer-catlist li a,
  .xb-drawer-cats-toggle,
  .xb-drawer-account {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 12px 20px;
    border-bottom: 1px solid #eef1f6;
    color: #051f60;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
  }
  .xb-drawer-links li a:hover,
  .xb-drawer-catlist li a:hover { background: #f3f7fc; color: #de0000; }
  .xb-drawer-links li.is-highlight a { color: #de0000; }
  .xb-drawer-links li.is-active a { background: #eaf4fd; }

  .xb-drawer-cats-toggle {
    justify-content: space-between;
    border: 0;
    border-bottom: 1px solid #eef1f6;
    background: #f7f9fc;
    cursor: pointer;
  }
  .xb-chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin: -4px 4px 0 12px;
    transition: transform .2s ease;
  }
  .xb-drawer-cats-toggle[aria-expanded="true"] .xb-chevron { transform: rotate(-135deg); margin-top: 4px; }
  .xb-drawer-catlist li a {
    font-weight: 400;
    font-size: 15px;
    min-height: 46px;
    padding-left: 32px;
    background: #fbfcfe;
  }

  .xb-drawer-account {
    margin-top: auto;
    gap: 10px;
    border-top: 1px solid #eef1f6;
    border-bottom: 0;
    background: #f7f9fc;
  }
  .xb-drawer-account .icon { font-size: 20px; }
}
