/* v1.5.1: ефекти при натискане на категория/подкатегория (телефон и компютър) */

/* 1) „Натискане“ на картата */
.hf-products-v1 .hfsmart-tile,
.hf-products-v1 .hfsmart-chip,
.hf-products-v1 .hf-main-category-card,
.hf-products-v1 .hf-products-welcome-category,
.hf-products-v1 .hf-subcategory-card,
.hf-products-v1 .hf-sidebar-category-main,
.hf-products-v1 .hf-sidebar-subcategory,
.hf-products-v1 .hf-pro-search-popular-card{
  transition-property:scale, transform, box-shadow, background, color, opacity !important;
  -webkit-tap-highlight-color:transparent;
}
.hf-products-v1 .hf-nav-press{
  scale:.96;
  transition:scale .09s ease-out !important;
}
.hf-products-v1 .hf-nav-press-out{
  transition:scale .22s cubic-bezier(.34,1.56,.64,1) !important;
}

/* 3) Тънка оранжева лента най-горе */
#hf-nav-progress{
  position:fixed;left:0;top:0;height:3px;width:0;z-index:2147483000;
  background:linear-gradient(90deg,#ff6a00,#ffb067);
  box-shadow:0 0 10px rgba(255,106,0,.55);
  opacity:0;pointer-events:none;
  transition:width .25s ease, opacity .3s ease;
}
#hf-nav-progress.is-on{opacity:1}
#hf-nav-progress.is-run{width:82%;transition:width 2.4s cubic-bezier(.08,.82,.17,1), opacity .2s ease}
#hf-nav-progress.is-done{width:100%;opacity:0;transition:width .2s ease, opacity .35s ease .2s}
body.admin-bar #hf-nav-progress{top:46px}
@media(min-width:783px){body.admin-bar #hf-nav-progress{top:32px}}

/* старото „Зареждане...“ вече не е нужно – лентата го замества */
.hf-products-v1 .hf-products-content.is-hf-ajax-loading:after{display:none !important;content:none !important}

/* 5) Плавна смяна: старото избледнява, новото се плъзга леко отдолу */
.hf-products-v1 .hf-products-content.is-hf-ajax-loading > *{
  opacity:.45;
  transition:opacity .18s ease;
}
.hf-products-v1 .hf-nav-in{
  animation:hfNavIn .32s cubic-bezier(.2,.7,.2,1) both !important;
}
@keyframes hfNavIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}

@media (prefers-reduced-motion: reduce){
  .hf-products-v1 .hf-nav-press{scale:1}
  .hf-products-v1 .hf-nav-in{animation:none !important}
  #hf-nav-progress{transition:none}
}

/* ---------- v1.6.0: вълничка + приближаване на снимката при натискане ---------- */
.hf-products-v1 .hf-ripple-wrap{position:absolute;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none;z-index:3}
.hf-products-v1 .hf-ripple{position:absolute;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle,rgba(255,106,0,.30) 0%,rgba(255,106,0,.14) 45%,rgba(255,106,0,0) 70%);
  transform:scale(0);animation:hfRipple .55s ease-out forwards}
@keyframes hfRipple{to{transform:scale(1);opacity:0}}
.hf-products-v1 :is(.hfsmart-tile,.hf-main-category-card,.hf-products-welcome-category,.hf-subcategory-card,.hf-pro-search-popular-card) img{
  transition:scale .3s cubic-bezier(.2,.7,.2,1);
}
.hf-products-v1 .hf-nav-press img{scale:1.08}

/* ---------- v1.6.0: подкатегориите като „чипове“ над продуктите ---------- */
.hf-products-v1 .hf-subcat-chips{
  display:flex;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;
  padding:4px 2px 12px;margin:0 0 6px;scrollbar-width:none;-webkit-overflow-scrolling:touch;
  min-width:0;
}
.hf-products-v1 .hf-subcat-chips::-webkit-scrollbar{display:none}
.hf-products-v1 .hf-subcat-chip{
  position:relative;flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;
  padding:9px 15px;border-radius:999px;border:1.5px solid #dfe6ef;background:#fff;
  color:#0a2138;font-weight:700;font-size:13.5px;line-height:1.2;text-decoration:none;white-space:nowrap;
  box-shadow:0 2px 6px rgba(10,33,56,.05);-webkit-tap-highlight-color:transparent;
  transition:background .2s,color .2s,border-color .2s,scale .22s cubic-bezier(.34,1.56,.64,1);
}
.hf-products-v1 .hf-subcat-chip:hover{border-color:#ffb98a;color:#0a2138}
.hf-products-v1 .hf-subcat-chip .hf-subcat-chip-n{font-weight:600;font-size:12px;color:#7b8a9c}
.hf-products-v1 .hf-subcat-chip.is-active{background:#0a2138;border-color:#0a2138;color:#fff}
.hf-products-v1 .hf-subcat-chip.is-active .hf-subcat-chip-n{color:#ffb067}
.hf-products-v1 .hf-subcat-chip:focus-visible{outline:3px solid #ff6a00;outline-offset:2px}

/* компютър (v1.7.1): чиповете заемат целия ред над панела и продуктите; стрелките – само ако не се събират */
@media (min-width:901px){
  .hf-products-v1 .hf-products-content.has-subcategory-focus.has-hf-chips{grid-template-rows:auto auto auto !important}
  .hf-products-v1 .has-hf-chips > .hf-subcategory-stack{grid-row:2 / span 2 !important}
  .hf-products-v1 .has-hf-chips > .hf-subcat-chips{grid-column:1 / -1 !important;grid-row:1 !important;padding-top:0}
  .hf-products-v1 .has-hf-chips > .hf-products-toolbar{grid-row:2 !important}
  .hf-products-v1 .has-hf-chips > .hf-product-grid,
  .hf-products-v1 .has-hf-chips > .hf-empty-products{grid-row:3 !important}
}
/* телефон/таблет: чиповете остават закачени под лентата „Назад“, докато скролваш */
@media (max-width:900px){
  .hf-products-v1 .has-active-category > .hf-subcat-chips{
    position:sticky;top:68px;z-index:19;margin:-14px -22px 12px;padding:10px 22px 12px;
    background:rgba(247,249,252,.96);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
    border-bottom:1px solid #e8edf3;
  }
}
@media (max-width:700px){
  .hf-products-v1 .has-active-category > .hf-subcat-chips{top:62px;margin:-10px -15px 12px;padding:9px 15px 11px}
}
@media (prefers-reduced-motion: reduce){
  .hf-products-v1 .hf-ripple{display:none}
  .hf-products-v1 .hf-nav-press img{scale:1}
}

/* ---------- v1.6.1: на телефон/таблет категориите вече не покриват хедъра и търсачката ---------- */
.hf-products-v1 .hfsmart-mini{display:none}
@media (max-width:900px){
  html:has(.hf-products-content.has-active-category),
  body:has(.hf-products-content.has-active-category){overflow:visible !important}
  .hf-products-v1 .hf-products-content.has-active-category{
    position:relative !important;inset:auto !important;z-index:auto !important;
    height:auto !important;min-height:70vh !important;overflow:visible !important;
  }
  /* „clip“ вместо „hidden“ – така закачането (sticky) работи */
  .hf-products-v1{overflow:clip !important}
  .hf-products-v1 .has-active-category .hf-mobile-stage-bar{position:relative !important;top:auto !important}
  .hf-products-v1 .has-active-category > .hf-subcat-chips{top:var(--hf-sticky-top,0px) !important}
  .hf-products-v1 .has-active-category > .hfsmart-mini{
    display:block !important;background:transparent !important;padding:14px 0 6px !important;margin:0 !important;
  }
  .hf-products-v1 .has-active-category > .hfsmart-mini .hfsmart-search{height:48px;border-radius:14px}
}

/* ---------- v1.6.3: подкатегориите на един ред, със стрелки в краищата ---------- */
.hf-products-v1 .hf-subcat-chips{flex-wrap:nowrap;scroll-behavior:smooth}
.hf-products-v1 .hf-chip-arrow{display:none}
@media (min-width:901px) and (hover:hover){
  .hf-products-v1 .hf-chip-arrow{
    position:sticky;z-index:2;flex:0 0 auto;align-self:center;width:38px;height:38px;margin:0 -6px;
    border-radius:50%;border:1.5px solid #dfe6ef;background:#fff;color:#0a2138;font-size:24px;line-height:1;font-weight:700;
    box-shadow:0 4px 14px rgba(10,33,56,.14);cursor:pointer;display:flex;align-items:center;justify-content:center;
    opacity:0;pointer-events:none;transition:opacity .2s,border-color .2s,color .2s;padding:0 0 3px;
  }
  .hf-products-v1 .hf-chip-arrow:hover{border-color:#ff6a00;color:#ff6a00}
  .hf-products-v1 .hf-chip-arrow-prev{left:0;order:-1;margin:0 -38px 0 0}
  .hf-products-v1 .hf-chip-arrow-next{right:0;order:999;margin:0 0 0 -38px}
  .hf-products-v1 .hf-subcat-chips.hf-can-prev .hf-chip-arrow-prev,
  .hf-products-v1 .hf-subcat-chips.hf-can-next .hf-chip-arrow-next{opacity:1;pointer-events:auto}
  .hf-products-v1 .hf-chip-arrow-prev{box-shadow:12px 0 14px -4px #f7f9fc,0 4px 14px rgba(10,33,56,.14)}
  .hf-products-v1 .hf-chip-arrow-next{box-shadow:-12px 0 14px -4px #f7f9fc,0 4px 14px rgba(10,33,56,.14)}
}
