/* Index/catalog page overrides */
.hero{
  padding:40px 22px 24px;
  text-align:center;
  background:linear-gradient(180deg,#fff,var(--bg));
}

.hero h1{
  font-size:clamp(1.8rem,4.8vw,3.35rem);
  letter-spacing:-.04em;
  line-height:1;
  margin-bottom:10px;
}

.hero p{
  max-width:680px;
  margin:0 auto;
  color:var(--muted);
  font-size:.94rem;
  line-height:1.45;
}

.toolbar{
  max-width:1200px;
  margin:0 auto;
  padding:16px 22px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.search,.select{
  border:1px solid var(--line);
  background:#fff;
  border-radius:var(--radius);
  padding:11px 13px;
  font-size:.88rem;
}

.search{flex:1;min-width:220px}
.select{min-width:210px}
.products-area{min-width:0}

.catalog-layout{
  max-width:1200px;
  margin:0 auto;
  padding:8px 22px 48px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:16px;
}

.card{
  display:flex;
  flex-direction:column;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}

.card:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 30px rgba(16,18,26,.1);
  border-color:#d9e0ea;
}

.photo{
  aspect-ratio:1;
  background:#edf0f5;
  position:relative;
  overflow:hidden;
  display:grid;
  place-items:center;
  font-size:3rem;
}

.photo img{width:100%;height:100%;object-fit:cover;display:block}
.catalog-photo{
  cursor:pointer;
  outline:none;
}

.catalog-photo img{
  transition:transform .28s ease;
}

.catalog-photo:hover img,
.catalog-photo:focus-visible img{
  transform:scale(1.1);
}

.gallery-count{
  position:absolute;
  right:10px;
  bottom:10px;
  padding:5px 9px;
  border-radius:999px;
  background:rgba(255,255,255,.92);
  color:var(--dark);
  font-size:.64rem;
  font-weight:900;
  box-shadow:0 8px 18px rgba(16,18,26,.16);
}

.badge{
  position:absolute;
  top:10px;
  left:10px;
  max-width:calc(100% - 20px);
  padding:5px 9px;
  background:rgba(16,18,26,.86);
  color:#fff;
  border-radius:999px;
  font-size:.62rem;
  font-weight:800;
  text-transform:uppercase;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.info{padding:13px;display:flex;flex-direction:column;gap:7px;flex:1}
.name{font-size:.92rem;font-weight:900;line-height:1.18}
.desc{
  min-height:76px;
  max-height:112px;
  padding:10px 11px 12px;
  border:1px solid #e2e8f0;
  border-radius:var(--radius);
  background:linear-gradient(180deg,#fff,#f8fafc);
  color:var(--muted);
  font-size:.78rem;
  line-height:1.45;
  overflow-y:auto;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85);
  scrollbar-width:thin;
  scrollbar-color:#cfd8e6 transparent;
}

.desc::-webkit-scrollbar{width:5px}
.desc::-webkit-scrollbar-track{background:transparent}
.desc::-webkit-scrollbar-thumb{background:#cfd8e6;border-radius:999px}
.desc::-webkit-scrollbar-thumb:hover{background:#aab4c3}
.meta{min-height:1em;color:#4b5565;font-size:.72rem;line-height:1.4}
.empty{grid-column:1/-1;text-align:center;padding:70px 20px;color:var(--muted)}

.price{margin:8px 0 10px;display:flex;flex-direction:column;align-items:flex-start;gap:2px}
.offer-label{display:inline-flex;align-items:center;margin-bottom:4px;padding:4px 10px;background:#f3f4f6;color:#6b7280;border-radius:999px;font-size:.68rem;font-weight:700;letter-spacing:.02em}
.price-old{color:#9ca3af;font-size:.82rem;font-weight:500;text-decoration:line-through;line-height:1}
.price-offer,.price-normal{font-weight:900;line-height:1;letter-spacing:-.04em;background:linear-gradient(90deg,var(--pink),var(--cyan));-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.price-offer{font-size:1.46rem}
.price-normal{font-size:1.32rem}
.discount-badge{color:#6b7280;font-size:.72rem;font-weight:700;margin-top:2px}

.qty-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:2px}
.qty-row label{font-size:.78rem;font-weight:900;color:#5c6472}
.qty-row input{width:64px;border:1px solid var(--line);background:var(--soft);border-radius:var(--radius);padding:7px;text-align:center;font-weight:800;font-size:.84rem}
.add-cart{width:100%;margin-top:6px;padding:10px;border:0;border-radius:var(--radius);background:var(--dark);color:#fff;text-align:center;font-size:.84rem;font-weight:900;cursor:pointer}

.catalog-gallery-modal{
  position:fixed;
  inset:0;
  z-index:140;
  display:none;
  place-items:center;
  padding:22px;
  background:rgba(8,10,16,.86);
  backdrop-filter:blur(10px);
}

.catalog-gallery-modal.open{
  display:grid;
}

.catalog-gallery-viewer{
  width:min(980px,100%);
  max-height:92vh;
  position:relative;
  display:grid;
  gap:10px;
  justify-items:center;
}

.catalog-gallery-viewer img{
  max-width:100%;
  max-height:78vh;
  object-fit:contain;
  border-radius:var(--radius);
  background:#10121a;
  box-shadow:0 20px 60px rgba(0,0,0,.45);
}

.catalog-gallery-close,
.catalog-gallery-nav{
  position:absolute;
  z-index:2;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.94);
  color:#10121a;
  cursor:pointer;
  box-shadow:0 10px 28px rgba(0,0,0,.24);
}

.catalog-gallery-close{
  top:10px;
  right:10px;
  width:38px;
  height:38px;
  border-radius:999px;
  font-size:1.05rem;
  font-weight:900;
}

.catalog-gallery-nav{
  top:50%;
  width:46px;
  height:54px;
  border-radius:999px;
  transform:translateY(-50%);
  font-size:2.1rem;
  line-height:1;
}

.catalog-gallery-nav[hidden]{
  display:none;
}

.catalog-gallery-prev{left:10px}
.catalog-gallery-next{right:10px}

.catalog-gallery-caption{
  width:min(760px,100%);
  display:grid;
  gap:3px;
  text-align:center;
  color:#fff;
}

.catalog-gallery-caption strong{
  font-size:1.08rem;
}

.catalog-gallery-caption span{
  color:#dbe3f0;
  font-size:.88rem;
}

@media(max-width:900px){
  .catalog-layout{padding:8px 14px 48px}
}

@media(max-width:620px){
  .grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .info{padding:10px}
  .name{font-size:.82rem}
  .desc{min-height:70px;max-height:104px;padding:9px 10px 11px;font-size:.72rem;line-height:1.45}
  .meta{font-size:.68rem}
  .price-offer{font-size:1.22rem}
  .price-normal{font-size:1.1rem}
  .offer-label{font-size:.6rem;padding:3px 8px}
  .price-old,.discount-badge{font-size:.68rem}
  .qty-row{align-items:flex-end}
  .qty-row label{font-size:.68rem}
  .qty-row input{width:54px;padding:6px}
  .add-cart{font-size:.76rem;padding:9px 7px}
  .catalog-gallery-modal{padding:12px}
  .catalog-gallery-viewer img{max-height:72vh}
  .catalog-gallery-nav{width:42px;height:48px;font-size:1.8rem}
  .catalog-gallery-prev{left:0}
  .catalog-gallery-next{right:0}
  .toolbar{padding:12px}
  .hero{padding:32px 16px 18px}
  .hero p{font-size:.86rem}
}
