/* Product card + filter auto-apply patch.
   Load after app.css, conversion-seo.css and header-dynamic.css. */

html,
body{
  max-width:100%;
  overflow-x:hidden;
}

.shop-layout,
.compact-shop-layout,
.shop-content,
.shop-sidebar,
.product-grid,
.product-card-v3,
.product-card-v3 *{
  box-sizing:border-box;
}

.shop-layout.compact-shop-layout,
.compact-shop-layout{
  display:grid;
  grid-template-columns:minmax(230px,260px) minmax(0,1fr) !important;
  gap:22px !important;
  align-items:start;
}

.shop-content,
.compact-shop-layout .shop-content{
  min-width:0 !important;
  width:100%;
  overflow:visible;
}

.shop-content .product-grid,
.product-grid{
  width:100%;
  min-width:0;
  display:grid !important;
  grid-template-columns:repeat(auto-fill,minmax(238px,1fr)) !important;
  gap:18px !important;
  align-items:stretch !important;
}

.product-card.product-card-v3{
  width:100%;
  min-width:0 !important;
  max-width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid var(--line,#e5e7eb);
  border-radius:18px !important;
  background:#fff;
  box-shadow:0 10px 26px rgba(15,23,42,.055);
}

.product-card-v3 *,
.product-card-v3 *::before,
.product-card-v3 *::after{
  min-width:0;
}

.product-card-v3 .product-image-link,
.product-card-v3 .card-image-v3{
  position:relative;
  display:block;
  width:100%;
  height:158px !important;
  min-height:158px !important;
  max-height:158px !important;
  aspect-ratio:auto !important;
  overflow:hidden;
  background:linear-gradient(180deg,#f8fafc 0%,#f1f5f9 100%);
}

.product-card-v3 .product-image-link img,
.product-card-v3 .card-image-v3 img{
  display:block;
  width:100% !important;
  height:100% !important;
  object-fit:contain !important;
  padding:14px !important;
  border:0;
  color:transparent;
  transform:none !important;
}

.product-card-v3:hover .product-image-link img,
.product-card-v3:hover .card-image-v3 img{
  transform:none !important;
}

.product-card-v3 .floating-badge,
.product-card-v3 .card-badge-v3{
  position:absolute;
  left:10px;
  top:10px;
  z-index:2;
  max-width:calc(100% - 20px);
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(15,23,42,.78);
  color:#fff;
  font-size:.72rem;
  line-height:1.1;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.product-card-v3 .product-content,
.product-card-v3 .card-content-v3{
  flex:1;
  display:flex;
  flex-direction:column;
  padding:13px !important;
  gap:0;
}

.product-card-v3 .product-meta-top,
.product-card-v3 .card-meta-v3{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:nowrap;
  margin:0 0 8px;
  overflow:hidden;
}

.product-card-v3 .chip,
.product-card-v3 .card-chip-v3,
.product-card-v3 .rating-chip,
.product-card-v3 .card-rating-v3{
  max-width:100%;
  padding:5px 9px !important;
  font-size:.72rem !important;
  line-height:1.15 !important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.product-card-v3 .chip,
.product-card-v3 .card-chip-v3{
  flex:1 1 auto;
}

.product-card-v3 .rating-chip,
.product-card-v3 .card-rating-v3{
  flex:0 0 auto;
}

.product-card-v3 .review-count{
  opacity:.8;
}

.product-card-v3 .card-title-v3,
.product-card-v3 .product-content h2,
.product-card-v3 .product-content h3{
  margin:0 0 7px !important;
  font-size:1rem !important;
  line-height:1.28 !important;
  font-weight:850;
  letter-spacing:-.015em;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height:2.56em;
}

.product-card-v3 .card-title-v3 a,
.product-card-v3 .product-content h2 a,
.product-card-v3 .product-content h3 a{
  color:var(--text,#111827);
  text-decoration:none;
}

.product-card-v3 .card-desc-v3,
.product-card-v3 .product-content p{
  color:var(--text-soft,#475569);
  font-size:.86rem !important;
  line-height:1.48 !important;
  margin:0 0 9px !important;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height:2.55em;
}

.product-card-v3 .price-row,
.product-card-v3 .card-price-v3{
  display:flex;
  flex-wrap:wrap;
  margin:auto 0 10px !important;
  gap:6px !important;
  align-items:baseline;
  line-height:1.15;
}

.product-card-v3 .price-row strong,
.product-card-v3 .card-price-v3 strong{
  font-size:1rem !important;
  line-height:1.15;
  letter-spacing:-.015em;
  font-weight:850;
  overflow-wrap:anywhere;
}

.product-card-v3 .price-row span,
.product-card-v3 .card-price-v3 span{
  font-size:.78rem !important;
  color:var(--muted,#64748b);
  text-decoration:line-through;
}

.product-card-v3 .product-actions,
.product-card-v3 .card-actions-v3{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(72px,.54fr) !important;
  gap:8px !important;
  margin:0 0 9px !important;
  width:100%;
}

.product-card-v3 .card-actions-v3.single-action{
  grid-template-columns:1fr !important;
}

.product-card-v3 .product-actions .btn,
.product-card-v3 .card-actions-v3 .btn{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  width:100%;
  max-width:100%;
  min-width:0 !important;
  min-height:38px !important;
  padding:8px 10px !important;
  border-radius:13px !important;
  font-size:.84rem !important;
  line-height:1.15 !important;
  font-weight:850;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.product-card-v3 .card-check-price-cta{
  background:var(--secondary,#12304f) !important;
  color:#fff !important;
}

.product-card-v3 .card-review-cta{
  background:var(--primary,#9a623d) !important;
  color:#fff !important;
}

.product-card-v3 .compare-row,
.product-card-v3 .card-compare-v3{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-height:22px;
  margin:0;
}

.product-card-v3 .compare-toggle{
  margin:0 !important;
  padding:0;
  border:0;
  background:transparent;
  color:var(--primary,#9a623d);
  font-size:.8rem !important;
  font-weight:850;
  line-height:1.25;
  cursor:pointer;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.product-card-v3 .external-link-note{
  flex:0 0 auto;
  color:var(--muted,#64748b);
  font-size:.72rem;
  white-space:nowrap;
}

.compare-bar{
  padding:8px 0 !important;
}

.compare-bar-inner{
  min-height:52px;
}

/* Auto filter UX */
.js-auto-filter select{
  cursor:pointer;
}

.js-auto-filter.is-filter-loading{
  opacity:.72;
  pointer-events:none;
}

.js-auto-filter.is-filter-loading::after{
  content:"Applying…";
  display:block;
  margin-top:8px;
  font-size:.78rem;
  font-weight:800;
  color:var(--primary,#9a623d);
}

.shop-toolbar.js-auto-filter.is-filter-loading::after{
  align-self:center;
  margin:0;
}

@media (min-width:1280px){
  .compact-shop-layout .product-grid{
    grid-template-columns:repeat(auto-fill,minmax(245px,1fr)) !important;
  }
}

@media (max-width:1100px){
  .shop-layout.compact-shop-layout,
  .compact-shop-layout{
    grid-template-columns:1fr !important;
  }

  .shop-sidebar.sticky-sidebar{
    position:static;
  }
}

@media (max-width:760px){
  .shop-content .product-grid,
  .product-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:12px !important;
  }

  .product-card-v3 .product-image-link,
  .product-card-v3 .card-image-v3{
    height:132px !important;
    min-height:132px !important;
    max-height:132px !important;
  }

  .product-card-v3 .product-content,
  .product-card-v3 .card-content-v3{
    padding:11px !important;
  }

  .product-card-v3 .card-title-v3,
  .product-card-v3 .product-content h2,
  .product-card-v3 .product-content h3{
    font-size:.88rem !important;
  }

  .product-card-v3 .card-desc-v3,
  .product-card-v3 .product-content p{
    font-size:.78rem !important;
  }

  .product-card-v3 .product-actions,
  .product-card-v3 .card-actions-v3{
    grid-template-columns:1fr !important;
    gap:7px !important;
  }

  .product-card-v3 .product-actions .btn,
  .product-card-v3 .card-actions-v3 .btn{
    min-height:34px !important;
    font-size:.78rem !important;
  }

  .product-card-v3 .external-link-note{
    display:none;
  }
}

@media (max-width:380px){
  .shop-content .product-grid,
  .product-grid{
    grid-template-columns:1fr !important;
  }
}
