/* gw8-catmob */

/* ============================================================
   Каталог специалистов — /specialists/ (корень) и страницы категорий
   (/uslugi-krasoti/ и т.п.) на мобильной (<=480) и планшетной
   (481-1024) ширине. Ориентир — Figma "Каталог Tab / Mob"
   (файл TPahxZY31GXmEexti0ZN52, узел 1039:65684):
     Tablet 1039:65737 / Mobile 1041:70303 — корень /specialists/
     Tablet 1039:69066 / Mobile 1039:66237 — /uslugi-krasoti/
   Десктоп (min-width:1025px, gw5-cat.css, figma-redesign.css) не
   трогаем ни одним правилом в этом файле.
   ============================================================ */

@media (max-width:1024px){

  /* Figma Tab/Mob: master-плитки = фото + title + chevron, БЕЗ children-чипсов.
     gw5 body.product-category-all … .children{display:grid!important} выигрывал
     по специфичности — гасим жёстче. */
  body.product-category-all .page_category .items-home-categories .home-category-item .children,
  body.product-category-all .page_category .items-home-categories .cat-master .children,
  body.product-category-all .page_category .items-home-categories .children{
    display:none !important;
  }

  body.product-category-all .page_category .items-home-categories .home-category-item,
  body.product-category-all .page_category .items-home-categories .home-category-item.cat-master{
    position:relative;
  }

  /* Шеврон на 2-col Tab/Mob наезжал на текст («физическая», «нотариусы»). Убираем. */
  body.product-category-all .page_category .items-home-categories .home-category-item.cat-master::after,
  body.product-category-all .page_category .items-home-categories .home-category-item:not(.cat-master)::after{
    content:none !important;
    display:none !important;
  }

  body.product-category-all .page_category .items-home-categories .home-category-item .name,
  body.product-category-all .page_category .items-home-categories .cat-master .name{
    text-transform:none !important;
  }

  /* Legacy ::before fade for bg-image tiles (non cat-master); hide on cat-master. */
  .page_category .items-home-categories .home-category-item::before{
    content:"";
    position:absolute;
    top:0; bottom:0; left:0;
    background:linear-gradient(to right, rgba(245,248,252,0) 55%, #f5f8fc 96%);
    pointer-events:none;
  }
  body.product-category-all .page_category .items-home-categories .home-category-item.cat-master::before{
    content:none !important;
    display:none !important;
  }
}

/* ---- Планшет 481-1024: 2-col compact master cards (Figma Tablet) ---- */
@media (min-width:481px) and (max-width:1024px){

  body.product-category-all .page_category .items-home-categories{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
    margin:0;
    padding:0 16px;
  }
  body.product-category-all .page_category .items-home-categories > .image-grid-item{
    width:auto !important; max-width:none !important; flex:0 0 auto !important;
    padding:0 !important; margin:0 !important; float:none !important;
  }
  body.product-category-all .page_category .items-home-categories > .cat-sale-wrap,
  body.product-category-all .page_category .items-home-categories > .cat-business-row{
    grid-column:1 / -1;
  }

  body.product-category-all .page_category .items-home-categories .home-category-item.cat-master{
    display:flex !important;
    flex-direction:row !important;
    align-items:stretch !important;
    min-height:120px !important;
    height:auto !important;
    padding:0 !important;
    overflow:hidden !important;
    border-radius:12px !important;
    background:linear-gradient(180deg,#FFFFFF 0%,#F1F3F5 100%) !important;
    background-color:#fff !important;
  }
  body.product-category-all .cat-master__pic{
    flex:0 0 42% !important;
    width:42% !important;
    max-width:42% !important;
    height:auto !important;
    min-height:120px !important;
    max-height:none !important;
    align-self:stretch !important;
    border-radius:12px 0 0 12px !important;
  }
  body.product-category-all .cat-master__pic::after{
    top:0 !important; right:0 !important; bottom:0 !important; left:auto !important;
    width:28px !important; height:auto !important;
    background:linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.75) 100%) !important;
  }
  body.product-category-all .cat-master__body{
    flex:1 1 auto !important;
    min-height:0 !important;
    padding:12px 12px 12px 14px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
  }
  body.product-category-all .page_category .items-home-categories .cat-master .name{
    margin:0 !important;
    padding:0 !important;
    border-bottom:0 !important;
    font-size:15px !important;
    line-height:1.25 !important;
  }

  /* Fallback non-cat-master tiles (legacy bg-image) */
  .page_category .items-home-categories .home-category-item:not(.cat-master){
    display:flex; align-items:center;
    min-height:120px; height:auto !important;
    padding:16px 34px 16px 132px;
    background-repeat:no-repeat !important;
    background-position:left center !important;
    background-size:112px 100% !important;
  }
  .page_category .items-home-categories .home-category-item:not(.cat-master)::before{ width:112px; }
  .page_category .items-home-categories .home-category-item:not(.cat-master) .name{
    font-size:16px; line-height:1.3;
  }

  .offers_list .item_inner .img img{
    width:100% !important; height:100% !important; object-fit:cover !important;
  }
}

/* ---- Мобильная <=480: 2-col compact cards + hero search (Figma Mobile 1041:70303) ---- */
@media (max-width:480px){

  /* ── Hero: tighter so cards enter first viewport.
     gw19 loads AFTER gw8 with body.product-category-all .page_category .cat_hero×3
     (pad 40 0 180 / mb −100 !important). Need higher specificity to win. ── */
  html body.product-category-all .page_category .cat_hero.cat_hero.cat_hero,
  html body.product-category-all .cat_hero.cat_hero.cat_hero,
  html body.product-category-all .cat_hero{
    padding:24px 0 16px !important;
    padding-bottom:16px !important;
    margin-bottom:0 !important;
  }
  body.product-category-all .cat_hero__h1{
    margin:8px auto 16px !important;
    font-size:30px !important;
  }

  /* Figma: one search field with search+filter icons inside; no pill row */
  body.product-category-all .cat_hero-filters{
    display:none !important;
  }
  body.product-category-all .cat_hero-form{
    position:relative !important;
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    max-width:calc(100% - 24px) !important;
    width:calc(100% - 24px) !important;
    height:48px !important;
    min-height:48px !important;
    margin:0 auto !important;
    padding:0 8px 0 12px !important;
    border-radius:10px !important;
    box-sizing:border-box !important;
    gap:0 !important;
  }
  body.product-category-all .cat_hero-form label{
    position:relative !important;
    display:block !important;
    flex:1 1 auto !important;
    min-width:0 !important;
    width:100% !important;
    margin:0 !important;
  }
  body.product-category-all .cat_hero-form .search-field{
    width:100% !important;
    height:48px !important;
    border-radius:10px !important;
    padding:0 88px 0 4px !important;
    font-size:15px !important;
    line-height:1.3 !important;
    box-sizing:border-box !important;
  }
  body.product-category-all .cat_hero-form .search-field::placeholder{
    font-size:14px !important;
  }
  /* Кнопка «Найти» текстом, не иконка поверх поля */
  body.product-category-all .cat_hero-form{
    height:auto !important;
    min-height:48px !important;
    padding:6px 8px 6px 10px !important;
    gap:6px !important;
  }
  body.product-category-all .cat_hero-form .search-field{
    padding:0 8px 0 4px !important;
    height:40px !important;
  }
  body.product-category-all .cat_hero-form .cat_hero-submit,
  body.product-category-all .cat_hero-form .search-submit,
  body.product-category-all .cat_hero-form button.search-submit{
    position:static !important;
    transform:none !important;
    width:auto !important;
    min-width:72px !important;
    height:40px !important;
    padding:0 12px !important;
    margin:0 !important;
    border:0 !important;
    border-radius:8px !important;
    background:#0066B2 !important;
    background-image:none !important;
    box-shadow:none !important;
    color:#fff !important;
    font-size:14px !important;
    font-weight:600 !important;
    line-height:1 !important;
    text-indent:0 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:4px !important;
    z-index:3 !important;
    flex:0 0 auto !important;
  }
  body.product-category-all .cat_hero-form .cat_hero-submit svg,
  body.product-category-all .cat_hero-form .search-submit svg{
    width:16px !important;
    height:16px !important;
    flex:0 0 auto !important;
  }
  body.product-category-all .cat_hero-form .cat_hero__settings{
    position:static !important;
    transform:none !important;
    width:40px !important;
    height:40px !important;
    min-width:40px !important;
    border-radius:8px !important;
    background:#EAF2FB !important;
    border:0 !important;
    color:#0066B2 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    z-index:3 !important;
    flex:0 0 40px !important;
  }

  /* AI badge right under search (overrides gw5 max-width:600 center) */
  body.product-category-all .cat_hero__ai-wrap{
    text-align:right !important;
    max-width:calc(100% - 24px) !important;
    margin:10px auto 0 !important;
  }

  /* Popular chips denser ~2-row wrap */
  body.product-category-all .cat_hero-popular{
    margin-top:14px !important;
    max-width:calc(100% - 24px) !important;
  }
  body.product-category-all .cat_hero-popular-label{
    margin-bottom:8px !important;
    font-size:15px !important;
  }
  body.product-category-all .cat_hero .home_find-chips{
    gap:6px 8px !important;
    max-width:100% !important;
  }
  body.product-category-all .cat_hero .home_find-chips li a{
    font-size:13px !important;
    min-height:28px !important;
    height:auto !important;
    padding:3px 10px !important;
    white-space:nowrap !important;
    line-height:1.25 !important;
  }

  /* ── 2-col compact master cards ── */
  body.product-category-all .page_category .items-home-categories{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:12px !important;
    padding:0 12px !important;
    margin:8px 0 0 !important;
    width:100% !important;
    box-sizing:border-box !important;
  }
  body.product-category-all .page_category .items-home-categories > .image-grid-item{
    width:auto !important;
    max-width:none !important;
    flex:0 0 auto !important;
    padding:0 !important;
    margin:0 !important;
    float:none !important;
  }
  body.product-category-all .page_category .items-home-categories > .cat-sale-wrap,
  body.product-category-all .page_category .items-home-categories > .cat-business-row{
    grid-column:1 / -1;
  }

  body.product-category-all .page_category .items-home-categories .home-category-item.cat-master{
    display:flex !important;
    flex-direction:row !important;
    align-items:stretch !important;
    min-height:110px !important;
    height:auto !important;
    padding:0 !important;
    overflow:hidden !important;
    border-radius:12px !important;
    /* solid white — transparent body was showing hero blue through overlapping cards */
    background:linear-gradient(180deg,#FFFFFF 0%,#F1F3F5 100%) !important;
    background-image:linear-gradient(180deg,#FFFFFF 0%,#F1F3F5 100%) !important;
    background-color:#fff !important;
    box-shadow:0 4px 16px rgba(193,200,218,.32) !important;
    z-index:1;
  }
  body.product-category-all .cat_master__body{
    background:transparent !important;
  }
  body.product-category-all .cat-master__pic{
    flex:0 0 42% !important;
    width:42% !important;
    max-width:42% !important;
    height:auto !important;
    min-height:110px !important;
    max-height:none !important;
    align-self:stretch !important;
    border-radius:12px 0 0 12px !important;
  }
  body.product-category-all .cat-master__pic img{
    object-position:center center !important;
  }
  body.product-category-all .cat-master__pic::after{
    top:0 !important; right:0 !important; bottom:0 !important; left:auto !important;
    width:20px !important; height:auto !important;
    background:linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.7) 100%) !important;
  }
  body.product-category-all .cat-master__body{
    flex:1 1 auto !important;
    min-width:0 !important;
    min-height:0 !important;
    padding:10px 10px 10px 10px !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:center !important;
  }
  body.product-category-all .page_category .items-home-categories .cat-master .name{
    margin:0 !important;
    padding:0 !important;
    border-bottom:0 !important;
    font-size:13px !important;
    font-weight:400 !important;
    line-height:1.25 !important;
    color:#0066B2 !important;
  }
  body.product-category-all .page_category .items-home-categories .home-category-item.cat-master::after{
    content:none !important;
    display:none !important;
  }

  /* Fallback non-cat-master */
  .page_category .items-home-categories .home-category-item:not(.cat-master){
    display:flex; align-items:center;
    min-height:100px; height:auto !important;
    padding:14px 28px 14px 96px !important;
    background-repeat:no-repeat !important;
    background-position:left center !important;
    background-size:88px 100% !important;
  }
  .page_category .items-home-categories .home-category-item:not(.cat-master)::before{ width:88px; }
  .page_category .items-home-categories .home-category-item:not(.cat-master) .name{
    font-size:14px; line-height:1.3;
  }
  .page_category .items-home-categories .home-category-item:not(.cat-master)::after{
    right:12px; width:8px; height:8px; margin-top:-5px;
  }

  .offers_list .item_inner .img img{
    width:100% !important; height:100% !important; object-fit:cover !important;
  }

  /* ── Business leaf /shopping/ (product-category-291) — Card Business Mob
     Figma 1077:97892: card 360×766, cover 328×348 rect, single CTA, no badge/♥.
     Overflow: kill .offers_list width 410 / margin −10 / .item pad 10. */
  body.product-category-291 .offers_list{
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    gap:16px !important;
    display:flex !important;
    flex-direction:column !important;
    box-sizing:border-box;
  }
  body.product-category-291 .offers_list > .item{
    width:100% !important;
    max-width:100% !important;
    padding:0 20px !important;
    margin:0 !important;
    float:none !important;
    box-sizing:border-box;
  }
  body.product-category-291 .offers_list .item_inner.sp-card{
    max-width:360px !important;
    width:100% !important;
    margin-left:auto !important;
    margin-right:auto !important;
    padding:16px !important;
    box-sizing:border-box;
  }
  body.product-category-291 .offers_list .item_inner.sp-card .sp-card__top{
    display:flex !important;
  }
  body.product-category-291 .offers_list .item_inner.sp-card .contacts_wrap{
    max-width:328px !important;
    width:100% !important;
    margin-left:auto !important;
    margin-right:auto !important;
    margin-top:auto !important;
    padding:0 !important;
    box-sizing:border-box;
  }
  body.product-category-291 .offers_list .item_inner.sp-card .contacts_wrap > a.btn--site{
    height:46px !important;
    min-height:46px !important;
    max-width:328px !important;
    width:100% !important;
    padding:12px 16px !important;
    box-sizing:border-box !important;
    flex:1 1 100% !important;
  }
}

/* ── Business Tab/Mob (≤860): compact hero + Card Business chrome
   Figma upper cap ~168px title-only; no search field. ── */
@media (max-width:860px){

  body.product-category-291 .page_category .cat_hero.cat_hero.cat_hero,
  body.product-category-291 .cat_hero.cat_hero.cat_hero{
    padding:24px 20px 32px !important;
    margin-bottom:0 !important;
    min-height:0 !important;
  }
  body.product-category-291 .cat_hero__srch{
    display:none !important;
  }
  body.product-category-291 .cat_hero.cat_hero .cat_hero__name,
  body.product-category-291 .cat_hero .cat_hero__name{
    font-size:32px !important;
    font-weight:300 !important;
    line-height:1.2 !important;
    margin:0 0 8px !important;
  }
  body.product-category-291 .cat_hero.cat_hero h1.home-widget-title,
  body.product-category-291 .cat_hero .home-widget-title{
    font-size:17px !important;
    line-height:20px !important;
    font-weight:400 !important;
    margin:0 auto !important;
    max-width:360px !important;
  }
  body.product-category-291 .cat_hero.cat_hero .breadcrumb,
  body.product-category-291 .cat_hero .breadcrumb{
    margin:0 0 12px !important;
    font-size:14px !important;
    justify-content:center !important;
    overflow:hidden;
    white-space:nowrap;
  }
  /* Figma 2-level path «Главная / …» — hide mid «Каталог специалистов» crumb */
  body.product-category-291 .cat_hero .breadcrumb li:nth-child(2){
    display:none !important;
  }

  body.product-category-291 .offers_list .item_inner.sp-card .sp-card__top{
    display:flex !important;
  }
  body.product-category-291 .offers_list .item_inner.sp-card .contacts_wrap{
    max-width:328px !important;
    width:100% !important;
    padding:0 !important;
    box-sizing:border-box;
  }

  /* Tab/Mob: no horizontal overflow from legacy item pad / list margin */
  body.product-category-291 .offers_list{
    width:100% !important;
    max-width:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;
    box-sizing:border-box;
  }
}

/* Business tablet only (481–860): 2-col gutters; mobile (≤480) keeps 20px side pad */
@media (min-width:481px) and (max-width:860px){
  body.product-category-291 .offers_list > .item{
    padding-left:12px !important;
    padding-right:12px !important;
    box-sizing:border-box;
  }
}
