/* Royal Smoke — layout: containers, header, footer, drawer, grids */

.rs-container {
  width: 100%;
  max-width: var(--rs-container);
  margin-inline: auto;
  padding-inline: var(--rs-pad-x);
}

.rs-section {
  padding-block: var(--rs-space-6);
}

.rs-section--alt {
  background: var(--rs-bark-light);
}

.rs-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--rs-space-4);
  margin-bottom: var(--rs-space-5);
}

.rs-section__title {
  color: var(--rs-seashell);
}

.rs-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.rs-grid-cats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.rs-site {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.rs-main {
  flex: 1 0 auto;
  width: 100%;
}

/* ——— Header ——— */
.rs-header {
  --rs-header-solid: 0;
  --rs-seashell: var(--rs-header-text);
  --rs-text-soft: color-mix(in srgb, var(--rs-header-text) 85%, transparent);
  --rs-text-muted: color-mix(in srgb, var(--rs-header-text) 60%, transparent);
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--rs-z-header);
  padding-top: var(--rs-safe-t);
  background: transparent;
  color: var(--rs-header-text);
}

/* Soft dark veil while over hero — fades out as solid fills in */
.rs-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(16, 13, 12, 0.72) 0%,
    rgba(16, 13, 12, 0.38) 45%,
    rgba(16, 13, 12, 0.1) 78%,
    rgba(16, 13, 12, 0) 100%
  );
  opacity: calc(1 - var(--rs-header-solid) * 0.92);
}

/* Solid fill — opacity driven by scroll (no binary jump) */
.rs-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--rs-header-bg);
  opacity: var(--rs-header-solid);
}

.rs-header__bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: var(--rs-header-h);
  padding-inline: var(--rs-pad-x);
  max-width: var(--rs-container);
  margin-inline: auto;
  gap: 8px;
}

/* Legacy class kept for non-home / JS fallback */
.rs-header.is-solid {
  background: transparent;
}

/* Внутрішні сторінки: хедер одразу непрозорий (колір шапки, не сторінки) */
body:not(.rs-home) .rs-header {
  --rs-header-solid: 1;
  background: var(--rs-header-bg);
  color: var(--rs-header-text);
}

body:not(.rs-home) .rs-header::before {
  display: none;
}

body:not(.rs-home) .rs-header::after {
  display: none;
}

body:not(.rs-home) .rs-main {
  padding-top: calc(var(--rs-header-h) + var(--rs-safe-t) + 1px);
}

.rs-header__primary {
  display: none;
}

.rs-header__tools {
  display: contents;
}

.rs-header__catalog {
  display: none;
}

/* Mobile / tablet: пошук | бренд | дії | бургер */
@media (max-width: 1023px) {
  .rs-header__bar {
    justify-content: space-between;
  }

  .rs-header__brand {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    margin-inline: auto;
  }

  .rs-header__search {
    order: 1;
    flex: 0 0 auto;
  }

  .rs-lang {
    order: 3;
  }

  .rs-header__action {
    order: 4;
    flex: 0 0 auto;
  }

  .rs-header__menu {
    order: 5;
    flex: 0 0 auto;
  }
}

@media (max-width: 389px) {
  .rs-header__brand {
    letter-spacing: 0.18em;
    font-size: 13px;
    max-width: 40%;
  }
}

@media (max-width: 767px) {
  .rs-header__brand {
    display: none;
  }

  .rs-header__search {
    margin-right: auto;
  }

  .rs-header__bar {
    gap: 0;
    padding-inline: max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-right, 0px));
  }

  .rs-header .rs-icon-btn {
    width: 40px;
    height: 40px;
  }
}

.rs-header__brand {
  position: relative;
  z-index: 2;
  font-family: var(--rs-font-display);
  font-weight: var(--rs-weight-sub);
  font-size: 15px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--rs-seashell);
  text-align: center;
  padding-left: 0.3em;
  white-space: nowrap;
  transform: translateZ(0);
  transition: color var(--rs-dur-fast) ease;
}

.rs-icon-btn {
  width: var(--rs-tap);
  height: var(--rs-tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rs-seashell);
  position: relative;
  flex-shrink: 0;
}

.rs-icon-btn svg {
  pointer-events: none;
}

.rs-header__tool-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: var(--rs-header-icon) center / contain no-repeat;
  mask: var(--rs-header-icon) center / contain no-repeat;
  pointer-events: none;
}

.rs-header__tool-icon--search {
  width: 1.125rem;
  height: 1.125rem;
}

.rs-header__nav {
  display: none;
  align-items: center;
  min-width: 0;
}

.rs-header__nav-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  height: auto;
  padding-inline: 0;
  max-width: none;
  margin-inline: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.rs-header__nav-inner::-webkit-scrollbar {
  display: none;
}

.rs-header__nav a {
  font-family: var(--rs-font-ui);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rs-text-soft);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
  transform: translateZ(0);
  transition: color var(--rs-dur-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
  .rs-header__brand:hover,
  .rs-header__nav a:hover,
  .rs-header__catalog:hover {
    color: var(--rs-gold);
  }

  .rs-header__catalog:hover {
    background: rgba(252, 242, 238, 0.12);
    border-color: rgba(252, 242, 238, 0.22);
  }
}

.rs-lang {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rs-text-muted);
}

.rs-lang__btn {
  display: inline;
  margin: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rs-lang__btn:hover,
.rs-lang__btn:focus-visible {
  color: var(--rs-seashell);
}

.rs-lang [aria-current="true"] {
  color: var(--rs-seashell);
  border-bottom: 1px solid var(--rs-gold);
  padding-bottom: 2px;
}

.rs-age-gate__langs .rs-lang {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--rs-text-muted);
}

/* ——— Drawer ——— */
@media (min-width: 768px) {
  .rs-section {
    padding-block: 72px;
  }

  .rs-grid-cats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .rs-lang {
    display: flex;
    gap: 12px;
    font-size: 13px;
    letter-spacing: 0.14em;
    font-weight: var(--rs-weight-ui);
    color: rgba(252, 242, 238, 0.62);
  }

  .rs-lang [aria-current="true"] {
    color: var(--rs-seashell);
    border-bottom-width: 2px;
    border-bottom-style: solid;
    border-bottom-color: var(--rs-gold);
    padding-bottom: 1px;
  }

  .rs-header__action svg,
  .rs-header__action .rs-header__tool-icon {
    width: 20px;
    height: 20px;
  }
}

@media (min-width: 1024px) {
  .rs-container {
    padding-inline: var(--rs-pad-x-lg);
  }

  .rs-section {
    padding-block: var(--rs-space-8);
  }

  .rs-header__menu {
    display: none;
  }

  .rs-header__bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-inline: var(--rs-pad-x-lg);
    min-height: 72px;
    gap: 20px;
  }

  .rs-header__brand {
    order: 0;
    flex: 0 0 auto;
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    margin-inline: 0;
    text-align: left;
    font-size: 17px;
    letter-spacing: 0.36em;
    padding-left: 0.36em;
  }

  .rs-header__primary {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .rs-header__catalog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(252, 242, 238, 0.14);
    background: rgba(252, 242, 238, 0.08);
    font-family: var(--rs-font-ui);
    font-weight: var(--rs-weight-ui);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rs-seashell);
    white-space: nowrap;
    transition:
      color var(--rs-dur-fast) ease,
      background var(--rs-dur-fast) ease,
      border-color var(--rs-dur-fast) ease;
  }

  .rs-header__catalog-chev {
    display: block;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    margin-top: -1px;
  }

  .rs-header__nav {
    display: flex;
    min-width: 0;
  }

  .rs-header__nav-inner {
    gap: 12px;
  }

  .rs-header__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .rs-lang {
    font-size: 13px;
    gap: 12px;
    margin-inline: 8px 4px;
  }

  .rs-header__action {
    width: 44px;
    height: 44px;
  }

  .rs-header__action svg,
  .rs-header__action .rs-header__tool-icon {
    width: 20px;
    height: 20px;
  }

  body:not(.rs-home) .rs-main {
    padding-top: calc(72px + var(--rs-safe-t) + 1px);
  }

  .rs-grid-2 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
  }

  .rs-grid-cats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
  }
}
