/* Shared mobile header; desktop retains the existing storefront layout. */
.catalogue-mobile-logo,
.catalogue-mobile-service { display: none; }

.mobile-primary-menu,
.category-mobile-label { display: none; }

@media (min-width: 768px) {
  /* Keep every category reachable on short laptop windows. */
  .site-header .category-dropdown {
    max-height: var(--category-dropdown-available, max(0px, calc(100dvh - 190px)));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-header .category-menu > button {
    min-height: var(--control-size);
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .announcement-right { display: none; }
}

@media (max-width: 767px) {
  body[data-storefront-header] {
    --catalogue-reference-blue: #0067ED;
    --catalogue-reference-blue-dark: #0054C4;
    --catalogue-reference-blue-soft: #EDF4FF;
    --catalogue-reference-ink: #182334;
    --catalogue-reference-line: #E8ECF1;
  }

  /* Keep the existing language control reachable above the compact header. */
  body[data-storefront-header] .announcement {
    background: var(--catalogue-reference-blue);
    color: #FFFFFF;
    letter-spacing: 0;
  }

  body[data-storefront-header] .announcement > .wrap {
    width: calc(100% - 24px);
    min-height: 30px;
    justify-content: flex-end;
  }

  body[data-storefront-header] .announcement-message,
  body[data-storefront-header] .announcement-right {
    display: none;
  }

  body[data-storefront-header] .announcement .language-switch > summary {
    min-height: 30px;
    padding: 3px 6px;
    color: #FFFFFF;
    font-size: 12px;
  }

  body[data-storefront-header] .announcement .language-switch > summary:hover,
  body[data-storefront-header] .announcement .language-switch[open] > summary {
    background: rgb(255 255 255 / 12%);
  }

  body[data-storefront-header] .announcement .language-switch > summary:focus-visible {
    outline-color: #FFFFFF;
  }

  body[data-storefront-header] .site-header {
    background: var(--catalogue-reference-blue);
    color: #FFFFFF;
    box-shadow: none;
  }

  body[data-storefront-header][data-mobile-navigation] .site-header .header-main {
    display: grid;
    grid-template-columns: 44px 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    width: calc(100% - 16px);
    min-height: 64px;
    height: auto;
    padding-block: 10px;
  }

  body[data-storefront-header] .site-header .wordmark {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 0;
    overflow: hidden;
    padding: 2px;
    border-radius: 12px;
    background: #FFFFFF;
    background-clip: content-box;
  }

  body[data-storefront-header] .site-header .wordmark > .brand-logo {
    display: none;
  }

  body[data-storefront-header] .site-header .wordmark > .catalogue-mobile-logo {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
  }

  body[data-storefront-header][data-mobile-navigation] .site-header .search-form {
    position: relative;
    grid-column: 3;
    grid-row: 1;
    gap: 0;
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 2px 0 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #F4F5F7;
    color: #637083;
  }

  body[data-storefront-header] .site-header .search-form > .icon {
    position: absolute;
    right: 12px;
    display: block;
    width: 21px;
    height: 21px;
    pointer-events: none;
  }

  body[data-storefront-header][data-mobile-navigation] .site-header .search-form input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0;
    color: var(--catalogue-reference-ink);
    font-size: 16px;
    text-overflow: ellipsis;
  }

  body[data-storefront-header] .site-header .search-form input::placeholder {
    color: #667181;
  }

  body[data-storefront-header] .site-header .search-form button {
    width: 44px;
    height: 44px;
    min-height: 44px;
    background: transparent;
    color: #566477;
  }

  body[data-storefront-header] .site-header .search-form button .icon {
    visibility: hidden;
    width: 21px;
    height: 21px;
  }

  body[data-storefront-header] .site-header .search-form:focus-within {
    border-color: #FFFFFF;
    box-shadow: 0 0 0 2px rgb(255 255 255 / 30%);
  }

  body[data-storefront-header][data-mobile-navigation] .site-header .list-button {
    position: relative;
    grid-column: 4;
    grid-row: 1;
    display: grid;
    place-items: center;
    justify-self: stretch;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #FFFFFF;
  }

  body[data-storefront-header] .site-header .list-button > .icon {
    width: 26px;
    height: 26px;
  }

  body[data-storefront-header] .site-header .list-button > span:not(.count) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body[data-storefront-header] .site-header .list-button .count {
    position: absolute;
    top: -1px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
    border: 1px solid var(--catalogue-reference-blue);
    background: #FFFFFF;
    color: var(--catalogue-reference-blue-dark);
    font-size: 10px;
  }

  /* Reuse the category menu and its existing close, Escape and link handling. */
  body[data-storefront-header][data-mobile-navigation] .site-header .navigation {
    display: contents;
  }

  body[data-storefront-header] .site-header .navigation > a,
  body[data-storefront-header] .site-header .header-contact {
    display: none;
  }

  body[data-storefront-header] .site-header .category-menu {
    position: absolute;
    top: 10px;
    left: 8px;
    width: 44px;
    height: 44px;
    margin: 0;
  }

  body[data-storefront-header] .site-header .category-menu > #category-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #FFFFFF;
    font-size: 0;
  }

  body[data-storefront-header] .site-header #category-toggle > .icon:first-child {
    width: 25px;
    height: 25px;
  }

  body[data-storefront-header] .site-header #category-toggle > .down {
    display: none;
  }

  body[data-storefront-header] .site-header #category-toggle[aria-expanded="true"] {
    background: rgb(255 255 255 / 16%);
  }

  body[data-storefront-header] .site-header .category-dropdown {
    top: 50px;
    left: 0;
    z-index: 25;
    width: min(320px, calc(100vw - 24px));
    max-height: min(65dvh, 560px);
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--catalogue-reference-line);
    border-radius: 12px;
    background: #FFFFFF;
    color: var(--catalogue-reference-ink);
    box-shadow: 0 10px 35px rgb(17 36 64 / 18%);
  }

  body[data-storefront-header] .site-header .category-dropdown a {
    font-size: 15px;
  }

  body[data-storefront-header] .site-header .category-dropdown a:hover {
    background: var(--catalogue-reference-blue-soft);
  }

  body[data-storefront-header] .site-header .category-dropdown-categories,
  body[data-storefront-header] .site-header .category-desktop-label { display: none; }

  body[data-storefront-header] .site-header .mobile-primary-menu { display: block; }

  body[data-storefront-header] .site-header .mobile-primary-menu a { display: flex; }

  body[data-storefront-header] .site-header .category-mobile-label {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body[data-storefront-header] .site-header .mobile-primary-menu a.active {
    background: var(--catalogue-reference-blue-soft);
    color: var(--catalogue-reference-blue-dark);
    font-weight: 650;
  }

  body[data-storefront-header] .site-header .mobile-primary-menu a:focus-visible {
    outline-color: var(--catalogue-reference-blue-dark);
  }

  body[data-storefront-header] .site-header .catalogue-mobile-service {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 9px 16px;
    border-top: 1px solid rgb(255 255 255 / 14%);
    color: #FFFFFF;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
  }

  body[data-storefront-header] .catalogue-mobile-service > span {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body[data-storefront-header] .catalogue-mobile-service > .icon {
    flex: none;
    width: 21px;
    height: 21px;
  }

  body[data-storefront-header] .catalogue-mobile-service > .icon:last-child {
    width: 18px;
    height: 18px;
  }

  body[data-storefront-header] .site-header :is(a, button):focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: -3px;
  }

  body[data-storefront-header] .site-header .category-dropdown a:focus-visible {
    outline-color: var(--catalogue-reference-blue-dark);
  }

  body[data-storefront-header] .catalogue-mobile-service[role="button"] {
    cursor: pointer;
  }

  body[data-storefront-header] .catalogue-mobile-service[aria-haspopup="dialog"] > .icon:last-child {
    transform: rotate(90deg);
    transition: transform .18s ease-out;
  }

  body[data-storefront-header] .catalogue-mobile-service[aria-expanded="true"] > .icon:last-child {
    transform: rotate(-90deg);
  }

  body[data-storefront-header] dialog.catalogue-service-dialog {
    position: fixed;
    inset: 0 0 auto;
    width: 100%;
    max-width: none;
    max-height: min(85dvh, 760px);
    margin: 0;
    padding: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 0 0 22px 22px;
    background: var(--catalogue-reference-blue);
    color: #FFFFFF;
    box-shadow: 0 12px 36px rgb(15 29 49 / 16%);
  }

  body[data-storefront-header] dialog.catalogue-service-dialog[open] {
    display: flex;
    flex-direction: column;
    animation: catalogue-service-enter .2s cubic-bezier(.22, 1, .36, 1);
  }

  body[data-storefront-header] dialog.catalogue-service-dialog::backdrop {
    background: rgb(16 24 36 / 44%);
  }

  .catalogue-service-dialog .catalogue-service-header-slot .site-header {
    position: relative;
    top: auto;
  }

  .catalogue-service-header-slot { flex-shrink: 0; }

  body[data-storefront-header] .catalogue-service-dialog .site-header .catalogue-mobile-service {
    border-top-color: transparent;
    font-size: 16px;
    padding-block: 12px;
  }

  .catalogue-service-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 16px 0;
  }

  #catalogue-service-title,
  .catalogue-service-options .product-fulfillment > legend {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .catalogue-service-options .product-fulfillment {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .catalogue-service-options .product-fulfillment-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 16px;
  }

  .catalogue-service-options .fulfillment-card {
    position: relative;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 132px;
    padding: 8px 0;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
  }

  .catalogue-service-options .fulfillment-card > input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    opacity: 0;
  }

  .catalogue-service-options .fulfillment-card .fulfillment-illustration {
    display: block;
    width: 72px;
    height: 72px;
    padding: 9px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: #EFF5FF;
    fill: none;
    stroke: #23354C;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .catalogue-service-options .fulfillment-icon-primary { fill: #0067ED; }
  .catalogue-service-options .fulfillment-icon-neutral { fill: #DCE4EE; }
  .catalogue-service-options .fulfillment-icon-window { fill: #B9D9FF; }
  .catalogue-service-options .fulfillment-icon-wheel { fill: #43536B; }
  .catalogue-service-options .fulfillment-icon-snow { stroke: #FFFFFF; }

  .catalogue-service-options .fulfillment-card > strong {
    max-width: 100%;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .catalogue-service-options .fulfillment-card > span {
    color: var(--action-on-blue-soft, #F6F9FF);
    font-size: 12px;
    line-height: 1.35;
  }

  .catalogue-service-options .fulfillment-card:has(input:checked) .fulfillment-illustration {
    border-color: #0067ED;
    box-shadow: 0 0 0 3px #FFFFFF;
    background: #FFFFFF;
  }

  .catalogue-service-options .fulfillment-card:has(input:checked) > strong { font-weight: 800; }
  .catalogue-service-options .fulfillment-card:has(input:focus-visible) { outline: 2px solid #FFFFFF; outline-offset: 2px; }
  .catalogue-service-options .fulfillment-card.is-unavailable { opacity: .58; cursor: default; }

  .catalogue-service-options .product-fulfillment-note {
    margin: 0 0 16px;
    color: var(--action-on-blue-soft, #F6F9FF);
    font-size: 13px;
    line-height: 1.55;
  }

  .catalogue-service-delivery-card,
  .catalogue-service-store-card {
    margin: 0 0 10px;
    padding: 17px 16px;
    border-radius: 11px;
    background: #FFFFFF;
    color: #182334;
    box-shadow: 0 3px 8px rgb(12 45 91 / 8%);
  }

  .catalogue-service-body :is(h3, p) { padding: 0; }
  .catalogue-service-body h3 { margin: 0 0 6px; font-size: 16px; font-weight: 750; line-height: 1.4; }
  .catalogue-service-body p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; }
  .catalogue-service-body h3 > .icon { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }
  .catalogue-service-store-name { display: block; margin: 0 0 6px; font-size: 15px; line-height: 1.5; }
  .catalogue-service-store-address { color: #52647C; }

  .catalogue-service-delivery-action,
  .catalogue-service-pickup-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--catalogue-reference-blue);
    border-radius: 999px;
    background: var(--catalogue-reference-blue);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.4;
    text-align: center;
  }

  .catalogue-service-pickup-action {
    width: auto;
    border-color: #D8E7FD;
    background: #EDF4FF;
    color: #0054C4;
  }

  .catalogue-service-store-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
  .catalogue-service-store-links > a { display: inline-flex; align-items: center; min-height: 44px; color: #0054C4; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
  .catalogue-service-store-links .icon { width: 17px; height: 17px; color: #268C70; }
  .catalogue-service-body :is(button, a):focus-visible { outline: 3px solid #0054C4; outline-offset: 2px; }
  .catalogue-service-body button:disabled { opacity: .55; cursor: default; }

  .catalogue-service-handle {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
    border: 0;
    background: transparent;
    color: #FFFFFF;
  }

  .catalogue-service-handle > span { width: 120px; height: 4px; border-radius: 999px; background: #FFFFFF; }
  .catalogue-service-handle:focus-visible { outline: 2px solid #FFFFFF; outline-offset: -5px; }

  @keyframes catalogue-service-enter {
    from { opacity: .5; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 359px) {
  body[data-storefront-header][data-mobile-navigation] .site-header .header-main { gap: 4px; }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  body[data-storefront-header] .catalogue-mobile-service > .icon:last-child { transition: none; }
  body[data-storefront-header] dialog.catalogue-service-dialog[open] { animation: none; }
}
