/* GamePC: stable desktop mega menus without page dimming. */
@media (min-width: 992px) {
  /*
   * Apollo shows #cboxOverlay (z-index: 1002) while a submenu is open and
   * expects the header above it. The custom sticky-header rule otherwise
   * keeps #header at z-index: 9 !important, so the overlay intercepts the
   * pointer and starts an open/close loop.
   */
  html body:not(.ordering-process).submenu-visible:not(.menu-helper-visible) #header#header {
    z-index: 9999 !important;
  }

  /*
   * Keep Apollo's outside-menu hit area, but remove its 75% black paint while
   * any desktop top-level navigation submenu is open. Colorbox dialogs retain
   * their original backdrop because they do not keep a navigation item open.
   */
  html body.submenu-visible:has(
    #header :is(#navigation, .menu-helper) .menu-level-1 > li.ext:is(:hover, .exp, .gpc-mega-hold) >
      :is(.menu-level-2, .gpc-support-menu)
  ) #cboxOverlay {
    background-color: transparent !important;
  }

  /* Keep the panel hit area stationary and non-interactive while closed. */
  #header#header :is(#navigation, .menu-helper) .menu-item-711 > .menu-level-2 {
    transform: translate(-50%) !important;
    pointer-events: none !important;
  }

  /* Repeat every native open state after the bundled CSS for a deterministic cascade. */
  #header#header :is(#navigation, .menu-helper) .menu-item-711:is(:hover, .exp, .gpc-mega-hold) > .menu-level-2,
  #header#header :is(#navigation, .menu-helper) .menu-item-711 > .menu-level-2:focus-within {
    visibility: visible !important;
    transform: translate(-50%) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Full-width rail bridges the boundary below the navigation. */
  #header#header :is(#navigation, .menu-helper) .menu-level-1 > .menu-item-711::after {
    position: fixed !important;
    z-index: 1099 !important;
    top: calc(var(--gpc-retail-menu-top, 103px) - 2px) !important;
    right: 0 !important;
    left: 0 !important;
    display: none !important;
    width: 100vw !important;
    height: 14px !important;
    content: "";
    pointer-events: auto !important;
  }

  #header#header :is(#navigation, .menu-helper) .menu-level-1 > .menu-item-711:is(:hover, .exp, .gpc-mega-hold)::after {
    display: block !important;
  }
}

/*
 * Keep Shoptet's unmeasured desktop state out of view. Visibility preserves
 * layout dimensions, so the native overflow calculation remains unchanged.
 */
@media (min-width: 768px) and (max-width: 1799px) {
  #navigation:not(.visible) {
    visibility: hidden !important;
  }
}

/* Center every measured desktop menu only when all items fit. */
@media (min-width: 768px) {
  #navigation.fitted > .navigation-in > .menu-level-1 {
    justify-content: center !important;
  }
}

/*
 * From 1800px the full menu has enough reserved space beside the helper, so
 * it can be sized and centered correctly before Shoptet's first measurement.
 */
@media (min-width: 1800px) {
  #navigation:not(.visible) > .navigation-in {
    width: 100% !important;
  }

  #navigation:not(.visible) > .navigation-in > .menu-level-1 {
    flex-wrap: nowrap;
    justify-content: center !important;
  }
}

/* Fix Bootstrap clearfix pseudo-elements becoming items in checkout CSS Grid. */
@media (min-width: 768px) {
  body.ordering-process:is(.in-krok-1, .in-krok-2) .row.cart-row::before,
  body.ordering-process:is(.in-krok-1, .in-krok-2) .row.cart-row::after {
    display: none !important;
    content: none !important;
  }
}

/* Final checkout step: the CTA must never be clipped by the sticky summary. */
@media (min-width: 768px) {
  html body.desktop.ordering-process.in-krok-2 #checkoutSidebar > .cart-content {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html body.desktop.ordering-process.in-krok-2
    #checkoutSidebar .next-step--step-2 {
    display: flex !important;
    width: 100% !important;
    margin-top: 20px !important;
  }

  html body.desktop.ordering-process.in-krok-2 #checkoutSidebar #submit-order {
    display: flex !important;
    width: 100% !important;
    min-height: 58px !important;
  }
}

/* GamePC: compact, always-visible desktop header. */
@media (min-width: 768px) {
  /* Hide the desktop phone, opening-hours and email contact block. */
  html body .top-navigation-bar .top-navigation-contacts {
    display: none !important;
  }

  html body:not(.ordering-process) #header {
    position: sticky !important;
    top: 0 !important;
    z-index: 9 !important;
    width: 100% !important;
    background-color: #fff !important;
    transform: none !important;
  }

  /* Reduce only the white row while preserving the full-size header controls. */
  html body:not(.ordering-process) #header .header-top {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  /* Keep account/cart/search panels attached to the sticky header. */
  html body:not(.ordering-process).user-action-visible .popup-widget {
    position: fixed !important;
    top: var(--gpc-retail-menu-top, 122px) !important;
    z-index: 10 !important;
    max-height: calc(100dvh - var(--gpc-retail-menu-top, 122px) - 12px) !important;
  }
}

/* Keep focused surcharge cards below the sticky desktop header. */
@media (min-width: 768px) {
  body.type-detail .detail-parameters-block {
    isolation: isolate;
    z-index: 0;
  }
}

/* GamePC benefit cards — keep fully linked cards on the same two-column layout. */
:is(.position--benefitHomepage, .position--benefitCategory)
  > .benefitBanner__item
  > .benefitBanner__link:only-child {
  display: grid !important;
  grid-column: 1 / -1;
  grid-template-columns: 62px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 13px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  color: inherit !important;
  text-decoration: none !important;
}

@media (max-width: 767px) {
  :is(.position--benefitHomepage, .position--benefitCategory)
    > .benefitBanner__item
    > .benefitBanner__link:only-child {
    grid-template-columns: 52px minmax(0, 1fr) !important;
    gap: 10px !important;
  }
}

/* GamePC delivery timeline v2 — load after existing cart styles. */
.gpc-eta-v2,
.gpc-eta-v2 * {
  box-sizing: border-box;
}

.gpc-eta-v2 {
  --gpc-eta-ink: #24163b;
  --gpc-eta-muted: #716a7d;
  --gpc-eta-purple: #5818b8;
  --gpc-eta-purple-soft: #f2edfb;
  --gpc-eta-green: #438c50;
  --gpc-eta-green-soft: #edf8ee;
  --gpc-eta-line: #ded7ea;
  --gpc-eta-marker: 46px;
  --gpc-eta-gap: clamp(8px, 1.35vw, 20px);
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  padding: clamp(18px, 2.3vw, 28px) clamp(18px, 2.6vw, 34px);
  border: 1px solid var(--gpc-eta-line);
  border-radius: 20px;
  color: var(--gpc-eta-ink);
  background:
    radial-gradient(circle at 48% -25%, rgba(111, 65, 193, .10), transparent 44%),
    linear-gradient(112deg, #fbf9ff 0%, #f7f5fc 48%, #f1f9f2 100%);
  box-shadow:
    0 18px 45px rgba(53, 30, 91, .08),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  font-family: Nunito, Arial, sans-serif;
  text-align: left;
}

.gpc-eta-v2::after {
  position: absolute;
  z-index: -1;
  right: -90px;
  bottom: -125px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(116, 195, 126, .11);
  content: "";
  pointer-events: none;
}

body.in-kosik #cart-wrapper .delivery-time.gpc-eta-v2,
body.in-kosik #cart-wrapper .gpc-eta-v2-host {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: clamp(18px, 2.3vw, 28px) clamp(18px, 2.6vw, 34px) !important;
  overflow: hidden !important;
  border: 1px solid var(--gpc-eta-line) !important;
  border-radius: 20px !important;
  color: var(--gpc-eta-ink) !important;
  background:
    radial-gradient(circle at 48% -25%, rgba(111, 65, 193, .10), transparent 44%),
    linear-gradient(112deg, #fbf9ff 0%, #f7f5fc 48%, #f1f9f2 100%) !important;
  box-shadow:
    0 18px 45px rgba(53, 30, 91, .08),
    inset 0 1px 0 rgba(255, 255, 255, .9) !important;
  text-align: left !important;
}

body.in-kosik #cart-wrapper .delivery-time.gpc-eta-v2::before {
  display: none !important;
  content: none !important;
}

/* Remove the legacy Shoptet/cart card around the new self-contained card. */
body.in-kosik #cart-wrapper .cart-inner
  .text-center:has(> .delivery-time.gpc-eta-v2),
body.in-kosik #cart-wrapper
  .text-center:has(> .delivery-time.gpc-eta-v2) {
  width: 100% !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.gpc-eta-v2__list {
  display: grid;
  grid-template-columns:
    minmax(120px, .88fr)
    repeat(3, minmax(96px, 1fr))
    minmax(150px, .96fr);
  gap: var(--gpc-eta-gap);
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  align-items: center;
  list-style: none;
}

.gpc-eta-v2__item {
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gpc-eta-v2__item::before,
.gpc-eta-v2__item::after {
  box-sizing: border-box;
}

.gpc-eta-v2__item--date {
  position: relative;
  z-index: 2;
}

.gpc-eta-v2__date-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.gpc-eta-v2__item--end .gpc-eta-v2__date-copy {
  align-items: flex-end;
  padding: 13px 14px;
  border: 1px solid rgba(77, 146, 86, .18);
  border-radius: 13px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 7px 22px rgba(46, 92, 51, .06);
  text-align: right;
}

.gpc-eta-v2__eyebrow {
  display: block;
  color: var(--gpc-eta-muted);
  font-size: clamp(8.5px, .78vw, 10px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: .075em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gpc-eta-v2__date {
  display: block;
  color: var(--gpc-eta-ink);
  font-size: clamp(14px, 1.35vw, 17px);
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  line-height: 1.15;
  white-space: nowrap;
}

.gpc-eta-v2__item--end .gpc-eta-v2__date {
  color: var(--gpc-eta-green);
}

.gpc-eta-v2__item--stage {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.gpc-eta-v2__item--stage:not(.gpc-eta-v2__item--delivery)::after {
  position: absolute;
  z-index: -1;
  top: calc(var(--gpc-eta-marker) / 2 - 1px);
  left: calc(50% + var(--gpc-eta-marker) / 2);
  width: calc(100% + var(--gpc-eta-gap) - var(--gpc-eta-marker));
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6e31bc 0%, #8664c2 58%, #6a9e73 100%);
  content: "";
  opacity: .82;
}

.gpc-eta-v2__marker {
  display: grid;
  position: relative;
  z-index: 2;
  width: var(--gpc-eta-marker);
  height: var(--gpc-eta-marker);
  flex: 0 0 var(--gpc-eta-marker);
  place-items: center;
  border: 1px solid rgba(98, 54, 164, .20);
  border-radius: 13px;
  color: var(--gpc-eta-purple);
  background: rgba(255, 255, 255, .94);
  box-shadow:
    0 7px 18px rgba(69, 38, 117, .10),
    inset 0 0 0 3px rgba(244, 240, 251, .9);
}

.gpc-eta-v2__item--transport .gpc-eta-v2__marker {
  color: #6540ad;
}

.gpc-eta-v2__item--delivery .gpc-eta-v2__marker {
  border-color: rgba(65, 139, 77, .25);
  color: var(--gpc-eta-green);
  box-shadow:
    0 7px 18px rgba(49, 104, 58, .10),
    inset 0 0 0 3px rgba(238, 248, 239, .95);
}

.gpc-eta-v2__marker svg {
  display: block;
  width: 24px;
  height: 24px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gpc-eta-v2__stage-copy {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.gpc-eta-v2__label {
  display: block;
  max-width: 150px;
  color: var(--gpc-eta-ink);
  font-size: clamp(10.5px, 1vw, 12.5px);
  font-weight: 900;
  line-height: 1.24;
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: normal;
}

.gpc-eta-v2__meta {
  display: block;
  max-width: 100%;
  color: var(--gpc-eta-muted);
  font-size: clamp(8.5px, .76vw, 10.5px);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.gpc-eta-v2__stage-date {
  font: inherit;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gpc-eta-v2__sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

@media (min-width: 1100px) {
  .gpc-eta-v2__label {
    max-width: none;
    white-space: nowrap;
  }

  .gpc-eta-v2__meta {
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  .gpc-eta-v2,
  body.in-kosik #cart-wrapper .delivery-time.gpc-eta-v2,
  body.in-kosik #cart-wrapper .gpc-eta-v2-host {
    --gpc-eta-marker: 40px;
    padding: 15px !important;
    border-radius: 16px !important;
  }

  .gpc-eta-v2__list {
    display: block;
    position: relative;
  }

  .gpc-eta-v2__list::before {
    position: absolute;
    z-index: 0;
    top: 22px;
    bottom: 22px;
    left: 19px;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, #6e31bc 0%, #947bc2 56%, #4e9659 100%);
    content: "";
    opacity: .72;
  }

  .gpc-eta-v2__item {
    display: grid;
    position: relative;
    z-index: 1;
    grid-template-columns: var(--gpc-eta-marker) minmax(0, 1fr);
    gap: 12px;
    min-height: 62px;
    padding: 7px 0;
    align-items: center;
    text-align: left;
  }

  .gpc-eta-v2__item--stage {
    flex-direction: initial;
  }

  .gpc-eta-v2__item--stage::after {
    display: none !important;
    content: none !important;
  }

  .gpc-eta-v2__item--date::before {
    display: block;
    position: relative;
    z-index: 2;
    grid-column: 1;
    grid-row: 1;
    width: 12px;
    height: 12px;
    margin: auto;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--gpc-eta-purple);
    box-shadow: 0 0 0 1px rgba(91, 38, 176, .25);
    content: "";
  }

  .gpc-eta-v2__item--end::before {
    background: var(--gpc-eta-green);
    box-shadow: 0 0 0 1px rgba(65, 139, 77, .26);
  }

  .gpc-eta-v2__date-copy,
  .gpc-eta-v2__stage-copy {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    align-items: flex-start;
    text-align: left;
  }

  .gpc-eta-v2__item--end {
    margin-top: 7px;
  }

  .gpc-eta-v2__item--end .gpc-eta-v2__date-copy {
    align-items: flex-start;
    width: 100%;
    padding: 11px 13px;
    text-align: left;
  }

  .gpc-eta-v2__eyebrow {
    font-size: 9px;
    line-height: 1.25;
    white-space: normal;
  }

  .gpc-eta-v2__date {
    font-size: 15px;
  }

  .gpc-eta-v2__label {
    max-width: none;
    font-size: 12px;
    line-height: 1.28;
    text-align: left;
  }

  .gpc-eta-v2__meta {
    font-size: 10.5px;
    line-height: 1.32;
    text-align: left;
  }

  .gpc-eta-v2__marker {
    grid-column: 1;
    grid-row: 1;
    border-radius: 11px;
  }

  .gpc-eta-v2__marker svg {
    width: 21px;
    height: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gpc-eta-v2 *,
  .gpc-eta-v2 *::before,
  .gpc-eta-v2 *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

