@font-face {
  font-family: "vazir";
  src: url("../fonts/Vazirmatn-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
}

:root {
  --red:#b52c35;
  --red-dark:#8e2028;
  --purple:#594268;
  --teal:#148f98;
  --gold:#b38a45;
  --ink:#252329;
  --muted:#77727a;
  --line:#e8e4e1;
  --soft:#faf8f6;
}

*{box-sizing:border-box}

body{
  margin:0;
  color:var(--ink);
  font-family:vazir,Arial,Helvetica,sans-serif;
  background:
    radial-gradient(circle at 7% 28%,rgba(181,44,53,.05),transparent 26rem),
    radial-gradient(circle at 93% 60%,rgba(20,143,152,.05),transparent 25rem),
    #fff;
}

button{font-family:inherit}

.merosa-hero{
  position:relative;
  overflow:hidden;
  padding:22px max(16px,calc((100% - 1240px)/2)) 74px;
  color:#fff;
  background:linear-gradient(125deg,#8e2028 0%,#b52c35 35%,#594268 68%,#148f98 100%);
}

.merosa-hero:before,
.merosa-hero:after{
  content:"";
  position:absolute;
  border:1px solid rgba(255,255,255,.18);
  border-radius:50%;
  pointer-events:none;
}

.merosa-hero:before{
  width:440px;height:440px;
  left:-230px;bottom:-315px;
}

.merosa-hero:after{
  width:330px;height:330px;
  right:-175px;top:-230px;
}

.hero-top,.hero-content{
  position:relative;
  z-index:2;
  max-width:1240px;
  margin:auto;
}

.hero-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.hero-link,.hero-cart{
  color:#fff;
  text-decoration:none;
  border:1px solid rgba(255,255,255,.3);
  border-radius:999px;
  padding:10px 15px;
  font-size:12px;
  transition:.2s;
}

.hero-link:hover,.hero-cart:hover{
  background:rgba(255,255,255,.12);
}

.hero-cart{
  display:flex;
  align-items:center;
  gap:8px;
}

.cart-badge{
  min-width:24px;height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#fff;
  color:var(--red);
  font-size:11px;
}

.hero-content{
  margin-top:62px;
  display:grid;
  grid-template-columns:1fr 330px;
  gap:50px;
  align-items:center;
}

.hero-label,.section-label{
  display:inline-block;
  font:800 11px Arial,sans-serif;
  letter-spacing:2px;
}

.hero-label{color:rgba(255,255,255,.72)}
.section-label{color:var(--teal)}

.hero-copy h1{
  margin:14px 0 8px;
  font-size:clamp(55px,8vw,94px);
  line-height:1;
}

.hero-copy p{
  max-width:730px;
  margin:0;
  color:rgba(255,255,255,.84);
  line-height:2.1;
}

.hero-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:22px;
}

.hero-pills span{
  padding:8px 12px;
  border:1px solid rgba(255,255,255,.25);
  border-radius:999px;
  background:rgba(255,255,255,.08);
  font-size:10px;
}

.hero-art{position:relative;height:290px}

.hero-orbit{
  position:absolute;
  border:1px solid rgba(255,255,255,.25);
  border-radius:50%;
}

.orbit-one{width:290px;height:290px;right:5px;top:0}
.orbit-two{
  width:210px;height:210px;
  right:45px;top:40px;
  border-style:dashed;
}

.hero-card{
  position:absolute;
  right:72px;top:65px;
  width:165px;height:165px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  border-radius:28px;
  transform:rotate(7deg);
  background:rgba(255,255,255,.96);
  color:var(--purple);
  box-shadow:0 25px 65px rgba(0,0,0,.2);
}

.hero-card span{
  font:900 25px Arial,sans-serif;
  letter-spacing:2px;
}

.hero-card strong{
  margin-top:7px;
  color:var(--red);
  font:900 15px Arial,sans-serif;
  letter-spacing:3px;
}

.hero-card small{
  margin-top:12px;
  color:#888;
  font:700 7px Arial,sans-serif;
  letter-spacing:1px;
}

.merosa-main{
  width:min(1240px,calc(100% - 30px));
  margin:-32px auto 80px;
  position:relative;
  z-index:4;
}

.catalog-intro{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:30px;
  padding:30px;
  border:1px solid var(--line);
  border-radius:26px;
  background:rgba(255,255,255,.98);
  box-shadow:0 20px 60px rgba(30,25,20,.08);
}

.catalog-intro h2,.panel-title h2,.products-heading h2{
  margin:8px 0;
  font-size:clamp(22px,3vw,34px);
}

.catalog-intro p,.products-heading p{
  margin:0;
  color:var(--muted);
  line-height:2;
}

.catalog-numbers{
  display:flex;
  gap:10px;
}

.catalog-numbers div{
  min-width:105px;
  padding:15px;
  text-align:center;
  border:1px solid var(--line);
  border-radius:17px;
  background:var(--soft);
}

.catalog-numbers strong{
  display:block;
  color:var(--red);
  font-size:27px;
}

.catalog-numbers span{
  color:var(--muted);
  font-size:10px;
}

.category-panel,.products-section{margin-top:45px}

.panel-title{margin-bottom:17px}

.category-tabs{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:12px;
}

.category-button{
  position:relative;
  overflow:hidden;
  min-height:120px;
  padding:18px;
  text-align:right;
  border:1px solid var(--line);
  border-radius:21px;
  background:#fff;
  cursor:pointer;
  transition:.22s;
}

.category-button:after{
  content:"";
  position:absolute;
  width:105px;height:105px;
  left:-30px;bottom:-45px;
  border-radius:50%;
  background:rgba(20,143,152,.07);
}

.category-button:hover{
  transform:translateY(-4px);
  box-shadow:0 14px 35px rgba(25,20,15,.08);
}

.category-button.active{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg,var(--red),var(--purple));
  box-shadow:0 16px 35px rgba(181,44,53,.18);
}

.category-number{
  display:block;
  opacity:.6;
  font:800 10px Arial,sans-serif;
}

.category-name{
  display:block;
  margin-top:9px;
  font-size:14px;
  font-weight:800;
  line-height:1.8;
}

.category-count{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:10px;
}

.category-button.active .category-count{color:rgba(255,255,255,.72)}

.products-heading{
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:20px;
  padding-bottom:17px;
  border-bottom:1px solid var(--line);
}

.visible-products{
  white-space:nowrap;
  color:var(--red);
  font-size:12px;
  font-weight:800;
}

.products-grid{
  margin-top:20px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:17px;
}

.product-card{
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:22px;
  background:#fff;
  transition:.22s;
}

.product-card:hover{
  transform:translateY(-6px);
  box-shadow:0 18px 45px rgba(25,20,15,.1);
}

.product-image-wrap{
  position:relative;
  padding:11px;
  background:
    linear-gradient(145deg,rgba(181,44,53,.05),rgba(20,143,152,.06)),
    var(--soft);
}

.product-image{
  display:block;
  width:100%;
  height:230px;
  object-fit:cover;
  border-radius:15px;
}

.product-code{
  position:absolute;
  top:20px;right:20px;
  padding:6px 9px;
  border-radius:999px;
  background:rgba(37,35,41,.9);
  color:#fff;
  font:800 10px Arial,sans-serif;
}

.product-page{
  position:absolute;
  left:20px;bottom:20px;
  padding:6px 9px;
  border-radius:999px;
  background:rgba(255,255,255,.94);
  color:var(--purple);
  font-size:9px;
  font-weight:800;
}

.product-body{padding:17px}

.product-body h3{
  margin:0;
  min-height:58px;
  font-size:14px;
  line-height:1.9;
}

.product-specs{
  min-height:64px;
  margin-top:10px;
  display:grid;
  gap:5px;
  color:var(--muted);
  font-size:10px;
}

.product-price{
  margin-top:10px;
  padding:10px 11px;
  border-radius:12px;
  background:#faf5ea;
  color:var(--gold);
  font-size:11px;
  font-weight:800;
}

.product-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  margin-top:10px;
}

.product-actions button{
  min-height:39px;
  border:0;
  border-radius:11px;
  cursor:pointer;
  font-size:10px;
  font-weight:800;
}

.details-button{background:var(--ink);color:#fff}
.add-button{background:var(--red);color:#fff}
.add-button:disabled{background:#eee;color:#999;cursor:not-allowed}

.state-box{
  grid-column:1/-1;
  min-height:270px;
  border:1px dashed var(--line);
  border-radius:24px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  color:var(--muted);
}

.loader{
  width:35px;height:35px;
  border:3px solid #eee;
  border-top-color:var(--red);
  border-radius:50%;
  animation:spin .8s linear infinite;
}

@keyframes spin{to{transform:rotate(360deg)}}

.error-button{
  border:0;
  border-radius:11px;
  padding:10px 16px;
  background:var(--red);
  color:#fff;
  cursor:pointer;
}

.modal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.modal.open{display:flex}

.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,12,14,.7);
  backdrop-filter:blur(7px);
}

.modal-dialog{
  position:relative;
  z-index:2;
  width:min(820px,100%);
  max-height:92vh;
  overflow:auto;
  border-radius:27px;
  background:#fff;
  box-shadow:0 35px 100px rgba(0,0,0,.3);
}

.modal-close{
  position:absolute;
  z-index:3;
  left:12px;top:12px;
  width:40px;height:40px;
  border:0;
  border-radius:50%;
  background:#222;
  color:#fff;
  cursor:pointer;
  font-size:24px;
}

.modal-top{
  display:grid;
  grid-template-columns:280px 1fr;
  gap:25px;
  padding:28px;
  background:linear-gradient(135deg,#faf7f3,#fff);
}

.modal-image{
  width:100%;
  height:290px;
  object-fit:cover;
  border-radius:19px;
}

.modal-code{
  color:var(--red);
  font:800 11px Arial,sans-serif;
  letter-spacing:1px;
}

.modal-top h2{
  margin:30px 0 12px;
  font-size:24px;
  line-height:1.8;
}

.modal-details{padding:0 28px 30px}
.modal-details h3{margin:22px 0 12px;font-size:15px}

.spec-table{
  width:100%;
  border-collapse:collapse;
  border:1px solid var(--line);
  border-radius:15px;
  overflow:hidden;
}

.spec-table tr:not(:last-child){border-bottom:1px solid var(--line)}

.spec-table td{
  padding:12px;
  font-size:11px;
  vertical-align:top;
}

.spec-table td:first-child{
  width:38%;
  color:var(--muted);
}

.modal-note{
  padding:14px;
  border-radius:14px;
  background:#faf5ea;
  color:#705b34;
  font-size:11px;
  line-height:2;
}

.modal-catalog-link{
  display:inline-block;
  margin-top:14px;
  padding:10px 14px;
  border-radius:11px;
  background:var(--purple);
  color:#fff;
  text-decoration:none;
  font-size:11px;
  font-weight:800;
}

@media(max-width:1050px){
  .category-tabs{grid-template-columns:repeat(3,1fr)}
  .products-grid{grid-template-columns:repeat(3,1fr)}
}

@media(max-width:800px){
  .hero-content{grid-template-columns:1fr;text-align:center}
  .hero-copy p{margin-inline:auto}
  .hero-pills{justify-content:center}
  .hero-art{width:300px;margin:0 auto}
  .catalog-intro{flex-direction:column;align-items:stretch}
  .catalog-numbers{justify-content:center}
  .category-tabs{grid-template-columns:repeat(2,1fr)}
  .products-grid{grid-template-columns:repeat(2,1fr)}
  .products-heading{align-items:start}
  .modal-top{grid-template-columns:1fr}
  .modal-image{height:230px}
}

@media(max-width:520px){
  .merosa-hero{padding-inline:13px}
  .hero-content{margin-top:42px}
  .hero-copy h1{font-size:58px}
  .hero-art{transform:scale(.85);margin:-12px auto -20px}
  .merosa-main{width:calc(100% - 18px)}
  .catalog-intro{padding:20px}
  .category-tabs{grid-template-columns:1fr}
  .products-grid{grid-template-columns:1fr}
  .products-heading{flex-direction:column}
}
