/* =========================================================
   Khuzestan Plastic Cluster — Light Theme (Final)
   File: assets/css/style.css
   Notes:
   - RTL / Responsive
   - “Plastic-friendly” glass + soft industrial gradients
   - Ready for later Dark/Light toggle (we’ll wrap tokens later)
   ========================================================= */

/* ====== Theme Tokens (LIGHT) ====== */
:root{
  /* Light Plastic UI Tokens */
  --bg:#f6f8fc;
  --surface:#ffffff;
  --card:rgba(255,255,255,.86);

  --text:#0f172a;
  --muted:#5b6b83;

  --primary:#16a34a;   /* green */
  --accent:#ea580c;    /* orange */
  --teal:#06b6d4;      /* polymer vibe */

  --line:rgba(15,23,42,.10);
  --line-strong:rgba(15,23,42,.14);

  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --shadow-soft: 0 6px 16px rgba(15,23,42,.06);

  --radius:18px;
  --max:1150px;

  /* glass / glows */
  --glass: blur(14px);
  --glow-green: rgba(22,163,74,.14);
  --glow-orange: rgba(234,88,12,.12);
  --glow-teal: rgba(6,182,212,.12);
}

/* ====== Base ====== */
*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  direction: rtl;
  color:var(--text);

  /* plastic-ish background */
  background:
    radial-gradient(900px 650px at 80% 0%, var(--glow-green), transparent 55%),
    radial-gradient(900px 650px at 20% 10%, var(--glow-orange), transparent 55%),
    radial-gradient(1000px 700px at 50% 100%, var(--glow-teal), transparent 60%),
    var(--bg);
}

a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}
.container{max-width:var(--max); margin:0 auto; padding:0 16px}
.sep{height:1px; background:var(--line); margin:18px 0}
.small{font-size:12px; color:rgba(91,107,131,.9)}

/* ====== Badge ====== */
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  font-size:13px;
  background: rgba(255,255,255,.7);
  backdrop-filter: var(--glass);
}

/* ====== Buttons ====== */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:10px;
  padding:12px 16px;
  border-radius:14px;
  border:1px solid var(--line);
  cursor:pointer;
  transition:.18s ease;
  font-weight:700;
  background: rgba(255,255,255,.75);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(15,23,42,.06);
}
.btn:hover{transform: translateY(-1px); box-shadow: var(--shadow)}
.btn:active{transform: translateY(0px)}
.btn-primary{
  background: linear-gradient(135deg, rgba(22,163,74,.98), rgba(22,163,74,.72));
  border-color: rgba(22,163,74,.25);
  color:#fff;
}
.btn-accent{
  background: linear-gradient(135deg, rgba(234,88,12,.98), rgba(234,88,12,.72));
  border-color: rgba(234,88,12,.25);
  color:#fff;
}
.btn-ghost{
  background: rgba(255,255,255,.25);
}

/* ====== Cards ====== */
.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--glass);
}
.card:hover{
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.card-pad{padding:16px}

/* ====== KPI ====== */
.kpi{
  padding:16px;
  border-radius: var(--radius);
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.68));
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--glass);
}
.kpi .num {
    font-size: 34px;
    /* قبلاً ~26px بود */
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.8px;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.kpi .lbl{color:var(--muted); font-size:13px; margin-top:6px}

/* ====== Grid helpers ====== */
.grid{display:grid; gap:14px}
.grid-2{grid-template-columns: repeat(2, minmax(0,1fr))}
.grid-3{grid-template-columns: repeat(3, minmax(0,1fr))}
.grid-4{grid-template-columns: repeat(4, minmax(0,1fr))}

@media (max-width: 980px){
  .grid-4{grid-template-columns: repeat(2, minmax(0,1fr))}
  .grid-3{grid-template-columns: repeat(2, minmax(0,1fr))}
}
@media (max-width: 640px){
  .grid-2,.grid-3,.grid-4{grid-template-columns: 1fr}
}

/* ====== Header / Nav ====== */
.header{
  position: sticky; top:0; z-index:50;
  backdrop-filter: var(--glass);
  background: rgba(246,248,252,.72);
  border-bottom:1px solid var(--line);
}

.nav{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 0;
}
.brand{display:flex; align-items:center; gap:12px}

.logo{
  width:38px; height:38px; border-radius:14px;
  background: linear-gradient(135deg, rgba(22,163,74,.95), rgba(6,182,212,.70), rgba(234,88,12,.85));
  box-shadow: 0 10px 24px rgba(15,23,42,.10);
}

.brand .t1{font-weight:900}
.brand .t2{color:var(--muted); font-size:12px; margin-top:2px}

.menu{display:flex; gap:10px; align-items:center}
.menu a{
  padding:10px 12px;
  border-radius:12px;
  color:var(--muted);
  border:1px solid transparent;
}
.menu a.active, .menu a:hover{
  color:var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,.70);
  box-shadow: 0 6px 16px rgba(15,23,42,.05);
}

.nav-actions{display:flex; gap:10px; align-items:center}
.burger{display:none}
@media (max-width: 880px){
  .menu{display:none}
  .burger{display:inline-flex}
}

/* ====== Mobile Drawer ====== */
.drawer{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.30);
  z-index: 1000;

  /* Use opacity + pointer-events so it works reliably on mobile and
     avoids layout thrashing (better than display:none). */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.drawer.open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.drawer-panel{
  position:absolute;
  right:0;
  top:0;
  height:100%;
  width:min(360px, 92vw);
  background: rgba(255,255,255,.92);
  border-left:1px solid var(--line);
  box-shadow: -18px 0 36px rgba(0,0,0,.12);
  padding: 14px;
  border-radius: 0 0 0 22px;
  overflow:auto;

  transform: translateX(14px);
  transition: transform .18s ease;
}
.drawer.open .drawer-panel{ transform: translateX(0); }

.drawer-panel a{
  display:block;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
}
.drawer-panel a:hover{background: rgba(2,132,199,.10)}
.drawer-panel a.active{background: rgba(34,197,94,.16)}

/* Prevent background scroll when drawer is open */
body.drawer-open{ overflow: hidden; }
/* ====== Footer ====== */
.footer{
  margin-top:28px;
  border-top:1px solid var(--line);
  padding:18px 0 24px;
  color:var(--muted);
}
.footer .cols{display:grid; grid-template-columns: 2fr 1fr 1fr; gap:14px}
.footer a{color:var(--muted)}
.footer a:hover{color:var(--text)}
@media (max-width: 820px){
  .footer .cols{grid-template-columns: 1fr}
}

/* ====== Minor polish ====== */
ul{padding-inline-start: 18px}
li{margin: 6px 0}
/* =========================================================
   Home Widgets: News Slider + Categories + Mini Ads + Marquee
   ========================================================= */

/* ---------- News Slider ---------- */
.news-slider {
    position: relative;
    overflow: hidden;
    padding: 16px;
}

.news-track {
    display: flex;
    gap: 14px;
    transition: transform .45s ease;
    will-change: transform;
}

.news-slide {
    min-width: 100%;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background:
        radial-gradient(520px 220px at 90% 10%, rgba(22, 163, 74, .12), transparent 62%),
        radial-gradient(520px 220px at 10% 25%, rgba(234, 88, 12, .10), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .72));
    box-shadow: var(--shadow-soft);
}

@media (min-width: 900px) {
    .news-slide {
        min-width: calc(50% - 7px);
    }
}

@media (min-width: 1200px) {
    .news-slide {
        min-width: calc(33.333% - 10px);
    }
}

.news-cover {
    height: 120px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background:
        radial-gradient(360px 160px at 20% 30%, rgba(6, 182, 212, .16), transparent 60%),
        radial-gradient(360px 160px at 80% 30%, rgba(22, 163, 74, .14), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .65));
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 12px;
}

.news-chip {
    font-size: 12px;
    font-weight: 800;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .75);
    color: var(--muted);
}

.chip-teal {
    box-shadow: 0 0 0 4px rgba(6, 182, 212, .10) inset;
}

.chip-orange {
    box-shadow: 0 0 0 4px rgba(234, 88, 12, .10) inset;
}

.news-date {
    font-size: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, .70);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 10px;
}

.news-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.6;
}

.news-desc {
    margin: 0;
    color: var(--muted);
    line-height: 1.9;
}

.news-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.news-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .85);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-nav:hover {
    box-shadow: var(--shadow);
}

.news-nav.prev {
    right: 12px;
}

.news-nav.next {
    left: 12px;
}

.news-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.news-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .85);
    cursor: pointer;
}

.news-dot.active {
    width: 22px;
    background: linear-gradient(135deg, rgba(22, 163, 74, .95), rgba(6, 182, 212, .55));
}

/* ---------- Category Cards ---------- */
.cat-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px;
}

.cat-ico {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(6, 182, 212, .10), rgba(22, 163, 74, .10));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.cat-title {
    font-weight: 900;
}

.cat-sub {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ---------- Mini Ads ---------- */
.mini-ad-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.pill {
    font-size: 12px;
    font-weight: 900;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .75);
    color: var(--muted);
}

.pill-green {
    box-shadow: 0 0 0 4px rgba(22, 163, 74, .10) inset;
}

.pill-orange {
    box-shadow: 0 0 0 4px rgba(234, 88, 12, .10) inset;
}

.pill-teal {
    box-shadow: 0 0 0 4px rgba(6, 182, 212, .10) inset;
}

.mini-ad-title {
    font-weight: 900;
    margin: 0 0 6px;
}

.mini-ad-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------- Logo Marquee ---------- */
.logo-marquee {
    overflow: hidden;
    padding: 14px;
}

.logo-track {
    display: flex;
    gap: 12px;
    width: max-content;
    animation: marquee 22s linear infinite;
}

.logo-item {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .75);
    color: var(--muted);
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo-track {
        animation: none;
    }
}

/* ===============================
   Responsive Patch (Mobile Fix)
   =============================== */

/* 1) Header: prevent overflow */
.brand-text{min-width:0}
.brand .t1{line-height:1.3}
@media (max-width: 640px){
  .nav{gap:10px}
  .brand{min-width:0}
  .brand .t1{
    font-size:14px;
    max-width:52vw;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .brand .t2{display:none}
  .logo{width:34px; height:34px; border-radius:12px}
  .nav-actions{gap:8px}
  .nav-actions .btn{padding:10px 12px; font-size:13px}
}

/* 2) Hero typography */
@media (max-width: 640px){
  .hero h1{font-size:26px !important; line-height:1.55}
}

/* 3) Toolbars & filters wrap correctly */
.toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.pager{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-start;
}

/* 4) Inputs/select in toolbars become full-width on mobile */
@media (max-width: 640px){
  .filters .input,
  .filters select,
  .filters button{
    width:100%;
  }
}

/* 5) Slider arrows on small screens */
@media (max-width: 640px){
  .news-nav{display:none}
}

/* Extra mobile hardening (very small screens) */
@media (max-width: 640px){
  .hero-cta{width:100%}
  .hero-cta .btn{width:100%}

  .searchbar{width:100%}
  .searchbar .input,
  .searchbar select,
  .searchbar .btn{width:100%}
}

@media (max-width: 520px){
  .item{flex-direction:column; align-items:flex-start}
  .item .thumb{width:100%; height:110px}
  .item-actions{width:100%}
  .item-actions .btn{width:100%}

  .news-slide{padding:14px}
}
/* ===============================
   KPI UI Upgrade
   =============================== */
.kpi {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    background: radial-gradient(1200px 400px at 20% 0%, rgba(255, 255, 255, .10), transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
    border-radius: 18px;
    padding: 14px 14px 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .10);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.kpi::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: linear-gradient(90deg, rgba(34, 197, 94, .35), rgba(249, 115, 22, .28), rgba(20, 184, 166, .25));
    opacity: .25;
    filter: blur(18px);
    pointer-events: none;
}

.kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .14);
    border-color: rgba(255, 255, 255, .16);
}

.kpi .num {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.kpi .lbl {
    margin-top: 6px;
    opacity: .85;
    font-weight: 600;
}

/* یک ریز افکت جداکننده کوچک */
.kpi .lbl::before {
    content: "";
    display: block;
    width: 26px;
    height: 3px;
    border-radius: 99px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, rgba(34, 197, 94, .9), rgba(249, 115, 22, .85));
    opacity: .75;
}