/* =========================================================
   IG Shop Navigation (Ignavo-compatible)
   - category drilldown widget styling
   - hide Ignavo default category-tree widget (optional)
   ========================================================= */

/* Hide Ignavo default widget_klb_product_categories if it exists, keep ours (.igwc-cat-nav) */
body.post-type-archive-product .widget_klb_product_categories:not(.igwc-cat-nav),
body.tax-product_cat .widget_klb_product_categories:not(.igwc-cat-nav){
  display:none !important;
}

/* Category nav widget (drilldown) */
.igwc-cat-nav{
  border:1px solid rgba(0,0,0,.06);
  border-radius:12px;
  background:#fff;
  padding:12px 12px 10px;
  margin:0 0 14px;
}

.igwc-cat-nav .ig-cat-head{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 0 10px;
}

.igwc-cat-nav .ig-cat-back{
  width:28px;
  height:28px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:6px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-size:18px;
  line-height:1;
}

.igwc-cat-nav .ig-cat-title{
  font-weight:600;
  font-size:15px;
  line-height:1.2;
}

.igwc-cat-nav .ig-cat-search-wrap{
  position:relative;
  margin:10px 0 12px;
}

.igwc-cat-nav input.ig-cat-search{
  width:100%;
  padding:8px 10px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:10px;
  font-size:13px;
}

.igwc-cat-nav ul.ig-cat-list{
  list-style:none;
  margin:0;
  padding:0;
}

.igwc-cat-nav li.ig-cat-item a{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:9px 6px;
  border-radius:8px;
  text-decoration:none;
}

.igwc-cat-nav li.ig-cat-item a:hover{
  background: rgba(0,0,0,.04);
}

.igwc-cat-nav li.ig-cat-item.is-active a{
  font-weight:600;
}

.igwc-cat-nav .ig-cat-arrow{
  opacity:.55;
  font-size:16px;
}

/* Global suggestions (inline) */
.igwc-cat-nav .ig-cat-suggest{
  margin-top: 8px;
  border-top: 1px solid rgba(0,0,0,.08);
  padding-top: 8px;
  display:none;
}
.igwc-cat-nav .ig-cat-suggest.is-open{ display:block; }
.igwc-cat-nav .ig-cat-suggest .ig-s-head{
  font-size:12px;
  opacity:.7;
  margin: 0 0 6px;
}
.igwc-cat-nav .ig-cat-suggest ul{ list-style:none; margin:0; padding:0; }
.igwc-cat-nav .ig-cat-suggest li a{
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:8px 6px;
  border-radius:8px;
  text-decoration:none;
}
.igwc-cat-nav .ig-cat-suggest li a:hover{ background: rgba(0,0,0,.04); }
.igwc-cat-nav .ig-s-name{ font-weight:600; font-size:13px; }
.igwc-cat-nav .ig-s-path{ font-size:12px; opacity:.7; }

/* =========================================================
   Shop root overview (iParts-like category grid + accordion)
   ========================================================= */
.igwc-shop-home-template{ width: 100%; }

.igwc-shop-home__head{ max-width: 1100px; position: relative; z-index: 30; overflow: visible; }
.igwc-shop-home-template,
.igwc-shop-home,
.igwc-shop-home__search{ overflow: visible; }
.igwc-shop-home__search{ z-index: 40; }
.igwc-shop-home__search-results{ z-index: 9999; }
.igwc-shop-home__grid{ position: relative; z-index: 1; }
.igwc-shop-home__title{ margin: 0 0 10px; font-weight: 700; }
.igwc-shop-home__lead{
  max-width: 980px;
  margin: 0 0 16px;
  color: rgba(0,0,0,.72);
  font-size: 15px;
  line-height: 1.65;
}
.igwc-shop-home__search{
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 0 18px;
}
.igwc-shop-home__search-input{
  width: 100%;
  max-width: none;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 10px;
  font-size: 14px;
}
.igwc-shop-home__search-results{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  display: none;
  background: #fff;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0,0,0,.12);
  overflow: hidden;
  z-index: 40;
}
.igwc-shop-home__search-results.is-open{ display:block; }
.igwc-shop-home__search-head{
  padding: 10px 12px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: rgba(0,0,0,.58);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.igwc-shop-home__search-empty{
  padding: 12px;
  font-size: 13px;
  color: rgba(0,0,0,.72);
}
.igwc-shop-home__search-list{
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 420px;
  overflow: auto;
}
.igwc-shop-home__search-item{ margin: 0; padding: 0; }
.igwc-shop-home__search-link{
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 10px;
  text-decoration: none;
}
.igwc-shop-home__search-link:hover{ background: rgba(0,0,0,.04); }
.igwc-shop-home__search-main{
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.igwc-shop-home__search-name{ font-weight: 600; }
.igwc-shop-home__search-count{
  opacity: .68;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.igwc-shop-home__search-path{
  font-size: 12px;
  line-height: 1.35;
  color: rgba(0,0,0,.62);
}

.igwc-shop-home{ margin-top: 8px; }
.igwc-shop-home__grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.igwc-cat-card{
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 284px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.igwc-cat-card__top{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin: 0 0 10px;
  position: relative;
  z-index: 2;
}

.igwc-cat-card__title{
  min-width: 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.igwc-cat-card__title:hover .igwc-cat-card__name{ text-decoration: underline; }

.igwc-cat-card__icon{ width: 24px; height: 24px; flex: 0 0 24px; display:flex; align-items:center; justify-content:center; }
.igwc-cat-card__img{ width: 24px; height: 24px; object-fit: contain; display:block; }
.igwc-cat-card__img--ph{ width: 20px; height: 20px; border-radius: 5px; background: rgba(0,0,0,.08); }

.igwc-cat-card__name{
  display: block;
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.igwc-cat-card__toggle{ display:none; margin-left:auto; width:32px; height:32px; flex:0 0 32px; border:0; background:transparent; position:relative; z-index:2; }
.igwc-cat-card__toggle:before{
  content:'';
  position:absolute; inset:0;
  margin:auto;
  width: 10px; height: 10px;
  border-right: 2px solid rgba(0,0,0,.55);
  border-bottom: 2px solid rgba(0,0,0,.55);
  transform: rotate(45deg);
}

.igwc-cat-card__watermark{
  position: absolute;
  right: 14px;
  top: 74px;
  width: 118px;
  height: 118px;
  opacity: .08;
  pointer-events: none;
  z-index: 1;
}
.igwc-cat-card__wm-img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.igwc-cat-card__body{ position: relative; z-index: 2; flex: 1; display:flex; flex-direction: column; }
.igwc-cat-card__list{ list-style:none; margin:0; padding:0; }
.igwc-cat-card__item{ margin:0; padding:0; }
.igwc-cat-card__link{
  display:block;
  position: relative;
  padding: 3px 0 3px 14px;
  text-decoration:none;
  color: inherit;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.igwc-cat-card__link:before{
  content: '▸';
  position: absolute;
  left: 0;
  top: 3px;
  font-size: 11px;
  opacity: .85;
}
.igwc-cat-card__link:hover{ text-decoration: underline; }
.igwc-cat-card__link-count{ display:none; }

.igwc-cat-card__more{
  margin-top: auto;
  align-self: flex-start;
  padding: 9px 18px;
  border-radius: 4px;
  background: #0d5bd7;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
}
.igwc-cat-card__more:hover{ color:#fff; text-decoration:none; filter:brightness(.96); }

@media (max-width: 1480px){
  .igwc-shop-home__grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1280px){
  .igwc-shop-home__grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px){
  .igwc-shop-home__grid{ grid-template-columns: 1fr; gap: 12px; }
  .igwc-cat-card{ min-height: 0; padding: 12px 12px 14px; }
  .igwc-cat-card__top{ margin:0; }
  .igwc-cat-card__toggle{ display:inline-block; }
  .igwc-cat-card__watermark{ width: 88px; height: 88px; right: 8px; top: 46px; }
  .igwc-cat-card__body{ display:none; padding-top: 10px; }
  .igwc-cat-card__body.is-open{ display:block; }
  .igwc-cat-card__more{ margin-top: 10px; }
}

/* =========================================================
   Mobile top "Wróć" button (next to Ignavo Filter button)
   ========================================================= */
.igwc-top-back{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.igwc-top-back .igwc-top-back-icon{
  font-size:18px;
  line-height:1;
}
.igwc-top-back .igwc-top-back-text{
  line-height:1;
}


/* =========================================================
   Facet search (attribute/brand widgets)
   ========================================================= */
.igwc-filter-search-wrap{
  margin: 0 0 10px;
}
.igwc-filter-search-wrap input.igwc-filter-search{
  width:100%;
  padding:8px 10px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:10px;
  font-size:13px;
  line-height:1.2;
}
.igwc-filter-nores{
  font-size:12px;
  opacity:.75;
  padding:6px 0 0;
}

/* =========================================================
   Archive/category title injection (when theme hides it)
   ========================================================= */
.igwc-archive-title{
  margin: 0 0 14px;
}
.igwc-archive-title__h1{
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

@media(max-width:768px){
  .igwc-archive-title__h1{ font-size: 22px; }
}


/* Shop home footer description */
.igwc-shop-home-description {
  margin-top: 48px;
  padding-top: 8px;
}

.igwc-shop-home-description__section {
  margin-top: 28px;
}

.igwc-shop-home-description__section:first-child {
  margin-top: 0;
}

.igwc-shop-home-description__section h2 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.25;
}

.igwc-shop-home-description__section p,
.igwc-shop-home-description__section li {
  font-size: 16px;
  line-height: 1.8;
}

.igwc-shop-home-description__section p {
  margin: 0 0 14px;
}

.igwc-shop-home-description__section ul,
.igwc-shop-home-description__section ol {
  margin: 0 0 16px 22px;
  padding: 0;
}

.igwc-shop-home-description__section li + li {
  margin-top: 8px;
}

@media (max-width: 991px) {
  .igwc-shop-home-description {
    margin-top: 36px;
  }

  .igwc-shop-home-description__section h2 {
    font-size: 24px;
  }
}

@media (max-width: 767px) {
  .igwc-shop-home-description {
    margin-top: 28px;
  }

  .igwc-shop-home-description__section {
    margin-top: 24px;
  }

  .igwc-shop-home-description__section h2 {
    font-size: 21px;
  }

  .igwc-shop-home-description__section p,
  .igwc-shop-home-description__section li {
    font-size: 15px;
    line-height: 1.7;
  }
}
