/* Шапка Trely — одна на все сайты экосистемы.

   ОБРАЗЕЦ — шапка главной shipping.trely.io (решение руководителя 12.10.2026:
   «теперь это стандарт»). Размеры, цвета, отступы, анимации и узкие экраны
   перенесены из её стилей дословно; там размеры в rem при корне 10 px,
   здесь те же числа в пикселях.

   Что намеренно НЕ перенесено:
   · кнопка диалога справа сверху — руководитель сказал не копировать;
   · «бургер» (узкий экран, только сайты Shipping) открывает то же меню,
     что у образца: «Объявления», язык, «Отправить посылку»,
     «Стать доставщиком», «Войти».

   Классы начинаются с th- (trely header): прежние svc-*, sm-*, lgroup
   относились к старым версиям меню и здесь не используются.

   Картинки — фонами из папки hdr/ рядом с этим файлом: так стили сами
   находят их на любом сайте, и в разметку не нужно вписывать адреса. */

.th, .th * { box-sizing: border-box; }
.th { --th-h: 70px; position: sticky; top: 0; z-index: 100; display: flex; align-items: center;
      height: var(--th-h); background-color: #fbfaf7; border-bottom: 1px solid #e5e2dc;
      font-family: 'Inter Tight', -apple-system, system-ui, sans-serif; color: #0f1014;
      -webkit-font-smoothing: antialiased; }
.th a { text-decoration: none; color: inherit; }
.th .th-pill { color: #ceac75; }
.th .th-name { color: #0f1014; }
.th button { font: inherit; color: inherit; background: none; border: 0; margin: 0; cursor: pointer; }
.th ul { margin: 0; padding: 0; }
.th p { margin: 0; }
.th-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
         flex: 1 1 0%; padding: 0 24px; }

/* ── логотип: «Trely» + плашка продукта ── */
.th-brand { display: flex; align-items: center; gap: 4px; justify-self: start; font-size: 20px;
            font-weight: 600; line-height: 28px; white-space: nowrap; }
.th-name { display: flex; align-items: center; gap: 6px; color: #0f1014; }
.th-name:active { transition: opacity .1s; opacity: .7; }
.th-logo { flex-shrink: 0; display: block; width: 24px; height: 29px;
           background: url("hdr/logo.801f5f9d.svg") center/contain no-repeat; }
.th-pill { padding: 4px 10px; border-radius: 100px; background-color: rgba(198,160,100,.1);
           color: #ceac75; transition: background-color .2s; }
.th-pill:active { transition: opacity .1s; opacity: .7; }

/* ── середина: только на сайтах Shipping ── */
.th-actions { display: flex; align-items: center; gap: 28px; justify-self: center; }
.th-action { display: inline-flex; align-items: center; gap: 6px; padding: 13px 0; font-size: 15px;
             font-weight: 500; line-height: 18px; letter-spacing: -.16px; color: #c6a064;
             white-space: nowrap; transition: color .2s; }
.th .th-action { color: #c6a064; }
.th-action:active { transition: opacity .1s; opacity: .7; }
.th-plus { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px;
           border-radius: 10px; background-color: rgba(198,160,100,.1); transition: background-color .2s; }
.th-plus svg { width: 10px; height: 10px; }

/* ── правая часть ── */
.th-right { display: flex; align-items: center; gap: 19px; justify-self: end; }
.th-svc, .th-prof, .th-burger-wrap { position: relative; display: flex; align-items: center; flex-shrink: 0; }
.th-burger-wrap { display: none; }
.th-trig { display: flex; align-items: center; gap: 6px; padding: 10px; border-radius: 12px;
           background-color: transparent; color: #0f1014; transition: background-color .2s; }
.th-trig:active { transition: opacity .1s; opacity: .7; }
.th-trig[aria-expanded="true"] { background-color: rgba(0,0,0,.03); }
.th-trig-lead { display: flex; align-items: flex-end; gap: 5px; }
.th-trig-icon { flex-shrink: 0; width: 20px; height: 20px; }
.th-trig-label { font-size: 15px; font-weight: 500; line-height: 18px; letter-spacing: -.16px; white-space: nowrap; }
.th-chev { flex-shrink: 0; width: 16px; height: 16px; opacity: .5; transition: transform .2s; }
.th-trig[aria-expanded="true"] .th-chev { transform: rotate(180deg); }
.th-trig:focus-visible, .th-name:focus-visible, .th-pill:focus-visible, .th-action:focus-visible {
  outline: 2px solid #c6a064; outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  .th-pill:hover { background-color: rgba(198,160,100,.3); }
  .th-action:hover .th-plus { background-color: rgba(198,160,100,.3); }
  .th-trig:hover { background-color: rgba(0,0,0,.03); }
}

/* ── панель «Сервисы» ── */
.th-panel { position: fixed; top: calc(var(--th-h, 70px) + 10px); right: 0; left: 0; z-index: 1;
            display: flex; gap: 10px; width: min(1010px, calc(100vw - 40px)); margin-inline: auto;
            padding: 10px; border-radius: 24px; background-color: #fff;
            box-shadow: 0 8px 32px rgba(39,60,63,.1); transform-origin: center top;
            animation: th-panel-in .22s ease both; }
.th-panel[hidden] { display: none; }
.th-panel.is-closing { animation: th-panel-in .16s ease reverse both; }
@keyframes th-panel-in { 0% { opacity: 0; transform: translateY(-6px) scale(.98); } 100% { opacity: 1; transform: none; } }

.th-products { display: flex; flex-direction: column; flex-shrink: 0; gap: 3px; width: 287px; }
.th-products > * { animation: th-row-settle .32s ease both; }
.th-products > :nth-child(1) { animation-delay: .03s; }
.th-products > :nth-child(2) { animation-delay: .06s; }
.th-products > :nth-child(3) { animation-delay: .09s; }
.th-products > :nth-child(4) { animation-delay: .12s; }
.th-products > :nth-child(5) { animation-delay: .15s; }
.th-products > :nth-child(6) { animation-delay: .18s; }
.th-products > :nth-child(7) { animation-delay: .21s; }
@keyframes th-row-settle { 0% { opacity: 0; transform: translateX(-4px); } 100% { opacity: 1; transform: none; } }

.th-product { display: flex; align-items: center; justify-content: space-between; width: 100%;
              padding: 4px 16px 4px 4px; border-radius: 16px; background-color: #fff;
              text-align: left; transition: background-color .2s; }
.th-product:active { transition: opacity .1s; opacity: .7; }
.th-product[aria-selected="true"] { background-color: #f6f6f6; }
.th-product[aria-selected="true"] .th-tile { background-color: #fff; }
.th-product[aria-selected="true"] .th-pchev { opacity: .5; }
.th-product:focus-visible { outline: 2px solid #c6a064; outline-offset: -2px; }
.th-plead { display: flex; align-items: center; gap: 9px; }
.th-tile { position: relative; flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
           background-color: #f8f8f8; overflow: hidden; transition: background-color .2s; }
.th-tile--go { background-color: #fff; }
.th-plabel { font-size: 16px; font-weight: 500; line-height: 24px; color: #000; white-space: nowrap; }
.th-pchev { flex-shrink: 0; width: 16px; height: 16px; opacity: 0; transform: rotate(-90deg); transition: opacity .2s; }

/* Иллюстрации продуктов в плитках — положение и размер как у образца. */
.th-art { position: absolute; display: block; background-repeat: no-repeat; background-position: center;
          background-size: cover; }
.th-art--go { top: 8.873px; left: 8.872px; width: 21.2553px; height: 24.2553px; background-image: url("hdr/go.9267a2e9.svg"); }
.th-art--shipping { top: -.58px; left: .15px; width: 40.02px; height: 40.02px; background-image: url("hdr/shipping.ce70b0a4.webp");
  transform: scaleX(-1); -webkit-mask-image: url("hdr/shipping-mask.2e1740d8.svg"); mask-image: url("hdr/shipping-mask.2e1740d8.svg");
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: 3.81px 9.542px; mask-position: 3.81px 9.542px;
  -webkit-mask-size: 32.081px 24.207px; mask-size: 32.081px 24.207px; }
.th-art--car { top: 0; left: 1px; width: 38px; height: 38px; background-image: url("hdr/car.67d19f57.webp"); }
.th-art--gid { top: 7.67px; left: 1px; width: 37px; height: 24.667px; background-image: url("hdr/gid.e5299829.webp"); }
.th-art--club { top: 4px; left: 4px; width: 31px; height: 31.939px; border-radius: 50%; overflow: hidden;
  background-image: url("hdr/club.94b2df69.webp"); background-size: 169.7% 164.71%; background-position: -11.27px 0; }
.th-art--blog { top: 7px; left: -2px; width: 41px; height: 27.333px; background-image: url("hdr/blog.adc7ddac.webp"); }
.th-art--concierge { top: 7px; left: 5px; width: 31.2px; height: 26px; background-image: url("hdr/concierge.d0f8a70f.webp"); }

.th-links { display: flex; flex: 1 1 0%; flex-direction: column; gap: 17px; min-width: 0; padding: 20px;
            border-radius: 16px; background-color: #fbfaf7; animation: th-pane-in .18s ease both; }
.th-links[hidden] { display: none; }
@keyframes th-pane-in { 0% { opacity: 0; } 100% { opacity: 1; } }
.th-ltitle { font-size: 20px; font-weight: 500; line-height: 30px; color: #000; }
.th-lsub { font-size: 14px; line-height: 22px; color: rgba(0,0,0,.5); }
.th-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; list-style: none; }
.th-cards li { display: flex; }
.th-card { display: flex; flex: 1 1 0%; align-items: center; gap: 10px; padding: 14px; border-radius: 12px;
           background-color: #fff; text-align: left; }
.th-card:active { transition: opacity .1s; opacity: .7; }
.th-ctext { display: flex; flex: 1 1 0%; flex-direction: column; gap: 4px; min-width: 0; font-size: 14px; line-height: 22px; }
.th-ctitle { font-weight: 500; color: #000; }
.th-cdesc { color: rgba(0,0,0,.5); }
.th-carrow { display: flex; flex-shrink: 0; width: 24px; height: 24px; padding: 4px; border-radius: 100px;
             background: #ceac75 url("hdr/arrow.7a60d517.svg") center/16px 16px no-repeat; opacity: 0;
             transform: translateX(-4px); transition: opacity .2s, transform .2s; }
.th-card:focus-visible { outline: 2px solid #c6a064; outline-offset: 2px; }
.th-card:focus-visible .th-carrow { opacity: 1; transform: none; }

@media (hover: hover) and (pointer: fine) {
  .th-product:hover { background-color: #f6f6f6; }
  .th-product:hover .th-tile { background-color: #fff; }
  .th-product:hover .th-pchev { opacity: .5; }
  .th-card:hover .th-carrow { opacity: 1; transform: none; }
}

/* ── выпадающие списки: «Профиль» и «бургер» ── */
.th-drop { position: absolute; top: calc(100% + 31px); right: 0; z-index: 101; display: flex;
           flex-direction: column; gap: 6px; width: 222px; padding: 8px; border-radius: 24px;
           background-color: #fff; box-shadow: 0 8px 32px rgba(39,60,63,.1); transform-origin: right top;
           animation: th-fade-up .2s cubic-bezier(.16,1,.3,1); }
.th-drop[hidden] { display: none; }
.th-drop.is-closing { animation: th-fade-down .15s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes th-fade-up { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes th-fade-down { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(8px); } }

.th-user { display: flex; align-items: center; gap: 6px; margin: -4px; padding: 4px; border-radius: 16px;
           outline: none; transition: background-color .2s; }
.th-gava { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 42px; height: 42px;
           border-radius: 100px; background-color: #f6f6f6; color: #0f1014; }
.th-gava svg { width: 20px; height: 20px; }
.th-utext { display: flex; flex-direction: column; min-width: 0; font-weight: 500; }
.th-uname, .th-umail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-uname { font-size: 14px; line-height: 22px; color: #000; }
.th-umail { font-size: 12px; line-height: 20px; color: rgba(0,0,0,.5); }
.th-group { display: flex; flex-direction: column; border-radius: 16px; background-color: #f6f6f6; overflow: hidden; }
.th-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px;
          border-bottom: 1px solid rgba(0,0,0,.05); outline: none; transition: background-color .2s; }
a.th-row, button.th-row { cursor: pointer; }
.th-row:last-child { border-bottom: none; }
.th-rlead { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 500; line-height: 22px;
            color: #000; white-space: nowrap; }
.th-ricon { flex-shrink: 0; width: 20px; height: 20px; background: center/20px 20px no-repeat; }
.th-ricon--user { background-image: url("hdr/menu-user.bb30cc8d.svg"); }
.th-ricon--globe { background-image: url("hdr/menu-globe.2237e6dc.svg"); }
.th-ricon--list { background-image: url("hdr/menu-list.42081247.svg"); }
.th-ricon--parcel { background-image: url("hdr/menu-parcel.34b38818.svg"); }
.th-ricon svg { display: block; width: 20px; height: 20px; }
.th-rmeta { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 20px; color: rgba(0,0,0,.5);
            white-space: nowrap; }
.th-rdot { width: 3px; height: 3px; border-radius: 100px; background-color: rgba(0,0,0,.15); }
.th-user:hover, .th-user:focus-visible, a.th-row:hover, a.th-row:focus-visible { background-color: rgba(0,0,0,.03); }

.th .th-burger { display: none; align-items: center; justify-content: center; width: 36px; height: 36px;
             padding: 8px; border-radius: 10px; background: rgba(0,0,0,.03); transition: background .2s; }
.th .th-burger:active { background: rgba(0,0,0,.08); }
.th-burger span { position: relative; display: block; width: 12px; height: 1px; background-color: #000;
                  transition: background-color .2s; }
.th-burger span::before, .th-burger span::after { content: ""; position: absolute; left: 0; width: 12px; height: 1px;
                  background-color: #000; transition: transform .2s; }
.th-burger span::before { top: -4px; }
.th-burger span::after { bottom: -4px; }
.th-burger[aria-expanded="true"] span { background-color: transparent; }
.th-burger[aria-expanded="true"] span::before { transform: translateY(4px) rotate(45deg); }
.th-burger[aria-expanded="true"] span::after { transform: translateY(-4px) rotate(-45deg); }

/* ── меню «бургера»: выезжает справа под шапкой, как у образца ── */
.th-sheet[hidden] { display: none; }
.th-overlay { position: fixed; top: calc(var(--th-h, 70px) - 2px); right: 0; bottom: 0; left: 0; z-index: 98;
              background: rgba(0,0,0,.5); animation: th-overlay-in .15s cubic-bezier(.16,1,.3,1); }
.th-sheet-in { position: fixed; top: calc(var(--th-h, 70px) - 2px); right: 0; bottom: 0; z-index: 99;
               width: 100%; max-width: 320px; background: #fff; outline: none;
               animation: th-slide-in .25s cubic-bezier(.16,1,.3,1); }
.th-sheet.is-closing .th-overlay { animation: th-overlay-out .15s forwards; }
.th-sheet.is-closing .th-sheet-in { animation: th-slide-out .15s forwards; }
@keyframes th-overlay-in { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes th-overlay-out { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes th-slide-in { 0% { transform: translateX(100%); } 100% { transform: translateX(0); } }
@keyframes th-slide-out { 0% { transform: translateX(0); } 100% { transform: translateX(100%); } }
.th-menu { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 32px 20px; }
.th-mtop { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.th-mtitle { font-size: 14px; line-height: 22px; font-weight: 400; color: rgba(0,0,0,.4); text-transform: uppercase;
             letter-spacing: 1.12px; text-align: center; }
.th-mlinks { display: flex; flex-direction: column; gap: 6px; }
.th .th-mlink { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 16px 10px;
                text-align: center; font-size: 16px; line-height: 24px; font-weight: 400; color: #000;
                transition: color .3s; }
.th-mlink:active { transition: opacity .1s; opacity: .7; }
.th-mbottom { display: flex; flex-direction: column; gap: 16px; margin: 0 -20px -32px; padding: 40px 20px 20px; }
.th-locale { display: none; align-self: center; align-items: center; gap: 6px; padding: 6px 8px 6px 12px;
             border: 1px solid rgba(0,0,0,.05); border-radius: 12px; background: #fff; color: #000;
             font-size: 16px; font-weight: 500; line-height: 24px; white-space: nowrap; }
.th-locale svg { flex-shrink: 0; }
.th-mactions { display: flex; flex-direction: column; gap: 12px; }
.th .th-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px;
              padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 600; line-height: 22px;
              text-align: center; transition: opacity .2s; }
.th .th-btn:active { opacity: .7; }
.th .th-btn--dark { background-color: #273c3f; color: #fff; }
.th .th-btn--gold { background-color: #c6a064; color: #fff; }
.th .th-btn--light { background-color: rgba(39,60,63,.05); color: #4a6b6f; }
@media (hover: hover) and (pointer: fine) {
  .th .th-burger:hover { background: rgba(0,0,0,.05); }
  .th .th-mlink:hover { color: #ceac75; }
  .th-locale:hover { background: #f8f6f1; }
}

/* ── узкие экраны — пороги образца ── */
@media (max-width: 1366px) { .th-actions { gap: 16px; } .th-right { gap: 12px; } }
@media (max-width: 1100px) {
  .th-in { grid-template-columns: auto 1fr; }
  .th-actions { display: none; }
  .th-burger-wrap, .th .th-burger { display: flex; }
}
@media (max-width: 850px) {
  .th-in { padding: 0 20px; }
  .th-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 766px) {
  .th { --th-h: 57px; }
  .th-panel { top: calc(var(--th-h, 70px) + 8px); flex-direction: column; width: auto;
              max-height: calc(100dvh - var(--th-h, 70px) - 16px); margin-inline: 10px; overflow-y: auto; }
  .th-products { flex-direction: row; gap: 6px; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .th-products::-webkit-scrollbar { display: none; }
  .th .th-product { flex-shrink: 0; width: auto; padding: 8px 14px; border-radius: 100px; background-color: #f6f6f6; }
  .th-product[aria-selected="true"] { background-color: rgba(198,160,100,.1); }
  .th-product[aria-selected="true"] .th-plabel { color: #ceac75; }
  .th-tile, .th-pchev { display: none; }
  .th-plabel { font-size: 14px; line-height: 20px; }
  .th-links { gap: 12px; padding: 16px; }
}
@media (max-width: 600px) {
  .th { --th-h: 50px; }
  .th-sheet-in { max-width: none; }
  .th-locale { display: flex; }
  .th-in { gap: 8px; padding: 0 10px; }
  .th-brand { gap: 3px; font-size: 15px; line-height: 20px; }
  .th-name { gap: 4px; }
  .th-logo { width: 16px; height: 20px; }
  .th-pill { padding: 2px 6px; }
  .th-right { gap: 4px; }
  .th-trig { gap: 5px; padding: 6px; }
  .th-svc .th-trig-icon { width: 15px; height: 15px; }
  .th-svc .th-trig-label { font-size: 14px; line-height: 20px; }
  .th-prof .th-trig-label { display: none; }
  .th-chev { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .th-panel, .th-panel.is-closing, .th-products > *, .th-links, .th-drop, .th-drop.is-closing,
  .th-overlay, .th-sheet-in, .th-sheet.is-closing .th-overlay, .th-sheet.is-closing .th-sheet-in { animation: none; }
}
