/* ========================================
   ?????? ??? ? style.css
   ======================================== */

/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* clip ?? ??????? scroll-container ? ?? ?????? position:fixed ?? iOS Safari */
  overflow-x: clip;
}

/* iOS Safari: fix border-radius clipping on elements with overflow */
.build-panel,
.popular-panel,
.product-card,
.slider,
.footer,
.advantages-card {
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  -webkit-backface-visibility: hidden;
}

body {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  min-height: 100vh;

  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  background: var(--gray-bg);
  color: var(--black);
  /* overflow-x ????? ?? html ? ??????????, ?? body ?? ?????? (?????? position:fixed ?? iOS) */
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* Mobile logo text (removed ? using SVG instead) */

/* ===== CSS VARIABLES ===== */
:root {
  --white: #FFFFFF;
  --black: #000000;
  --red: #FF0000;
  --red-btn: #E41616;
  --gray-text: #828282;
  --gray-sub: #848484;
  --gray-light: #F1F1F1;
  --gray-bg: #EDEDED;
  --gray-border: #EEEEEE;
  --dark: #181818;
  --separator: rgba(0, 0, 0, 0.04);
  --icon-stroke: #33363F;
}

/* =========================================
   HEADER
   ========================================= */
.header {
  position: sticky;
  top: 0;

  width: 100%;
  max-width: 1400px;
  padding: 12px 24px;
  
  display: flex; align-items: center; gap: 24px;

  background: var(--white);
  border-radius: 0 0 32px 32px;
  z-index: 100;
  
  -webkit-box-shadow: 0px 1px 0px 0px var(--gray-light);
  -moz-box-shadow: 0px 1px 0px 0px var(--gray-light);
  box-shadow: 0px 1px 0px 0px var(--gray-light);
}

.header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.header__logo img { height: 20px; width: auto; }

/* Fills space between logo and header actions */
.header__spacer {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  pointer-events: none;
}

.header__icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;

  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}

.header__icon-btn img {
  width: 32px;
  height: 32px;
}

/* ??????? ? ??????? */
.header__cart {
  position: relative;
  display: flex; align-items: center; flex-shrink: 0;
}

.header__cart-badge {
  position: absolute;
  top: -11px; right: -11px;
  width: 20px; height: 20px;
  
  display: flex; align-items: center; justify-content: center;
  
  border-radius: 50%;
  background: var(--red);
}

.header__cart-badge span {
  padding-left: 0.5px;
  color: var(--white); font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 900; font-size: 12px; line-height: 8px; text-align: center;
}

/* =========================================
   MESSENGER POPUP
   ========================================= */
.messenger-popup {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 120px;
  width: 320px;
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  z-index: 200;
  overflow: hidden;
  animation: popup-fade-in 0.2s ease;
}

.messenger-popup.open {
  display: block;
}

@keyframes popup-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.messenger-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}

.messenger-popup__title {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--black);
}

.messenger-popup__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-light);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--gray-text);
  transition: background 0.15s;
}



.messenger-popup__list {
  display: flex;
  flex-direction: column;
  padding: 4px 12px 16px;
}

.messenger-popup__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--black);
  transition: background 0.15s;
}



.messenger-popup__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.messenger-popup__name {
  flex: 1;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 500;
  font-size: 15px;
}

.messenger-popup__arrow {
  flex-shrink: 0;
  color: var(--gray-text);
}

@media (max-width: 768px) {
  .messenger-popup {
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* =========================================
   MAIN ? ???????? ???????
   ========================================= */
.main {
  display: flex; align-items: stretch; gap: 12px;

  width: 100%;
  max-width: 1400px;
  min-width: 0;

  margin: 0 auto;
  overflow-x: clip;
}

/* =========================================
   PANEL ? ????? ????? ???????
   ========================================= */
.panel {
  padding: 32px 24px;

  display: flex; flex-direction: column; gap: 16px;

  background: var(--white);
}

.panel__title {font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 700; font-size: 20px; line-height: 14px; color: var(--black);}

.panel__separator {width: 100%; height: 1px; background: var(--separator); flex-shrink: 0;}

/* =========================================
   SECTION ? ?????? ? ???????
   ========================================= */
.section {display: flex; flex-direction: column; gap: 12px;}

/* Group stack: multiple groups occupy the same grid cell.
   Inactive groups are transparent + non-interactive; active fade in. */
.group-stack {
  display: grid;
}
.group-stack > * {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  min-width: 0;
}
.group-stack > .is-active {
  opacity: 1;
  pointer-events: auto;
}

.section__label {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 400; font-size: 14px; line-height: 10px; color: var(--black);
  opacity: 0.64;
}

/* =========================================
   CHIPS ? ????? ?????/????????
   ========================================= */
/* --- Scroll-row ??????? ?? ????????? --- */
.scroll-row {
  position: relative;
  display: flex;
  align-items: center;
}

/* Always in DOM so ResizeObserver reads real dimensions.
   Visibility controlled via opacity / pointer-events, not display. */
.scroll-row__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.scroll-row__arrow img      { width: 20px; height: 20px; pointer-events: none; }
.scroll-row__arrow--left    { left: -8px; }
.scroll-row__arrow--right   { right: -8px; }
.scroll-row__arrow.visible  { opacity: 1; pointer-events: auto; }

.scroll-row__arrow:active   { transform: translateY(-50%) scale(0.96); }

/* =========================================
   SLIDING PILL ? ?????? ???????? ??? ??????????????
   ========================================= */
.sliding-pill {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: var(--pill-bg, var(--gray-bg));
  border-radius: var(--pill-radius, 12px);
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              top 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
}

.chips {
  display: flex; align-items: center; gap: 24px;
  padding: 8px 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 700; font-size: 16px; line-height: 11px; text-align: center; color: var(--black);
  touch-action: manipulation;

  white-space: nowrap;
  user-select: none;

  cursor: pointer;
  opacity: 0.24;
  transition: opacity 0.2s;
}



.chip.active {
  opacity: 1;
}


/* =========================================
   BUILD PANEL ? ???????? ??????
   ========================================= */
.build-panel {
  width: 540px;
  flex-shrink: 0;
  border-radius: 32px;
}

.build-panel form {
  display: flex; flex-direction: column; gap: 16px;
}

/* --- ???????? ????? --- */
.country-cards {
  display: flex; align-items: flex-start; gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.country-cards::-webkit-scrollbar { display: none; }

.country-card {
  width: 120px;
  min-width: 120px;
  padding: 12px;

  display: flex; flex-direction: column; align-items: center; gap: 8px;

  border-radius: 24px;

  cursor: pointer;
  transition: background 0.2s;
}

.country-card.active {
  background: transparent;
}

/* Sliding pill: ???????? ?????? ??? */
.country-cards[data-sliding-pill] {
  --pill-bg: var(--gray-bg);
  --pill-radius: 24px;
}

.country-card:not(.active) .country-card__name {
  opacity: 0.42;
}

.country-card:not(.active) .country-card__icon {
  opacity: 0.42;
}

.country-card__icon {
  width: 90px;
  height: 90px;
  object-fit: contain;
  flex-shrink: 0;
}

.country-card__info {
  width: 100%;
  display: flex; flex-direction: column; gap: 6px;
}

/*
 * Hint slot: ?????? ??? ???????? ???????. ?????? = 0px (??? ?????? ??? ??? ????????).
 * ????? sliding-pill ????? height ? ???????? ???????? (slidingPill.js); ??? ?????????
 * ?????? ?????? ???????? ?????? ? ? .sliding-pill ??? ???? transition: height.
 */
.country-card__hint-slot {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 0;
}

.country-card__hint-slot:empty {
  display: none;
  margin: 0;
  padding: 0;
  height: 0;
  min-height: 0;
}

.country-card__name {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 500; font-size: 14px; line-height: 10px; color: var(--black);
  transition: opacity 0.2s;
}

.country-card__price {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 700; font-size: 16px; line-height: 11px;
  color: var(--black);
}

.discount-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  margin-top: 2px;
  padding: 3px 5px;
  background: linear-gradient(135deg, #E41616 0%, #ff5c5c 100%);
  color: #fff;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  border-radius: 6px;
  box-sizing: border-box;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.28s;
}

.discount-hint--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --- ??????? ?????????? --- */
.counter {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;

  background: var(--gray-bg);
  border-radius: 32px;

  overflow: hidden;
}

.counter__btn {
  padding: 0 16px;
  height: 48px;

  display: flex; justify-content: center; align-items: center;

  background: var(--gray-bg);
  border: none;
  border-radius: 12px;

  transition: background 0.15s;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}



.counter__btn img {width: 24px; height: 24px;}

.counter__input {
  width: 60px; border: none; outline: none; background: transparent;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 600; font-size: 16px;
  line-height: 11px; text-align: center; color: var(--black);
  -moz-appearance: textfield; appearance: textfield;
  touch-action: manipulation;
}
.counter__input::-webkit-outer-spin-button,
.counter__input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* --- ???????? ???????? --- */
.packaging-cards {
  display: flex;
  border-radius: 24px;
  overflow: hidden;
}

.packaging-card {
  padding: 8px 12px;
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 24px;
}

.packaging-card.active {
  background: transparent;
}

/* Sliding pill: ??? ???????? */
.packaging-cards[data-sliding-pill] {
  --pill-bg: var(--gray-bg);
  --pill-radius: 24px;
}

.packaging-card:not(.active) .packaging-card__img {
  opacity: 0.42;
}

.packaging-card:not(.active) .packaging-card__name {
  opacity: 0.42;
}

.packaging-card__img {
  width: 80px; height: 80px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.packaging-card__info {
  flex: 1; display: flex; flex-direction: column; gap: 6px;
}

.packaging-card__name {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 500; font-size: 14px; line-height: 10px; text-align: center; color: var(--black);
  transition: opacity 0.2s;
}

.packaging-card__price {font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 700; font-size: 16px; line-height: 11px; text-align: center; color: var(--black);}

/* --- ?????? ?????????? --- */
.order-btn {
  width: 100%; height: 50px; min-height: 50px;
  display: flex; justify-content: center; align-items: center; gap: 8px;
  background: var(--red-btn);
  border-radius: 18px;
  transition: background 0.15s;
  touch-action: manipulation;
}



.order-btn__text,
.order-btn__price {font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 600; font-size: 17px; line-height: 1; text-align: center; color: var(--white);}

.order-btn__old-price {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 14px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: line-through;
  margin-left: 4px;
}

/* =========================================
   POPULAR PANEL ? ????????????
   ========================================= */
.popular-panel {
  flex: 1;
  width: 100%;
  min-width: 0;
  border-radius: 32px;
}

/* --- ????? ??????? --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* --- ???????? ?????? --- */
.product-card {
  display: flex; flex-direction: column;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 24px;
  overflow: hidden;
  transition: box-shadow 0.2s;
  cursor: pointer;
}



/* ???? ??????????? */
.product-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--gray-light);
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ????? ?????? */
.product-card__badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 8px;
  background: var(--red);
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  color: var(--white);
  z-index: 2;
}

/* ???? ???????? ? ???????? ? ??????? */
.product-card__body {
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: 12px;
}

.product-card__title {font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 600; font-size: 16px; line-height: 11px; color: var(--black);}

.product-card__subtitle {font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 400; font-size: 14px; line-height: 10px; color: var(--gray-sub);}

/* ?????? ???????? ? ?????? ??????? */
.product-card__footer {
  display: flex; flex-direction: column;
  padding: 12px;
  margin-top: auto;
}

.product-card__buy-btn {
  width: 100%;
  height: 64px;
  touch-action: manipulation;
  display: flex; justify-content: center; align-items: center; gap: 8px;
  background: var(--red);
  border-radius: 24px;
  transition: background 0.15s;
}



.product-card__buy-btn img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.product-card__prices {display: flex; flex-direction: column; align-items: flex-start; gap: 6px;}

.product-card__current-price {font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 600; font-size: 20px; line-height: 14px; color: var(--white);}

.product-card__old-price {font-family: 'Plus Jakarta Sans', 'Onest', sans-serif; font-weight: 400; font-size: 16px; line-height: 11px; color: var(--white); text-decoration: line-through;}

/* =========================================
   PROMO PANEL ? ???????????? + ???????
   ========================================= */
.promo-panel {
  flex: 1;
  min-width: 0;
  border-radius: 32px;
  gap: 16px;
  overflow: hidden;
}

/* --- ???????????? --- */
.advantages {
  display: flex;
  gap: 12px;
}

.advantage-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--gray-light);
  border-radius: 24px;
  min-width: 0;
}

.advantage-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 16px;
  flex-shrink: 0;
}

.advantage-card__icon svg {
  width: 24px;
  height: 24px;
}

.advantage-card__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.advantage-card__title {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  color: var(--black);
}

.advantage-card__desc {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.3;
  color: var(--gray-text);
}

/* --- ??????? --- */
.promo-slider {
  position: relative;
  flex: 1;
  min-height: 220px;
  border-radius: 32px;
  overflow: hidden;
}

.promo-slider__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.promo-slider__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.promo-slider__slide.active {
  opacity: 1;
  pointer-events: auto;
}

.promo-slider__slide::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.45) 40%, transparent 75%);
  pointer-events: none;
}

.promo-slider__content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 55%;
  z-index: 3;
}

.promo-slider__tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 32px;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
}

.promo-slider__title {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.15;
  color: var(--white);
}

.promo-slider__desc {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.75);
}

.promo-slider__desc strong {
  color: var(--white);
  font-weight: 700;
}

.promo-slider__btn {
  display: inline-flex;
  align-self: flex-start;
  padding: 14px 28px;
  background: var(--white);
  border-radius: 16px;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--black);
  transition: background 0.2s, transform 0.2s;
  margin-top: 4px;
}



.promo-slider__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.promo-slider__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}

/* ??????? ???????? */
.promo-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}



.promo-slider__arrow img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.promo-slider__arrow--left { left: 24px; }
.promo-slider__arrow--right { right: 24px; }

/* ????? ???????? */
.promo-slider__dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.promo-slider__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: background 0.25s, width 0.25s;
}

.promo-slider__dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--white);
}

/* =========================================
   POPULAR SECTION ? ???? ??????? ???? main
   ========================================= */
.popular-section {
  width: 100%;
  max-width: 1400px;
  overflow-x: clip;
}

.popular-section .popular-panel {
  width: 100%;
  border-radius: 32px;
}

.popular-section .products-grid {
  grid-template-columns: repeat(5, 1fr);
}

/* =========================================
   FILTERS BAR ? ??????? ????? ???????
   ========================================= */
.filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.filter-group--collections {
  flex: 1;
  min-width: 0;
  flex-shrink: 1;
}

.filter-group__label {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 10px;
  color: var(--black);
  opacity: 0.64;
}

/* --- ?????????? ?????? ??????? --- */
.filter-dropdown {
  position: relative;
  min-width: 120px;
}

.filter-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 18px;
  background: var(--gray-light);
  border-radius: 16px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  width: 100%;
}



.filter-dropdown__swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-dropdown__value {
  flex: 1;
  text-align: left;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-dropdown__arrow {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.filter-dropdown.open .filter-dropdown__arrow {
  transform: rotate(180deg);
}

.filter-dropdown__list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 50;
  flex-direction: column;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filter-dropdown__list::-webkit-scrollbar { display: none; }

.filter-dropdown.open .filter-dropdown__list {
  display: flex;
}

.filter-dropdown__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: var(--black);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}



.filter-dropdown__option.selected {
  font-weight: 600;
  background: var(--gray-light);
}

.filter-dropdown__opt-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- ?????-?????? (????????) --- */
.filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.filter-chips::-webkit-scrollbar { display: none; }

.filter-chip {
  height: 48px;
  padding: 0 20px;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-light);
  border-radius: 16px;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--black);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border: none;
  flex-shrink: 0;
}



.filter-chip.active {
  background: var(--dark);
  color: var(--white);
}

/* --- ??????? ???????? --- */
.price-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-range__input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  background: var(--gray-light);
  border-radius: 16px;
  padding: 0 16px;
}

.price-range__prefix {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--gray-text);
  flex-shrink: 0;
}

.price-range__input {
  width: 70px;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--black);
  -moz-appearance: textfield;
  appearance: textfield;
}
.price-range__input::-webkit-outer-spin-button,
.price-range__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.price-range__input::placeholder {
  color: var(--gray-text);
  font-weight: 400;
}

.price-range__currency {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--gray-text);
  flex-shrink: 0;
}

.price-range__dash {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-size: 15px;
  color: var(--gray-text);
  flex-shrink: 0;
}

/* =========================================
   FOOTER ? ?????? ????????
   ========================================= */
.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  padding: 16px 32px;
  width: 100%;
  max-width: 1400px;
  background: var(--dark);
  border-radius: 32px 32px 0 0;
  flex-wrap: wrap;
  margin-top: auto;
}

.footer__link {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.275;
  color: var(--white);
  transition: opacity 0.2s;
}



/* =========================================
   MOBILE TAB BAR + STICKY ORDER BAR (desktop: hidden)
   ========================================= */
.mobile-tab-bar {
  display: none;
}

.mobile-order-bar {
  display: none;
}

/* Mobile panel wrappers ? transparent to layout on desktop */
.mobile-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Tab bar: always full-width regardless of body align-items:center */
.mobile-tab-bar {
  align-self: stretch;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 1280px) {
  .build-panel {
    width: 440px;
  }

  .popular-section .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .promo-slider__title {
    font-size: 22px;
  }
}

@media (max-width: 1024px) {
  .main {
    flex-direction: column;
  }

  .build-panel {
    width: 100%;
    border-radius: 32px;
  }

  .promo-panel {
    display: none;
  }

  .popular-panel {
    border-radius: 32px;
  }

  .popular-section .popular-panel {
    border-radius: 32px;
  }

  .popular-section .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .filters-bar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .filter-group {
    flex-shrink: 0;
  }

  .filter-group--collections {
    width: 100%;
    flex: unset;
  }
}

@media (max-width: 768px) {
  body {
    gap: 0px;
    background-color: #FFFFFF;
    /* Extra padding so sticky bar doesn't overlap content */
    padding-bottom: 88px;
  }

  /* Footer: hidden on mobile everywhere except profile page */
  .footer {
    display: none !important;
  }
  .page-profile .footer {
    display: flex !important;
  }
  
  /* ===== HEADER ? pixel-perfect per Figma Frame 495 ===== */
  /* Frame 495: row, alignItems center, gap 12px, padding 12px, border-bottom 1px #F5F5F5 */
  .header {
    gap: 12px;
    padding: 12px;
    border-radius: 0;
    border-bottom: 1px solid #F5F5F5;
    box-shadow: none;
  }


  /* Icons: 36x36 per Figma (layout_1VKCYH) */
  .header__icon-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .header__icon-btn img {
    width: 36px;
    height: 36px;
  }

  /* Cart container: 36x36 (layout_L1PNKP) */
  .header__cart {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  /* Badge: 22x22, absolute x:25 y:-11, border-radius 15px */
  .header__cart-badge {
    top: -11px;
    right: -11px;
    width: 22px;
    height: 22px;
    border-radius: 15px;
    border: 2px solid var(--white);
  }

  .panel {
    padding: 12px;
  }

  /* Hide "??????? ?????" title on mobile ? it's in the tab switcher */
  .build-panel .panel__title {
    display: none;
  }

  /* Hide separator before panel title on mobile */
  .build-panel .panel__separator:first-of-type {
    display: none;
  }

  /* Constructor sections: remove separators between them */
  .build-panel .panel__separator {
    display: none;
  }

  /* Constructor form: match Figma gap */
  .build-panel form {
    gap: 18px;
  }

  /* No border radius on build-panel on mobile ? full width */
  .build-panel {
    border-radius: 0 !important;
  }

  .popular-section .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel__title {font-size: 18px; line-height: 13px;}

  /* ??????? ? ????????? ??????????? */
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filter-group {
    width: 100%;
    flex-shrink: 0;
  }

  .filter-group--collections {
    flex: unset;
  }

  .price-range {
    width: 100%;
  }

  .price-range__input-wrap {
    flex: 1;
  }

  .price-range__input {
    width: 100%;
    min-width: 0;
  }

  .filter-dropdown {min-width: 0;}

  /* ===== MOBILE TAB SWITCHER ? pixel-perfect per Figma Frame 864 ===== */
  /* Frame 864: column, alignItems stretch, padding 12px, gap 10px, bg #FFF, borderRadius 0 0 24px 24px */
  .mobile-tab-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;              /* CRITICAL: must be full width */
    padding: 12px;
    background: var(--white);
    border-radius: 0 0 24px 24px;
  }

  /* Frame 862: row, justifyContent stretch, alignItems stretch, gap 10px, padding 6px, bg #F1F1F1, borderRadius 100px */
  .mobile-tab-track {
    display: flex;
    justify-content: stretch;
    align-items: stretch;
    gap: 10px;
    padding: 6px;
    background: #F1F1F1;
    border-radius: 100px;
    width: 100%;
    height: 60px;
  }

  /* Frame 863 (tab): row, justifyContent center, alignItems center, fill width + fill height */
  /* Active: bg #FFF, borderRadius 32px. Inactive: transparent, color #5C5C5C */
  /* Text: Google Sans 700 20px */
  .mobile-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 14px;
    color: #5C5C5C;
    background: transparent;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
  }

  .mobile-tab.active {
    background: transparent;
    color: var(--black);
  }

  /* Sliding pill: ???? ??????? ????? / ??????? */
  .mobile-tab-track[data-sliding-pill] {
    --pill-bg: var(--white);
    --pill-radius: 32px;
  }

  /* ===== MOBILE PANELS (tab content) ===== */
  .mobile-panel {
    width: 100%;
  }

  .mobile-panel--hidden {
    display: none !important;
  }

  /* On mobile, build-panel inside tab should fill width */
  .mobile-panel .main {
    padding: 0;
  }

  .mobile-panel .build-panel {
    width: 100%;
    border-radius: 0;
    padding-bottom: 12px;
  }

  /* Hide inline order button on mobile (replaced by sticky bar) */
  .order-btn--inline-mobile {
    display: none;
  }

  /* Quantity counter ? Figma height 60px */
  .counter {
    height: 60px;
  }
  .counter__btn {
    width: 60px;
    height: 100%;
    border-radius: 100px;
  }

  /* ===== MOBILE STICKY ORDER BAR ===== */
  .mobile-order-bar {
    display: none; /* hidden on desktop */
  }

  /* ===== ????????????? ?????? ???? ??????? ?? ?????? ===== */
  /* ??? .panel ? ??? ????????, ?? ??? ?????? */
  .panel {
    border-radius: 0 !important;
    width: 100% !important;
  }

  /* .main ? ??????? gap ????? ???????? */
  .main {
    gap: 0 !important;
    padding: 0 !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  /* ??? page-main ??????? ? ??? gap */
  .cart-main,
  .checkout-main {
    gap: 0 !important;
    padding: 0 !important;
  }

  /* ???????? ??????? ? ??????????: ????????? ??????????? ????? ???????? */
  .cart-items-panel,
  .checkout-form-panel {
    border-radius: 0 !important;
    border-bottom: 1px solid #F5F5F5;
  }

  .cart-summary,
  .checkout-summary {
    border-radius: 0 !important;
  }

  /* ?????? ???????? ???? ? ???????, ?????? ??????, 60px */
  .checkout-submit-btn,
  .cart-checkout-btn {
    height: 60px !important;
    border-radius: 100px !important;
    font-size: 18px !important;
  }
}

/* Mobile sticky bar ? only shown by JS when on mobile */
@media (max-width: 768px) {
  /* Figma Frame 865: row, padding 12px, gap 8px, bg white, shadow, radius 32px top */
  .mobile-order-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--white);
    border-radius: 32px 32px 0 0;
    box-shadow: 0px -2px 16px 0px rgba(0, 0, 0, 0.12);
    padding: 12px;
  }

  .mobile-order-bar.hidden {
    display: none;
  }

  /* Figma Frame 522: round X button 60?60, bg #EDEDED ? slides in from left */
  .mobile-clear-btn {
    width: 0;
    min-width: 0;
    height: 60px;
    border-radius: 100px;
    background: #EDEDED;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-clear-btn.visible {
    width: 60px;
    min-width: 60px;
  }

  .mobile-clear-btn svg {
    flex-shrink: 0;
    pointer-events: none;
  }

  /* Figma Frame 523: red order button, height 60px, fills remaining space */
  .mobile-order-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    background: #E41616;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, flex 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    padding: 0 20px;
  }

  

  /* Two-row content layout inside button */
  .mobile-order-btn__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  .mobile-order-btn__row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-order-btn__text,
  .mobile-order-btn__price {
    font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.25;
    color: var(--white);
    white-space: nowrap;
  }

  .mobile-order-btn__subtext {
    font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.70);
    white-space: nowrap;
  }

  .mobile-order-btn__old-price {
    font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: line-through;
    white-space: nowrap;
  }

  /* Hide tab bar on desktop */
  .mobile-tab-bar {
    display: flex;
  }
}

@media (max-width: 480px) {
  .popular-section .products-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

@media (max-width: 420px) {
  .packaging-card__img {width: 64px; height: 64px;}
}

/* ========================================
   GLOBAL MESSAGES (toast)
   ======================================== */
.global-messages {
  position: fixed;
  top: 100px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}

.global-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 16px;
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  animation: msg-slide-in 0.3s ease;
}

@keyframes msg-slide-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.global-message--success {
  background: #E8F5E9;
  color: #2E7D32;
}

.global-message--error {
  background: #FFEBEE;
  color: #C62828;
}

.global-message--warning {
  background: #FFF3E0;
  color: #E65100;
}

.global-message--info {
  background: #E3F2FD;
  color: #1565C0;
}

.global-message__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.08);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: inherit;
  line-height: 1;
}



@media (max-width: 768px) {
  .global-messages {
    top: 80px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}

/* ===== Consent checkbox ===== */
.consent-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 4px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.consent-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.consent-check__box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 6px;
  background: #fff;
  transition: all 0.15s;
  position: relative;
  margin-top: 1px;
}
.consent-check input:checked + .consent-check__box {
  background: var(--red-btn, #e53935);
  border-color: var(--red-btn, #e53935);
}
.consent-check input:checked + .consent-check__box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.consent-check input:focus-visible + .consent-check__box {
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.3);
}
.consent-check input:invalid + .consent-check__box {
  animation: none;
}
.consent-check.shake .consent-check__box {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.25);
  animation: consent-shake 0.4s ease;
}
.consent-check.shake .consent-check__text {
  color: #e53935;
}
@keyframes consent-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.consent-check__text {
  font-family: 'Plus Jakarta Sans', 'Onest', sans-serif;
  font-size: 14px;
  line-height: 10px;
  color: #999;
}
.consent-link {
  color: #999;
  text-decoration: underline;
  transition: color 0.15s;
}

/* HOVER: pointer devices only; touch does not keep :hover after tap. */
@media (hover: hover) {
  .messenger-popup__close:hover  { background: #e0e0e0; }
  .messenger-popup__item:hover   { background: var(--gray-light); }

  .scroll-row__arrow:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.20); transform: translateY(-50%) scale(1.06); }

  .chip:hover { opacity: 0.64; }

  .counter__btn:hover { background: #e0e0e0; }

  .order-btn:hover { background: #c91212; }

  .product-card:hover          { box-shadow: 0 4px 20px rgba(0,0,0,0.16); }
  .product-card__buy-btn:hover { background: #dd0000; }

  .promo-slider__btn:hover   { background: var(--gray-light); transform: translateY(-1px); }
  .promo-slider__arrow:hover { background: rgba(255,255,255,0.3); }

  .filter-dropdown__trigger:hover { background: #e4e4e4; }
  .filter-dropdown__option:hover  { background: var(--gray-light); }
  .filter-chip:hover              { background: #e0e0e0; }

  .footer__link:hover { opacity: 0.7; }

  .global-message__close:hover { background: rgba(0,0,0,0.15); }
  .consent-link:hover          { color: var(--black); }
}

@media (hover: hover) and (max-width: 768px) {
  .mobile-order-btn:hover { background: #c91212; }
}
