﻿/* BUILD: v6 */
/* ============================================================
   app_list.css — استایل صفحات فهرست و قالب مشترک
   ============================================================ */

/* ---------- سربرگ صفحات داخلی ---------- */
.page-head{
  position:relative; flex:none; z-index:5;
  display:flex; align-items:center; gap:var(--s2);
  padding:calc(14px + env(safe-area-inset-top, 0px)) var(--s4) 14px;
  background:var(--ink-grad);
  border-bottom:2px solid rgba(201,161,59,.55);
  color:#fff;
  border-radius:0 0 22px 22px;
  box-shadow:0 6px 18px rgba(0,0,0,.22);
}
.page-head__back{
  flex:none; width:38px; height:38px; border-radius:12px;
  background:rgba(255,255,255,.08); color:var(--go-light); border:1px solid rgba(201,161,59,.35);
  display:grid; place-items:center;
}
.page-head__back svg{ width:20px; height:20px; }
.page-head__title{ font-size:17px; font-weight:800; }

/* نوار جستجوی داخل سربرگ */
.page-search{
  display:flex; align-items:center; gap:var(--s3);
  margin:var(--s3) var(--s4) 0;
  height:46px; padding:0 var(--s4);
  background:#fff; border-radius:var(--r-md); box-shadow:var(--sh-2);
}
.page-search svg{ width:19px; height:19px; color:var(--text-3); flex:none; }
.page-search input{ flex:1; min-width:0; border:0; outline:none; background:none; font-size:var(--fs-body); }

/* ---------- شبکه فهرست ---------- */
.list-wrap{ padding:var(--s4) var(--s4) 120px; }

.grid-2{ display:grid; grid-template-columns:repeat(2,1fr); gap:var(--s3); }
.grid-1{ display:flex; flex-direction:column; gap:var(--s3); }
.grid-part{ display:contents; }

/* ---------- کارت اصناف و مراکز ---------- */
.lcard{
  background:var(--surface); border-radius:var(--r-lg);
  box-shadow:var(--sh-1); overflow:hidden;
  display:flex; flex-direction:column;
}
.lcard__top{ display:block; }
.lcard__img{
  display:block; position:relative; width:100%; height:0; padding-top:100%;
  background-size:cover; background-position:center; background-color:var(--surface-2);
}
.lcard__img--empty{
  display:grid; place-items:center; padding-top:0; height:auto; aspect-ratio:auto;
}
/* حالت بدون عکس: مربع با آیکن وسط، بدون aspect-ratio (وب‌ویو اندروید ۷) */
.lcard__img--empty{
  height:0; padding-top:100%;
  background:linear-gradient(135deg,#1D1C20,#3A3222);
}
.lcard__img--empty svg{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:34px; height:34px; color:var(--go-light);
}
.lcard__b{ padding:10px var(--s3) 6px; flex:1; }
.lcard__t{
  font-size:13px; font-weight:900; color:var(--text); line-height:1.7;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.lcard__s{ font-size:var(--fs-xs); color:var(--text-3); margin-top:3px; }
.lcard__off{
  display:inline-block; margin-top:5px;
  background:var(--gold-soft); color:var(--go-dark); border:1px solid #E8D9AE;
  font-size:11px; font-weight:800; padding:2px 9px; border-radius:999px;
}

/* چهار دکمه زیر کارت */
.lcard__acts{
  display:flex; align-items:stretch;
  border-top:1px solid var(--surface-2);
}
.lact{
  flex:none; width:38px; display:grid; place-items:center;
  padding:9px 0; color:var(--text-2); background:none;
}
.lact + .lact{ border-inline-start:1px solid var(--surface-2); }
.lact svg{ width:17px; height:17px; }
.lact--view{
  flex:1; display:flex; align-items:center; justify-content:center; gap:5px;
  color:var(--text-2); font-size:var(--fs-xs); font-weight:800;
}
.lact--fav.is-on{ color:var(--go); }
.lact.is-disabled{ opacity:.32; pointer-events:none; }
.lact:active{ background:var(--surface-2); }

/* ---------- کارت خبر ---------- */
.ncard{
  display:block; background:var(--surface); border-radius:var(--r-lg);
  box-shadow:var(--sh-1); overflow:hidden; color:inherit;
}
.ncard__img{ display:block; height:170px; background-size:cover; background-position:center; }
.ncard__b{ padding:var(--s4); }
.ncard__tag{
  display:inline-block; font-size:10px; font-weight:800;
  color:var(--go-dark); background:var(--go-soft); padding:2px 9px; border-radius:999px;
}
.ncard__t{ font-size:15px; font-weight:900; color:var(--text); line-height:1.8; margin-top:6px; }
.ncard__s{ font-size:var(--fs-sm); color:var(--text-2); line-height:1.9; margin-top:5px; }
.ncard__f{ display:flex; align-items:center; margin-top:10px; font-size:var(--fs-xs); color:var(--text-3); }
.ncard__go{
  margin-inline-start:auto; width:28px; height:28px; border-radius:9px;
  background:var(--go-soft); color:var(--go-dark); display:grid; place-items:center;
}
.ncard__go svg{ width:15px; height:15px; }

/* ---------- کارت دوره ---------- */
.ccard{
  display:flex; gap:var(--s3); padding:var(--s3);
  background:var(--surface); border-radius:var(--r-lg); box-shadow:var(--sh-1); color:inherit;
}
.ccard .lcard__img,
.ccard .lcard__img--empty{ flex:none; width:96px; padding-top:96px; border-radius:var(--r-md); }
.ccard__b{ flex:1; min-width:0; display:flex; flex-direction:column; }
.ccard__inst{ font-size:11px; font-weight:800; color:var(--go-dark); }
.ccard__t{ font-size:14px; font-weight:900; color:var(--text); line-height:1.7; margin-top:3px; }
.ccard__f{ display:flex; align-items:center; margin-top:auto; padding-top:8px; }
.ccard__p{ font-size:13px; font-weight:900; color:var(--go-dark); }
.ccard__p small{ font-size:10px; font-weight:600; color:var(--text-3); }

/* ---------- حالت خالی و اسکلت ---------- */
.empty-box{
  grid-column:1 / -1; text-align:center; padding:40px 16px;
  display:flex; flex-direction:column; align-items:center; gap:8px;
}
.empty-box b{ font-size:var(--fs-body); }
.empty-box span{ font-size:var(--fs-sm); color:var(--text-2); }

.skel-wrap{ display:contents; }
.skel--lcard{ height:230px; border-radius:var(--r-lg); }
.skel--ncard{ height:150px; border-radius:var(--r-lg); }

/* ---------- برگه پایین مشترک ---------- */
.sheet-modal{ position:fixed; inset:0; z-index:300; display:flex; align-items:flex-end; }
.sheet-modal[hidden]{ display:none !important; }
.sheet-modal__backdrop{ position:absolute; inset:0; background:rgba(13,13,15,.45); }
.sheet-modal__card{
  position:relative; width:100%; background:var(--surface);
  border-radius:var(--r-xl) var(--r-xl) 0 0; box-shadow:var(--sh-3);
  padding:var(--s5) var(--s5) calc(var(--s6) + env(safe-area-inset-bottom, 0px));
  animation:sheetUp .26s var(--ease);
}
@keyframes sheetUp{ from{ transform:translateY(28px); opacity:0; } to{ transform:none; opacity:1; } }
.sheet-modal__close{
  position:absolute; top:12px; inset-inline-end:12px;
  width:32px; height:32px; border-radius:50%;
  background:var(--surface-2); color:var(--text-2); display:grid; place-items:center;
}
.sheet-modal__close svg{ width:17px; height:17px; }
.sheet-modal__title{ font-size:17px; font-weight:900; }
.sheet-modal__sub{ font-size:var(--fs-sm); color:var(--text-2); margin-top:3px; }

.share-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:var(--s2); margin-top:var(--s4); }
.share-btn{
  display:flex; align-items:center; gap:9px;
  padding:12px var(--s4); border-radius:var(--r-md);
  background:var(--surface-2); color:var(--text);
  font-size:var(--fs-sm); font-weight:700; text-align:right;
}
.share-btn__dot{ width:12px; height:12px; border-radius:50%; flex:none; }
.share-btn:active{ background:var(--go-soft); }

/* ---------- پیام کوتاه ---------- */
.toast{
  position:fixed; bottom:96px; left:50%; transform:translateX(-50%) translateY(16px);
  z-index:400; max-width:82%;
  background:var(--ink); color:#fff;
  padding:11px var(--s5); border-radius:var(--r-full);
  font-size:var(--fs-sm); font-weight:600; text-align:center;
  box-shadow:0 10px 26px rgba(20,16,8,.4);
  opacity:0; pointer-events:none; transition:opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-on{ opacity:1; transform:translateX(-50%) translateY(0); }
