/* GINGERRR / mobilní hlavička v1. Samostatný doplněk, do 767 px. */
@media screen and (max-width: 767px) {
  #header.gingerrr-mobile-header {
    --grr-mobile-red: #b5001f;
    --grr-mobile-red-dark: #900019;
    --grr-mobile-cream: #faf6ed;
    --grr-mobile-paper: #fffdf8;
    --grr-mobile-ink: #302722;
    --grr-mobile-muted: #756a60;
    --grr-mobile-line: #e5dccd;
    position: relative;
    inset: auto;
    z-index: 56;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    color: var(--grr-mobile-ink);
    background: var(--grr-mobile-cream);
    border: 0;
    border-bottom: 1px solid var(--grr-mobile-line);
    box-shadow: 0 3px 14px rgb(48 39 34 / 4%);
    transition: none;
    transform: none !important;
  }

  body.gingerrr-mobile-header .overall-wrapper {
    padding-top: 0;
  }

  body.gingerrr-mobile-header.search-focused #header.gingerrr-mobile-header {
    z-index: 1004;
  }

  #header.gingerrr-mobile-header .header-top,
  #header.gingerrr-mobile-header .header-bottom {
    display: block;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
  }

  #header.gingerrr-mobile-header .header-top-wrapper {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) 44px;
    grid-template-rows: minmax(56px, auto) 48px;
    align-items: center;
    gap: 12px 10px;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 12px 14px 14px;
    overflow: visible;
  }

  #header.gingerrr-mobile-header .header-top-wrapper::before,
  #header.gingerrr-mobile-header .header-top-wrapper::after,
  #header.gingerrr-mobile-header .header-bottom-wrapper::before,
  #header.gingerrr-mobile-header .header-bottom-wrapper::after {
    content: none;
  }

  #header.gingerrr-mobile-header .site-name {
    position: static;
    grid-column: 1;
    grid-row: 1;
    float: none;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: left;
  }

  #header.gingerrr-mobile-header .site-name > a {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  #header.gingerrr-mobile-header .site-name img {
    display: block;
    width: 72px;
    max-width: 100%;
    height: auto;
    max-height: 56px;
    object-fit: contain;
  }

  #header.gingerrr-mobile-header .grr-mobile-contacts {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  #header.gingerrr-mobile-header .grr-mobile-contact {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 0;
    color: var(--grr-mobile-ink);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    text-decoration: none;
    white-space: nowrap;
  }

  #header.gingerrr-mobile-header .grr-mobile-contact svg {
    display: block;
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    color: var(--grr-mobile-red);
  }

  #header.gingerrr-mobile-header .grr-mobile-contact:hover {
    color: var(--grr-mobile-red);
  }

  /* Původní košík a hamburger zůstanou stejné odkazy se stejnými eventy. */
  #header.gingerrr-mobile-header .navigation-buttons {
    display: contents;
  }

  #header.gingerrr-mobile-header .navigation-buttons > [data-target="search"] {
    display: none;
  }

  #header.gingerrr-mobile-header .navigation-buttons > [data-target="cart"],
  #header.gingerrr-mobile-header .navigation-buttons > [data-target="navigation"] {
    position: relative;
    inset: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 3;
    box-sizing: border-box;
    width: 44px;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: var(--grr-mobile-red);
    background: var(--grr-mobile-paper);
    border: 1px solid var(--grr-mobile-line);
    border-radius: 12px;
    text-decoration: none;
    line-height: 1;
    transform: none !important;
  }

  #header.gingerrr-mobile-header .navigation-buttons > [data-target="cart"] {
    grid-row: 1;
    height: 44px;
  }

  #header.gingerrr-mobile-header .navigation-buttons > [data-target="navigation"] {
    grid-row: 2;
    height: 48px;
  }

  #header.gingerrr-mobile-header .navigation-buttons > [data-target="cart"]::before,
  #header.gingerrr-mobile-header .navigation-buttons > [data-target="navigation"]::before {
    position: static;
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    color: inherit;
    font-size: 21px;
    line-height: 1;
  }

  #header.gingerrr-mobile-header .cart-price {
    display: none !important;
  }

  #header.gingerrr-mobile-header .navigation-buttons [data-target="cart"] > i {
    top: -4px;
    right: -4px;
    bottom: auto;
    left: auto;
  }

  #header.gingerrr-mobile-header .header-top-wrapper > .search {
    position: relative;
    inset: auto;
    z-index: 1;
    display: block;
    grid-column: 1 / 3;
    grid-row: 2;
    float: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 48px;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
  }

  #header.gingerrr-mobile-header .search-form {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
  }

  #header.gingerrr-mobile-header .search-form fieldset {
    position: relative;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 4px;
    background: var(--grr-mobile-paper);
    border: 1px solid var(--grr-mobile-line);
    border-radius: 12px;
  }

  #header.gingerrr-mobile-header .search-form fieldset:focus-within {
    border-color: var(--grr-mobile-red);
    box-shadow: 0 0 0 2px rgb(181 0 31 / 8%);
  }

  #header.gingerrr-mobile-header .search-input {
    position: static;
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
    height: 38px;
    margin: 0;
    padding: 0 7px 0 34px;
    color: var(--grr-mobile-ink);
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    outline: none;
    font-family: inherit;
    font-size: 16px;
    line-height: normal;
  }

  #header.gingerrr-mobile-header .search-input::placeholder {
    color: var(--grr-mobile-muted);
    opacity: 1;
  }

  #header.gingerrr-mobile-header .search-input-icon {
    position: absolute;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--grr-mobile-muted);
    transform: translateY(-50%);
  }

  #header.gingerrr-mobile-header .search-input-icon::before {
    margin: 0;
    font-size: 16px;
    line-height: 1;
  }

  #header.gingerrr-mobile-header .search-button {
    position: static;
    inset: auto;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 59px;
    height: 38px;
    margin: 0;
    padding: 0 10px;
    color: #fff;
    background: var(--grr-mobile-red);
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-indent: 0;
    text-transform: none;
  }

  #header.gingerrr-mobile-header .search-button::before,
  #header.gingerrr-mobile-header .search-button::after {
    content: none;
  }

  #header.gingerrr-mobile-header .searchWhisperer,
  #header.gingerrr-mobile-header .search-form .search-whisperer {
    position: absolute;
    top: calc(100% + 8px);
    right: auto;
    bottom: auto;
    left: 0;
    box-sizing: border-box;
    width: calc(100% + 54px);
    min-width: 0;
    max-width: calc(100vw - 28px);
    max-height: min(420px, calc(100vh - var(--grr-mobile-header-bottom, 143px) - 12px));
    max-height: min(420px, calc(100dvh - var(--grr-mobile-header-bottom, 143px) - 12px));
    margin: 0;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--grr-mobile-ink);
    background: var(--grr-mobile-paper);
    border: 1px solid var(--grr-mobile-line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgb(48 39 34 / 14%);
    transform: none;
  }

  #header.gingerrr-mobile-header .searchWhisperer:empty {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  /* Menu a košík se otevírají pod skutečnou pozicí nové hlavičky. */
  body.gingerrr-mobile-header #navigation,
  body.gingerrr-mobile-header .popup-widget.cart-widget,
  body.gingerrr-mobile-header .popup-widget.login-widget {
    top: var(--grr-mobile-header-bottom, 143px);
    height: calc(100vh - var(--grr-mobile-header-bottom, 143px));
    height: calc(100dvh - var(--grr-mobile-header-bottom, 143px));
    max-height: calc(100dvh - var(--grr-mobile-header-bottom, 143px));
  }

  body.gingerrr-mobile-header #navigation .navigation-in {
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.gingerrr-mobile-header .popup-widget.cart-widget,
  body.gingerrr-mobile-header .popup-widget.login-widget {
    z-index: 1002;
    overflow-y: auto;
  }

  #header.gingerrr-mobile-header a:focus-visible,
  #header.gingerrr-mobile-header button:focus-visible {
    outline: 2px solid var(--grr-mobile-red);
    outline-offset: 3px;
  }
}
