/* Two worlds switch «Elamused / Ilumaailm» (spec 2026-11-18-ilumaailm-maailmad §9.1, mock N variant 2).
   The track is a dark glass pill in every header (white page header, transparent over the hero, dark theme). */
.world-switch {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; padding: 4px; height: 40px; box-sizing: border-box;
  border-radius: 999px; background: #232323; border: 1px solid #050505;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 1px rgba(255, 255, 255, .04);
}
/* over a hero photo: dark glass, so the inactive side stays readable on light pictures too */
body.home-hero-page:not(.home-header-stuck) .world-switch,
body.offer-hero-page .world-switch {
  background: rgba(20, 20, 20, .55); -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
}
[data-bs-theme="dark"] .world-switch { background: rgba(255, 255, 255, .08); }
.world-switch__seg {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; box-sizing: border-box;
  padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 800; line-height: 1; white-space: nowrap;
  color: #BDBDBD; text-decoration: none; background: transparent; transition: color .15s ease, background-color .15s ease;
}
.world-switch__ico { display: inline-flex; color: #8E8E8E; }
a.world-switch__seg:hover, a.world-switch__seg:focus-visible { color: #fff; background: rgba(255, 255, 255, .06); }
a.world-switch__seg:hover .world-switch__ico { color: #fff; }
a.world-switch__seg:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.world-switch__seg.is-active { color: #fff; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(255, 255, 255, .35); }
.world-switch__seg.is-active .world-switch__ico { color: #fff; }
.world-switch__seg--elamused.is-active { background: linear-gradient(110deg, #18AE00 0%, #4CD964 100%); }
.world-switch__seg--ilumaailm.is-active { background: linear-gradient(110deg, #7B3FE4 0%, #C13BB0 48%, #F0528F 100%); }
.world-switch--compact { height: 44px; }
.world-switch--compact .world-switch__seg { height: 36px; padding: 0 clamp(7px, 2.6vw, 11px); font-size: clamp(12px, 3.4vw, 14px); }
/* A2: row 1 never wraps; nh-header.js steps down when the centred switch would touch the logo or the icons:
   nh-tight (smaller switch) → nh-noflag (flag to the account menu and footer) → nh-nofav → is-flow */
.nh-header.nh-tight .world-switch--compact .world-switch__seg { padding: 0 7px; font-size: 12px; letter-spacing: -.01em; }
.nh-header.nh-tight .world-switch--compact { gap: 0; padding: 3px; }

/* header placement: desktop beside the logo with a fading separator, phones centred in row 1;
   the language flag moves to the icons on the right (logo, switch, categories as in mock N) */
.nh-world { order: 2; flex: none; display: flex; align-items: center; }
.nh-header.nh-worlds .languages { order: 4 !important; }
.nh-world-sep { flex: 0 0 1px; width: 1px; height: 22px; margin: 0 4px 0 10px; background: linear-gradient(180deg, rgba(127, 127, 127, 0), rgba(127, 127, 127, .55), rgba(127, 127, 127, 0)); }
body.home-hero-page:not(.home-header-stuck) .nh-world-sep,
[data-bs-theme="dark"] .nh-world-sep { background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); }
.nh-world-mobile { display: none; }
@media (max-width: 991.98px) {
  .nh-world { display: none; }
  .nh-world-mobile { display: block; position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 2; }
  html:not(.has-app-bar) body.home-hero-page:not(.home-header-stuck) .nh-world-mobile { top: calc(14px + env(safe-area-inset-top, 0px)); }
  /* nh-header.js: when logo or icons would touch the centred switch it takes its place in the row instead */
  .nh-world-mobile.is-flow { position: static; transform: none; order: 2; margin: 0 auto; }
  /* the flag stays (8 languages) but slimmer, so the switch keeps the middle beside it and the search icon */
  .nh-header.nh-worlds .languages .dropdown-toggle { padding: 6px 4px; }
  .nh-header.nh-worlds .languages .dropdown-toggle::after { display: none; }
}
@media (max-width: 991.98px) {
  .nh-header.nh-noflag .languages { display: none !important; }
  .nh-header.nh-nofav .nh-fav { display: none !important; }
}

/* Ilumaailm «Brändid» menu in the category row (A to Z, long lists scroll) */
.nh-brands-btn { cursor: pointer; }
.nh-brands-menu { max-height: min(60vh, 480px); overflow-y: auto; min-width: 220px; }
.nh-brands-menu a { justify-content: space-between; }
.nh-brands-menu small { opacity: .55; font-weight: 600; }
.nh-header .category-nav-bar--ilu .category-nav-link { padding: 0 14px !important; }

/* section links «Ava Ilumaailm» (Elamused bridge rail) and «Vaata kõiki» (Ilumaailm rails) */
.shop-rail__open, .ilu-rail__all { font-size: 14px; font-weight: 600; color: inherit; opacity: .7; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.shop-rail__open:hover, .ilu-rail__all:hover { opacity: 1; color: inherit; }

/* D-180 (O11): Ilumaailm stock pill is black, red only at 3 or fewer (Helpers voucherQuantityFooterHtml); cards on any page */
.quantity-remaining.qty-pill--dark { background: #111 !important; color: #fff !important; }
[data-bs-theme="dark"] .quantity-remaining.qty-pill--dark { background: #F3E4EC !important; color: #3B1029 !important; }

/* C15: the phone category row runs edge to edge and fades out on the right instead of cutting a word (both worlds) */
@media (max-width: 991.98px) {
  .nh-header .category-nav-bar { flex-basis: calc(100% + 24px) !important; }
  .nh-header .category-nav-bar-track {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent 100%);
  }
}

/* C16: switching worlds fades softly (cross-document View Transitions; nh-header.js lets only the switch animate) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: ease; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* footer language row (the phone header may hide its flag) */
.footer-langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; padding: 14px 12px 6px; }
.footer-langs a, .footer-langs__on { color: var(--bs-secondary-color); text-decoration: none; font-weight: 600; letter-spacing: .04em; }
.footer-langs a:hover { color: var(--bs-body-color); text-decoration: underline; }
.footer-langs__on { color: var(--bs-body-color); font-weight: 800; }

/* lihviring 2 (12): at 360 px the page scrolled sideways (layout viewport 366, also on live before):
   one long footer heading word («Teenusepakkujatele», fi «Palveluntarjoajille») was wider than its half column */
.footer-main-grid > * { min-width: 0; }
.footer-nav-heading { overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
/* the collapsed header search never reaches past the screen edge (the field is hidden until the icon opens it) */
@media (min-width: 992px) {
  .nh-search:not(.open) .nh-searchbox { visibility: hidden; }
}
.nh-header.nh-worlds .nh-search:not(.open) .nh-searchbox { width: 0 !important; min-width: 0; visibility: hidden; }
.nh-header.nh-worlds .nh-search:not(.open) .nh-searchbox #search-input { padding-left: 0; padding-right: 0; }

/* lihviring 3 (3): on card pictures the stock pill is white (app.css, 0,4,0 !important); at 3 or fewer it is red like the
   offer page and the side column, on every Ilumaailm card (rails, category page, Uued) */
.quantity-remaining.qty-pill--urgent,
.listing-card .listing-card-media--deal .listing-card-media-meta .quantity-remaining.qty-pill--urgent,
.listing-card .listing-card-media-meta .quantity-remaining.qty-pill--urgent { background: #DC251E !important; color: #fff !important; }

/* GO LIVE 1 (lihviring 3, 7): the phone header of the worlds (O4) only where the worlds are on (header.nh-worlds, Chilli_World::enabled()).
   Everyone else keeps the live header (nh-header.css: the search field always open in row 1, the account icon). */
@media (max-width: 991.98px) {
  .nh-header.nh-worlds .languages { order: 3 !important; margin-left: auto; }
  .nh-header.nh-worlds .nh-tools { flex: none; margin-left: 0; }
  .nh-header.nh-worlds .nh-search, .nh-header.nh-worlds .nh-search.open { flex: none; min-width: 0; margin-left: 0; height: 40px; }
  .nh-header.nh-worlds .nh-search:not(.open),
  body.home-hero-page:not(.home-header-stuck) .nh-header.nh-worlds .nh-search:not(.open),
  body.offer-hero-page .nh-header.nh-worlds .nh-search:not(.open) {
    position: static; background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .nh-header.nh-worlds .nh-search::before { content: none; }
  .nh-header.nh-worlds .nh-search .nh-searchbox { width: 0; flex: none; }
  .nh-header.nh-worlds .nh-search .nh-search-toggle { display: inline-flex !important; }
  .nh-header.nh-worlds .nh-search:not(.open) .nh-search-close { display: none !important; }
  .nh-header.nh-worlds .nh-search.open,
  body.home-hero-page:not(.home-header-stuck) .nh-header.nh-worlds .nh-search.open,
  body.offer-hero-page .nh-header.nh-worlds .nh-search.open {
    position: absolute; left: 12px; right: 12px; top: 8px; z-index: 4; margin: 0;
    background: var(--bs-body-bg); color: var(--bs-body-color); border-color: var(--bs-border-color-translucent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .nh-header.nh-worlds .nh-search.open .nh-searchbox { width: auto; flex: 1 1 0; min-width: 0; }
  .nh-header.nh-worlds .nh-search.open .nh-search-close { display: inline-flex !important; }
  html:not(.has-app-bar) body.home-hero-page:not(.home-header-stuck) .nh-header.nh-worlds .nh-search.open { top: calc(16px + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 767.98px) {
  /* O4: the account is in the bottom bar on phones (tablets keep it, they have no bottom bar) */
  .nh-header.nh-worlds .nh-user { display: none !important; }
  html:not(.has-app-bar) body.offer-hero-page .nh-header.nh-worlds .nh-search.open { top: calc(16px + env(safe-area-inset-top, 0px)); }
}

/* lihviring 3 (5) + 3b (A): goods pictures are never cropped and leave no white holes: the tile shows the same picture
   blurred and covering (::before, --img from the markup), the picture itself contains on top. A packshot on white melts into
   its own white blur; a lifestyle picture gets a rim of its own colours. Every visitor, both worlds; Elamused keep cover. */
body.offer-goods :is(.offer-rail__tile:not(.offer-rail__tile--reel), .collage-item, .offer-gallery-grid .grid-item, .listing-gallery-slide) {
  position: relative; overflow: hidden; background: #fff !important; isolation: isolate;
}
body.offer-goods :is(.offer-rail__tile:not(.offer-rail__tile--reel), .collage-item, .offer-gallery-grid .grid-item, .listing-gallery-slide)::before {
  content: ""; position: absolute; inset: -32px; z-index: 0; pointer-events: none;
  /* stretched, not cover: the tile's rim is the picture's own rim (white on a packshot), not its blurred middle */
  background: var(--img) center / 100% 100% no-repeat; filter: blur(28px) saturate(1.1) brightness(.97);
}
body.offer-goods .offer-rail__tile:not(.offer-rail__tile--reel) img,
body.offer-goods .listing-gallery-slide img,
body.offer-goods .listing-gallery-main img.large,
body.offer-goods .offer-gallery-grid img,
body.offer-goods .listing-description .campaign-collage-gallery .collage-item img {
  position: relative; z-index: 1; object-fit: contain !important; background: transparent !important;
}
body.offer-goods .offer-rail__tile:not(.offer-rail__tile--reel) img,
body.offer-goods .listing-description .campaign-collage-gallery .collage-item img { position: absolute; }
body.offer-goods .offer-rail__tile:hover img { transform: none; }
