/* ===========================
   HEADER / BRAND / NAV / CATS
   =========================== */

/* Хедер целиком */
.site-header{
  position:sticky;
  top:0;
  left:0;
  right:0;
  z-index:1000;
  background:var(--bg-white);
  box-shadow:0 1px 0 rgba(0,0,0,.06);
}

/* Внутренний контейнер хедера — тот же паддинг, что у контента и cats */
.site-header .sp-container{
  max-width:70%;
  margin-inline:auto;
  padding-inline:var(--container-pad);
}


/* Основная строка: бургер — лого — поиск */
.header-row{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:16px;
  padding:12px 0;
}
.header-row > *{
  min-width:0;
}

/* Лого по центру */
.brand{
  justify-self:center;
}
.brand img{
  display:block;
  height:auto;
}


/* Рубрики под хедером */
.header-cats{
  background:var(--bg-white);
  border-top:1px solid rgba(85, 35, 2, 0.12);
}
.header-cats.is-hidden{
  height:0;
  overflow:hidden;
  opacity:0;
}
@media (max-width:768px){
  .header-cats{ display:none; }
}

.header-cats .sp-container{
  max-width: 70%;
  margin-inline:auto;
  padding-inline:var(--container-pad); /* как у всего контента */
}

/* Линия рубрик */
.cats{
  display:flex;
  flex-wrap:nowrap;
  justify-content:space-between;
  align-items:center;
  gap:48px;
  padding:10px 0;              /* <-- было 10px var(--container-pad) */
  color:#1E1E1E;
  list-style:none;
  overflow-x:auto;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
  margin:0;
  width:100%;
}
.cats::-webkit-scrollbar{ display:none; }

@media (max-width:1200px){
  .cats{ gap:32px; }
}
@media (max-width:1040px){
  .cats{ gap:24px; }
}

/* Пункты рубрик */
.cats__item{
  position:relative;
}


.cats__link{
  position:relative;
  display:inline-flex;
  align-items:center;
  font-family:"Source Sans 3",sans-serif;
  font-weight:300;
  font-size:clamp(9px,1.1vw,12px);
  opacity:.7;
  color:#1E1E1E;

  white-space: nowrap;        /* ⬅️ ГЛАВНОЕ */
  word-break: keep-all;       /* ⬅️ запрещаем разрывы слов */
  hyphens: none;              /* ⬅️ убираем авто-перенос */
}


/* Подчёркивание */
.cats__underline{
  position:absolute;
  left:0;
  right:0;
  bottom:2px;
  height:1px;
  background:currentColor;
  opacity:.85;
  transform:scaleX(0);
  transform-origin:left center;
  transition:transform .25s ease;
  pointer-events:none;
  margin:0;
}

/* hover — всегда показать */
.cats__link:hover .cats__underline{
  transform:scaleX(1);
}

/* Активная рубрика: по умолчанию скрыто */
.cats__item--active .cats__underline{
  transform:scaleX(0);
}

/* Активная рубрика только в дефолтном состоянии хедера (вверху страницы) */
.header-cats--at-top .cats__item--active .cats__underline{
  transform:scaleX(1);
}

/* Когда открыто меню — блокируем скролл и прячем рубрики */
html.sp-lock,
body.sp-lock{
  overflow:hidden !important;
}
html.menu-open{
  overflow:hidden;
}
.menu-open .header-cats{
  display:none !important;
}

/* ===========================
   FULLSCREEN MODAL (бургер)
   =========================== */

.sp-modal[hidden]{ display:none; }

.sp-modal{
  position:fixed;
  inset:0;
  z-index:3000;
  display:grid;
  grid-template-rows:auto 1fr;
  background:#fff;
  opacity:0;
  pointer-events:none;
  transform:translateY(-12px);
  transition:opacity .25s ease, transform .25s ease;
}
.sp-modal.is-open{
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
}

/* Верхняя полоса с крестиком */
.sp-modal__bar{
  display:flex;
  justify-content:flex-end;
  padding:16px clamp(16px,4vw,56px);
}
.sp-modal__close{
  font-size:28px;
  line-height:1;
  border:0;
  background:transparent;
  cursor:pointer;
  color:#c39662;
  padding:4px 8px;
}
.sp-modal__close:hover{
  opacity:.7;
}

/* Контент модалки */
.sp-modal__inner{
  padding:0 clamp(16px,4vw,56px) clamp(24px,5vw,72px);
}

/* 3-колоночная сетка в модалке */
.sp-modal__grid{
  width:100vw;
  max-width:100vw;
  margin-left:calc(-1 * clamp(16px,4vw,56px));
  margin-right:calc(-1 * clamp(16px,4vw,56px));
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:40px;
  background:#fff;
  padding:40px clamp(16px,4vw,56px);
  border-top:1px solid rgba(187,140,85,.35);
  border-bottom:1px solid rgba(187,140,85,.35);
}
@media (max-width:980px){
  .sp-modal__grid{
    grid-template-columns:1fr;
    margin-left:0;
    margin-right:0;
    width:100%;
    max-width:100%;
    padding:28px 0;
  }
}

/* Левый столбец */
.sp-m-left{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.sp-m-left a{
  font:300 13px/18px "Source Sans 3",sans-serif;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#7c6e60;
}
.sp-m-left a:hover{
  color:#c39662;
}

/* Центральные рубрики */
.sp-m-cats{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.sp-m-big{
  position:relative;
  display:block;
  font-family:"Playfair Display",serif;
  color:#c39662;
  font-size:clamp(18px,2.2vw,28px);
  letter-spacing:.02em;
  padding:0px 0;
}
.sp-m-big:after{
  content:"";
  position:absolute;
  left:0; right:0;
  bottom:-6px;
  height:0;
  border-bottom:1.5px solid rgba(195,150,98,.55);
  transform: translateZ(0); /* чуть стабилизирует рендер */
}

.sp-m-cats li:last-child .sp-m-big:after{
  display:none;
}

/* Правый столбец */
.sp-m-right{
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:flex-end;
}
.sp-m-right .lbl{
  font:300 12px/16px "Source Sans 3",sans-serif;
  color:#7c6e60;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.sp-m-right .phone{
  font-family:"Playfair Display",serif;
  color:#c39662;
  font-size:18px;
}
.sp-m-right .mail{
  color:#7c6e60;
  text-decoration:underline;
}
@media (max-width:980px){
  .sp-m-right{ align-items:flex-start; }
}

/* ===========================
   FULLSCREEN SEARCH
   =========================== */

.sp-search[hidden]{ display:none; }

.sp-search{
  position:fixed;
  inset:0;
  z-index:3500;
  background:#fff;
  display:grid;
  grid-template-rows:auto 1fr;
  opacity:0;
  pointer-events:none;
  transform:translateY(-20px);
  transition:opacity .3s ease, transform .3s ease;
}
.sp-search.is-open{
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
}

/* Верхняя панель с крестиком */
.sp-search__bar{
  display:flex;
  justify-content:flex-end;
  padding:20px clamp(20px,5vw,64px);
}
.sp-search__close{
  width:40px;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  border:0;
  cursor:pointer;
  transition:opacity .2s ease;
}
.sp-search__close:hover{
  opacity:.6;
}
.sp-search__close svg{
  width:24px;
  height:24px;
}
.sp-search__close line{
  stroke:#c39662;
  stroke-width:1.6;
}

/* Центральная часть поиска */
.sp-search__inner{
  background:#fff;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding:40px 0 60px;
}
.search-center{
  max-width:720px;
  width:100%;
  padding:0 clamp(20px,5vw,80px);
}

/* Заголовок поиска */
.search-title{
  font-family:"Playfair Display",serif;
  font-size:clamp(26px,3vw,40px);
  font-weight:400;
  color:#c39662;
  margin-bottom:32px;
}

/* Форма */
.search-form{
  margin:0 0 32px 0;
}
.search-line{
  display:flex;
  align-items:center;
  padding-bottom:10px;
  border-bottom:2px solid #BB8C55;
}
.sp-search .search-input{
  flex:1;
  width:auto;
  border:0 !important;
  background:transparent !important;
  padding:6px 0 !important;
  outline:0;
  box-shadow:none;
  font-size:18px;
  font-family:"Source Sans 3",sans-serif;
  color:#1e1e1e;
}
.sp-search .search-input::placeholder{
  color:rgba(30,30,30,.45);
}
.sp-search .search-input::-webkit-search-decoration,
.sp-search .search-input::-webkit-search-cancel-button{
  -webkit-appearance:none;
}

/* Кнопка-лупа */
.search-submit{
  background:transparent;
  border:0;
  padding:0 4px 0 12px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#c39662;
}
.search-submit svg{
  width:20px;
  height:20px;
}
.search-submit:hover{
  background:rgba(0,0,0,.06);
}

/* Популярные запросы */
.search-popular .lbl{
  font-family:"Source Sans 3",sans-serif;
  font-size:12px;
  color:#7c6e60;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:12px;
}
.search-popular ul{
  list-style:none;
  margin:0;
  padding:0;
}
.search-popular li{
  margin-bottom:6px;
}
.search-popular a{
  font-family:"Source Sans 3",sans-serif;
  font-size:13px;
  color:#1e1e1e;
  text-decoration:none;
}
.search-popular a:hover{
  color:#c39662;
}

@media (max-width:768px){
  .sp-search__inner{ padding-top:24px; }
  .search-center{ padding-inline:20px; }
  .search-title{ margin-bottom:24px; }
}

/* Старая реализация меню/поиска — выключаем на всякий случай */
.search-panel,
.search-panel.is-open,
.menu-overlay,
.menu-overlay.is-open{
  display:none !important;
}
@media (max-width: 768px){
  .site-header .sp-container,
  .header-cats .sp-container{
    max-width: 90% !important;
    padding-inline: 20px !important; /* можно 16px если хочешь плотнее */
  }
}

/* =========================================================
   SEARCH OVERLAY — premium input + live suggestions
   ========================================================= */

.sp-sx{ width:100%; }

.sp-sx__field{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid rgba(195,150,98,.55);
  background:rgba(255,255,255,.92);
  box-shadow:0 12px 30px rgba(0,0,0,.06);
}

.sp-sx__field:focus-within{
  border-color: rgba(195,150,98,.95);
  box-shadow:0 16px 44px rgba(0,0,0,.10);
}

.sp-sx__icon{
  display:grid;
  place-items:center;
  color:#c39662;
  width:22px;
  height:22px;
  flex:0 0 auto;
}
.sp-sx__icon svg{ width:20px; height:20px; }

.sp-sx__input{
  flex:1;
  min-width:0;
  border:0 !important;
  background:transparent !important;
  outline:0 !important;
  box-shadow:none !important;
  font-family:"Source Sans 3",sans-serif;
  font-size:18px;
  line-height:1.35;
  color:#1e1e1e;
  padding:4px 0 !important;
}

.sp-sx__input::placeholder{
  color:rgba(30,30,30,.45);
}

.sp-sx__clear{
  border:0;
  background:transparent;
  color:#6f635a;
  cursor:pointer;
  font-size:20px;
  line-height:1;
  padding:2px 6px;
}
.sp-sx__clear:hover{ color:#1e1e1e; }

.sp-sx__submit{
  border:1px solid rgba(195,150,98,.75);
  background:#c39662;
  color:#fff;
  cursor:pointer;
  padding:10px 14px;
  font-family:"Source Sans 3",sans-serif;
  font-weight:400;
  font-size:11px;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.sp-sx__submit:hover{ filter:brightness(.98); }

.sp-sx__hint{
  margin-top:12px;
  font-family:"Source Sans 3",sans-serif;
  font-size:13px;
  letter-spacing:.08em;
  color:#7c6e60;
}

.sp-sx__panel{
  margin-top:14px;
  border-top:1px solid rgba(195,150,98,.35);
  padding-top:14px;
}

.sp-sx__panelhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:10px;
}

.sp-sx__lbl{
  font-family:"Source Sans 3",sans-serif;
  font-size:12px;
  color:#7c6e60;
  text-transform:uppercase;
  letter-spacing:.12em;
}

.sp-sx__kbd{
  font-family:"Source Sans 3",sans-serif;
  font-size:12px;
  color:rgba(30,30,30,.55);
}

.sp-sx__list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.sp-sx__item a{
  display:grid;
  grid-template-columns: 64px 1fr;
  gap:14px;
  align-items:center;
  text-decoration:none;
  padding:10px 0;
  border-bottom:1px solid rgba(195,150,98,.22);
}

.sp-sx__item:last-child a{ border-bottom:0; }

.sp-sx__thumb{
  width:64px;
  height:48px;
  background:#e8e2db;
  overflow:hidden;
}
.sp-sx__thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.sp-sx__meta{
  font-family:"Source Sans 3",sans-serif;
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#6f635a;
  margin:0 0 6px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sp-sx__t{
  margin:0;
  font-family:"Playfair Display",serif;
  font-weight:400;
  font-size:18px;
  line-height:1.2;
  color:#c39662;
}

.sp-sx__item.is-active a{
  background:rgba(195,150,98,.10);
}

@media (max-width:768px){
  .sp-sx__field{
    padding:10px 12px;
    gap:8px;
  }
  .sp-sx__submit{
    padding:10px 12px;
  }
  .sp-sx__kbd{ display:none; }
  .sp-sx__t{ font-size:17px; }
}


/* ===========================
   iOS FIX: scroll inside burger modal
   =========================== */

@media (max-width: 768px){
  /* тело страницы залочено — ок, но модалка должна скроллиться */
  .sp-modal,
  .sp-search{
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* чтобы контент не обрезался снизу на айфоне (safe-area) */
  .sp-modal__inner{
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .sp-search__inner{
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }

  /* чуть безопаснее, чтобы сетка не резалась */
  .sp-modal__grid{
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
}

/* ===========================
   HEADER ICON BUTTONS — FINAL FIX
   =========================== */

.site-header .burger,
.site-header .search-btn{
  all: unset;               /* локально сбрасываем мусор */
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 12px;
  color: #c39662;           /* общий цвет иконок */
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  line-height: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.site-header .burger:hover,
.site-header .search-btn:hover{
  background: rgba(0,0,0,.06);
}

.site-header .burger:focus-visible,
.site-header .search-btn:focus-visible{
  outline: 1px solid rgba(195,150,98,.55);
  outline-offset: 3px;
}

/* burger lines — центр через 50%/50% (никогда не будет криво) */
.site-header .burger{
  position: relative;
}

.site-header .burger span{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  transition: transform .25s ease, opacity .2s ease;
}

.site-header .burger span:nth-child(1){
  transform: translate(-50%, -50%) translateY(-7px);
}
.site-header .burger span:nth-child(2){
  transform: translate(-50%, -50%);
}
.site-header .burger span:nth-child(3){
  transform: translate(-50%, -50%) translateY(7px);
}

/* open -> X */
.site-header .burger.is-open span:nth-child(1){
  transform: translate(-50%, -50%) rotate(45deg);
}
.site-header .burger.is-open span:nth-child(2){
  opacity: 0;
}
.site-header .burger.is-open span:nth-child(3){
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* svg centering */
.site-header .search-btn svg{
  display: block;
}




/* чтобы внутренности не ломали скролл */
.sp-modal__inner,
.sp-search__inner{
  min-height: calc(100vh - 72px); /* 72px = пример высоты верхней полосы */
}

/* на мобиле + safe area */
@media (max-width: 768px){
  .sp-modal.is-open,
  .sp-search.is-open{
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* скролл внутри оверлеев всегда */
.sp-modal,
.sp-search{
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  height: 100vh;
}