/* ==================================================
   پینک‌بری — سیستم طراحی اصلی
   ================================================== */

@font-face {
  font-family: 'Vazirmatn';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root{
  --pink-50:#fff5f8;
  --pink-100:#ffe4ec;
  --pink-300:#ff9dbd;
  --pink-500:#ec4d80;
  --pink-600:#d63868;
  --pink-700:#b32754;
  --ink-900:#241820;
  --ink-700:#4a3b44;
  --ink-500:#7d6d76;
  --line:#f0dfe6;
  --bg:#fffdfe;
  --white:#ffffff;
  --success:#2e9e6a;
  --danger:#d64545;
  --radius-sm:10px;
  --radius-md:16px;
  --radius-lg:24px;
  --shadow-sm:0 2px 10px rgba(179,39,84,.06);
  --shadow-md:0 10px 30px rgba(179,39,84,.10);
  font-size:16px;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  font-family:'Vazirmatn', Tahoma, sans-serif;
  background:var(--bg);
  color:var(--ink-900);
  direction:rtl;
  line-height:1.8;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%; display:block;}
a{color:inherit; text-decoration:none;}
button{font-family:inherit; cursor:pointer;}
ul{margin:0; padding:0; list-style:none;}
input, textarea, select{font-family:inherit; font-size:1rem;}

.container{max-width:1200px; margin:0 auto; padding:0 20px;}

/* ---------- Header ---------- */
.site-header{
  position:sticky; top:0; z-index:50;
  background:rgba(255,253,254,.92);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.header-inner{position:relative; display:flex; align-items:center; justify-content:space-between; height:72px; gap:16px;}
.logo{font-size:1.5rem; font-weight:700; color:var(--pink-600); letter-spacing:.5px;}
.main-nav{display:flex; gap:28px;}
.main-nav a{font-weight:500; color:var(--ink-700); transition:color .15s;}
.main-nav a:hover, .main-nav a.active{color:var(--pink-600);}
.header-actions{display:flex; align-items:center; gap:6px;}
.icon-btn{
  position:relative; width:42px; height:42px; border:none; background:transparent;
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  color:var(--ink-700); transition:background .15s;
}
.icon-btn:hover{background:var(--pink-50); color:var(--pink-600);}
.icon-btn svg{width:22px; height:22px;}
.badge{
  position:absolute; top:2px; left:2px; min-width:16px; height:16px; padding:0 4px;
  background:var(--pink-500); color:#fff; font-size:.65rem; border-radius:9px;
  display:flex; align-items:center; justify-content:center; font-weight:700;
}
.menu-toggle{display:none;}
.main-nav.open-mobile{display:flex;}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:13px 26px; border-radius:999px; border:none; font-weight:700; font-size:.95rem;
  transition:transform .12s, box-shadow .12s, opacity .12s; white-space:nowrap;
}
.btn:active{transform:scale(.97);}
.btn-primary{background:var(--pink-500); color:#fff; box-shadow:var(--shadow-sm);}
.btn-primary:hover{background:var(--pink-600);}
.btn-outline{background:transparent; color:var(--pink-600); border:1.5px solid var(--pink-300);}
.btn-outline:hover{background:var(--pink-50);}
.btn-ghost{background:transparent; color:var(--ink-700);}
.btn:disabled{opacity:.45; cursor:not-allowed; transform:none;}
.btn-block{width:100%;}
.btn-sm{padding:8px 16px; font-size:.85rem;}
.btn-danger{background:#fdeaea; color:var(--danger);}

/* ---------- Hero / Promo blocks ---------- */
.hero{padding:28px 0 8px;}
.hero-banner{
  position:relative; border-radius:var(--radius-lg); overflow:hidden; min-height:340px;
  background:linear-gradient(135deg, var(--pink-100), var(--pink-50));
  display:flex; align-items:center; box-shadow:var(--shadow-md);
}
.hero-banner img.bg{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.9;}
.hero-content{position:relative; z-index:1; padding:48px; max-width:520px;}
.hero-content h1{font-size:2.1rem; margin:0 0 14px; color:var(--pink-700);}
.hero-content p{color:var(--ink-700); margin:0 0 24px;}
.eyebrow{display:inline-block; background:#fff; color:var(--pink-600); padding:6px 14px; border-radius:999px; font-size:.8rem; font-weight:700; margin-bottom:16px;}

.promo-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin:28px 0;}
.promo-card{border-radius:var(--radius-md); overflow:hidden; position:relative; aspect-ratio:4/5; background:var(--pink-50);}
.promo-card img{width:100%; height:100%; object-fit:cover;}
.promo-card .label{
  position:absolute; bottom:0; right:0; left:0; padding:18px;
  background:linear-gradient(0deg, rgba(36,24,32,.65), transparent);
  color:#fff; font-weight:700;
}

section.section{padding:36px 0;}
.section-head{display:flex; align-items:baseline; justify-content:space-between; margin-bottom:20px;}
.section-head h2{font-size:1.4rem; margin:0;}
.section-head a{color:var(--pink-600); font-weight:600; font-size:.9rem;}

/* ---------- Product grid & cards ---------- */
.product-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:20px;}
.product-card{
  display:block; background:var(--white); border:1px solid var(--line); border-radius:var(--radius-md);
  overflow:hidden; transition:box-shadow .15s, transform .15s;
}
.product-card:hover{box-shadow:var(--shadow-md); transform:translateY(-3px);}
.product-card .thumb{aspect-ratio:1/1; background:var(--pink-50); overflow:hidden; position:relative;}
.product-card .thumb img{width:100%; height:100%; object-fit:cover;}
.discount-tag{
  position:absolute; top:10px; right:10px; background:var(--pink-500); color:#fff;
  font-size:.75rem; font-weight:700; padding:4px 9px; border-radius:8px;
}
.product-card .info{padding:14px 16px 18px;}
.product-card .name{font-weight:600; font-size:.95rem; margin:0 0 10px; min-height:2.7em;}
.price-row{display:flex; align-items:baseline; gap:8px;}
.price-old{color:var(--ink-500); text-decoration:line-through; font-size:.82rem;}
.price-now{color:var(--pink-700); font-weight:700; font-size:1.15rem;}
.price-unit{font-size:.75rem; color:var(--ink-500);}
.out-of-stock{color:var(--danger); font-size:.8rem; font-weight:600;}

/* ---------- Product detail ---------- */
.product-detail{display:grid; grid-template-columns:1.1fr 1fr; gap:44px; padding:30px 0 60px;}
.gallery-main{border-radius:var(--radius-lg); overflow:hidden; aspect-ratio:1/1; background:var(--pink-50);}
.gallery-main img{width:100%; height:100%; object-fit:cover;}
.gallery-thumbs{display:flex; gap:10px; margin-top:12px; overflow-x:auto;}
.gallery-thumbs img{width:74px; height:74px; object-fit:cover; border-radius:10px; border:2px solid transparent; cursor:pointer;}
.gallery-thumbs img.active{border-color:var(--pink-500);}
.detail-top{display:flex; align-items:center; justify-content:space-between; margin-bottom:18px;}
.detail-title{font-size:1.5rem; margin:14px 0 6px;}
.detail-desc{color:var(--ink-700); margin:20px 0; white-space:pre-line;}
.qty-control{display:flex; align-items:center; gap:14px; border:1.5px solid var(--line); border-radius:999px; padding:6px 8px; width:fit-content;}
.qty-control button{width:32px; height:32px; border-radius:50%; border:none; background:var(--pink-50); color:var(--pink-600); font-size:1.1rem;}
.detail-actions{display:flex; flex-wrap:wrap; gap:12px; margin-top:26px;}

/* ---------- Forms ---------- */
.form-page{max-width:440px; margin:60px auto; background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:36px; box-shadow:var(--shadow-sm);}
.form-page h1{font-size:1.4rem; text-align:center; margin-top:0;}
.field{margin-bottom:16px;}
.field label{display:block; margin-bottom:7px; font-size:.88rem; font-weight:600; color:var(--ink-700);}
.field input, .field textarea, .field select{
  width:100%; padding:12px 14px; border:1.5px solid var(--line); border-radius:var(--radius-sm); background:#fff;
  transition:border-color .15s;
}
.field input:focus, .field textarea:focus, .field select:focus{outline:none; border-color:var(--pink-500);}
.field-error{color:var(--danger); font-size:.8rem; margin-top:5px; display:none;}
.form-msg{padding:12px 14px; border-radius:var(--radius-sm); font-size:.88rem; margin-bottom:16px; display:none;}
.form-msg.error{display:block; background:#fdeaea; color:var(--danger);}
.form-msg.success{display:block; background:#e8f7ef; color:var(--success);}
.form-footer{text-align:center; margin-top:18px; font-size:.88rem; color:var(--ink-500);}
.form-footer a{color:var(--pink-600); font-weight:700;}

/* ---------- Cart / Checkout ---------- */
.cart-layout{display:grid; grid-template-columns:1fr 340px; gap:30px; padding:30px 0 60px; align-items:start;}
.cart-item{display:flex; gap:16px; padding:16px 0; border-bottom:1px solid var(--line);}
.cart-item img{width:88px; height:88px; object-fit:cover; border-radius:12px; background:var(--pink-50);}
.cart-item .meta{flex:1; min-width:0;}
.cart-summary{background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:24px; position:sticky; top:90px;}
.summary-row{display:flex; justify-content:space-between; margin-bottom:12px; font-size:.92rem; color:var(--ink-700);}
.summary-row.total{font-size:1.1rem; font-weight:700; color:var(--ink-900); border-top:1px solid var(--line); padding-top:14px; margin-top:8px;}
.empty-state{text-align:center; padding:80px 20px; color:var(--ink-500);}

.terms-box{max-height:360px; overflow-y:auto; border:1.5px solid var(--line); border-radius:var(--radius-md); padding:20px; background:#fffaf9; font-size:.9rem; color:var(--ink-700); line-height:2;}
.consent-row{display:flex; align-items:flex-start; gap:10px; margin:18px 0;}
.consent-row input{width:20px; height:20px; margin-top:2px; accent-color:var(--pink-500);}

/* ---------- Account layout ---------- */
.account-layout{display:grid; grid-template-columns:230px 1fr; gap:30px; padding:30px 0 60px;}
.account-sidebar{background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:14px; height:fit-content;}
.account-sidebar a{display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:12px; color:var(--ink-700); font-weight:500;}
.account-sidebar a.active, .account-sidebar a:hover{background:var(--pink-50); color:var(--pink-600);}
.account-sidebar a svg{width:19px; height:19px;}
.card{background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg); padding:22px;}
table.data-table{width:100%; border-collapse:collapse; font-size:.9rem; min-width:620px;}
.card{min-width:0; overflow-x:auto;}
table.data-table th, table.data-table td{padding:12px 10px; text-align:right; border-bottom:1px solid var(--line);}
table.data-table th{color:var(--ink-500); font-weight:600;}
.status-chip{padding:4px 12px; border-radius:999px; font-size:.78rem; font-weight:700; display:inline-block;}
.status-paid, .status-delivered, .status-answered{background:#e8f7ef; color:var(--success);}
.status-pending_payment, .status-pending, .status-open{background:#fff3e0; color:#c07a1c;}
.status-preparing, .status-shipped{background:#e6f0ff; color:#2b5fd6;}
.status-failed, .status-canceled, .status-closed{background:#fdeaea; color:var(--danger);}

/* ---------- Notifications dropdown ---------- */
.notif-panel{
  position:absolute; left:0; top:56px; width:340px; background:#fff; border:1px solid var(--line);
  border-radius:var(--radius-md); box-shadow:var(--shadow-md); max-height:420px; overflow-y:auto; display:none; z-index:60;
}
.notif-panel.open{display:block;}
.notif-item{padding:14px 16px; border-bottom:1px solid var(--line);}
.notif-item .title{font-weight:700; font-size:.88rem; margin-bottom:4px;}
.notif-item .msg{font-size:.82rem; color:var(--ink-700);}
.notif-item .time{font-size:.72rem; color:var(--ink-500); margin-top:4px;}
.notif-empty{padding:30px; text-align:center; color:var(--ink-500); font-size:.88rem;}

/* ---------- Loader ---------- */
.dots-loader{display:flex; gap:6px; justify-content:center; padding:40px 0;}
.dots-loader span{width:9px; height:9px; border-radius:50%; background:var(--pink-400,var(--pink-500)); animation:dot-bounce 1s infinite ease-in-out;}
.dots-loader span:nth-child(2){animation-delay:.15s;}
.dots-loader span:nth-child(3){animation-delay:.3s;}
@keyframes dot-bounce{0%,80%,100%{transform:translateY(0); opacity:.4;} 40%{transform:translateY(-7px); opacity:1;}}

/* ---------- Footer ---------- */
.site-footer{background:var(--ink-900); color:#f6e9ee; margin-top:60px;}
.footer-grid{display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:30px; padding:50px 0 30px;}
.footer-grid h4{color:#fff; margin:0 0 16px; font-size:.95rem;}
.footer-grid a{display:block; color:#d9c3cc; margin-bottom:10px; font-size:.88rem;}
.footer-bottom{border-top:1px solid rgba(255,255,255,.1); padding:18px 0; text-align:center; font-size:.8rem; color:#c9b4bd;}
.trust-badge-slot{width:90px; height:90px; background:rgba(255,255,255,.06); border:1px dashed rgba(255,255,255,.25); border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:.65rem; color:#c9b4bd; text-align:center;}

/* ---------- Utility ---------- */
.sr-only{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap;}
.text-center{text-align:center;}
.mt-2{margin-top:20px;}

/* ---------- Responsive ---------- */
@media (max-width:960px){
  .main-nav.open-mobile{
    position:absolute;
    top:calc(100% + 1px);
    right:20px;
    left:20px;
    z-index:70;
    display:flex;
    flex-direction:column;
    gap:0;
    padding:8px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:0 0 var(--radius-md) var(--radius-md);
    box-shadow:var(--shadow-md);
  }
  .main-nav.open-mobile a{
    display:block;
    padding:11px 14px;
    border-radius:10px;
  }
  .product-grid{grid-template-columns:repeat(2,1fr);}
  .promo-grid{grid-template-columns:1fr 1fr;}
  .product-detail{grid-template-columns:1fr; gap:24px;}
  .cart-layout{grid-template-columns:1fr;}
  .account-layout{grid-template-columns:1fr;}
  .main-nav{display:none;}
  .menu-toggle{display:flex;}
}
@media (max-width:560px){
  .container{padding-left:14px; padding-right:14px;}
  .header-inner{height:64px; gap:4px;}
  .logo{font-size:1.25rem;}
  .header-actions{gap:0;}
  .icon-btn{width:38px; height:38px;}
  .hero{padding-top:14px;}
  .hero-content{padding:22px;}
  .hero-content .btn{width:100%;}
  .detail-actions .btn{flex:1 1 100%;}
  .cart-item{gap:10px;}
  .cart-item img{width:72px; height:72px;}
  .form-page{margin:30px auto; padding:24px 18px;}

  .product-grid{grid-template-columns:1fr 1fr; gap:12px;}
  .promo-grid{grid-template-columns:1fr;}
  .hero-content{padding:28px;}
  .hero-content h1{font-size:1.5rem;}
  .footer-grid{grid-template-columns:1fr 1fr; padding:34px 0;}
  .notif-panel{width:92vw; left:4vw;}
}

/* ==================================================
   صفحه اصلی جدید: دسته‌بندی دایره‌ای + جستجو و فیلتر
   ================================================== */
.category-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:18px;overflow:visible;}
.category-item{display:flex;flex-direction:column;align-items:center;gap:9px;color:var(--ink-900);min-width:0;text-align:center;}
.category-item strong{font-size:.86rem;overflow-wrap:anywhere;line-height:1.5;}
.category-circle{width:92px;height:92px;border-radius:50%;background:var(--pink-50);border:1px solid var(--line);display:grid;place-items:center;overflow:hidden;box-shadow:var(--shadow-sm);transition:transform .18s,box-shadow .18s;}
.category-item:hover .category-circle{transform:translateY(-3px);box-shadow:var(--shadow-md);}
.category-circle img{width:100%;height:100%;object-fit:cover;}
.category-icon{font-size:2.1rem;line-height:1;display:grid;place-items:center;width:100%;height:100%;}
.category-icon svg{width:42px;height:42px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
.home-product-toolbar,.product-toolbar{display:flex;gap:10px;align-items:center;margin:0 0 14px;}
.home-search-wrap{position:relative;flex:1;min-width:0;}
.home-search-wrap svg{position:absolute;right:15px;top:50%;transform:translateY(-50%);width:19px;height:19px;color:var(--ink-500);pointer-events:none;}
.home-search-wrap input{width:100%;padding:13px 44px 13px 16px;border:1.5px solid var(--line);border-radius:999px;background:#fff;min-width:0;}
.filter-icon-btn{display:inline-flex;align-items:center;gap:7px;justify-content:center;min-width:88px;padding:11px 14px;border:1.5px solid var(--line);border-radius:999px;background:#fff;color:var(--ink-700);cursor:pointer;}
.filter-icon-btn svg{width:19px;height:19px;}
.filter-panel[hidden]{display:none !important;}
.filter-panel{display:grid;grid-template-columns:1.2fr 1fr 1fr auto auto;gap:10px;align-items:end;padding:14px;margin-bottom:20px;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow-sm);}
.filter-panel label{font-size:.78rem;color:var(--ink-500);font-weight:600;}
.filter-panel input,.filter-panel select{display:block;width:100%;margin-top:6px;padding:10px 12px;border:1.5px solid var(--line);border-radius:10px;background:#fff;min-width:0;}
.about-card{display:grid;grid-template-columns:1.5fr 1fr;gap:30px;padding:28px;background:linear-gradient(135deg,#fff,#fff8fb);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow-sm);}
.about-card h2{margin:8px 0 12px;font-size:1.5rem;color:var(--pink-700);}
.about-card p{line-height:2;color:var(--ink-700);white-space:pre-line;overflow-wrap:anywhere;}
.about-contact{display:flex;flex-direction:column;gap:10px;justify-content:center;min-width:0;}
.about-contact a{color:var(--pink-700);overflow-wrap:anywhere;}
.about-contact p{margin:0;font-size:.9rem;}

@media (max-width:960px){
  .category-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;}
  .category-circle{width:82px;height:82px;}
  .filter-panel{grid-template-columns:1fr 1fr;}
  .filter-panel .btn{width:100%;}
  .about-card{grid-template-columns:1fr;gap:14px;}
}
@media (max-width:560px){
  .category-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 7px;}
  .category-circle{width:68px;height:68px;}
  .category-icon{font-size:1.55rem;}
  .category-icon svg{width:30px;height:30px;}
  .category-item strong{font-size:.72rem;}
  .home-product-toolbar{gap:7px;}
  .filter-icon-btn{min-width:48px;width:48px;padding:10px;font-size:0;}
  .filter-icon-btn svg{width:20px;height:20px;}
  .filter-panel{grid-template-columns:1fr;}
  .about-card{padding:20px 16px;}
  .home-search-wrap input{font-size:.82rem;}
}

/* جلوگیری از بیرون‌زدگی متن و کنترل بهتر عناصر در موبایل‌های باریک */
*,*::before,*::after{box-sizing:border-box;}
img,svg{max-width:100%;}
h1,h2,h3,h4,p,a,button,input,select,textarea{overflow-wrap:anywhere;word-break:normal;min-width:0;}
.product-card .name,.product-card .description,.product-card .price-now,.product-card .price-old{overflow-wrap:anywhere;word-break:break-word;}
.product-card{min-width:0;}
.product-card .info{min-width:0;}
input,select,textarea,button{font:inherit;}
@media (max-width:380px){
  .container{padding-left:10px;padding-right:10px;}
  .header-inner{gap:1px;}
  .header-actions{gap:0;}
  .icon-btn{width:34px;height:34px;}
  .logo{font-size:1.05rem;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .category-circle{width:60px;height:60px;}
  .category-item strong{font-size:.68rem;}
  .product-grid{gap:9px;}
  .product-card .info{padding:11px 10px 13px;}
  .product-card .name{font-size:.82rem;}
  .price-now{font-size:.92rem;}
}
