@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #0b0a08;
  --panel: #12100d;
  --panel2: #18150f;
  --gold: #d6b36a;
  --gold-light: #f0d99a;
  --text: #f5f0e7;
  --muted: #a49b8c;
  --line: rgba(214,179,106,.19);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Vazirmatn', Tahoma, sans-serif; line-height: 1.9;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
::selection { background: var(--gold); color: #111; }

.topbar {
  height: 82px; padding: 0 7%; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line);
  background: rgba(11,10,8,.82); position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center; width: 45px; height: 45px;
  border: 1px solid var(--gold); border-radius: 50%; color: var(--gold);
  font-size: 25px;
}
.brand b { display: block; letter-spacing: 4px; font-size: 16px; color: var(--gold-light); }
.brand small { display: block; font-size: 8px; letter-spacing: 2px; color: var(--muted); line-height: 1.3; }
nav { display: flex; gap: 28px; font-size: 13px; color: #d3cbbb; }
nav a { transition: color .2s; }
nav a:hover { color: var(--gold-light); }

.hero {
  min-height: 520px; padding: 70px 10%; display: grid; grid-template-columns: 1.1fr .9fr;
  align-items: center; gap: 40px; overflow: hidden;
  background: radial-gradient(ellipse at 75% 50%, rgba(42,33,18,.85) 0, rgba(21,17,11,.55) 29%, transparent 70%);
  border-bottom: 1px solid var(--line);
}
.hero-copy { max-width: 550px; }
.eyebrow { font-size: 10px; letter-spacing: 3px; color: var(--gold); font-weight: 600; }
.hero h1 { font-size: clamp(38px, 5.5vw, 66px); line-height: 1.5; margin: 12px 0; font-weight: 500; }
.hero h1 em { color: var(--gold-light); font-style: normal; }
.hero p { color: var(--muted); max-width: 410px; font-size: 14px; margin-bottom: 28px; }
.gold-button, .outline-button {
  min-height: 46px; padding: 10px 22px; display: inline-flex; align-items: center;
  justify-content: center; gap: 14px; border: 1px solid var(--gold);
  font-size: 12px; transition: .2s ease;
}
.gold-button { color: #171107; background: linear-gradient(120deg, var(--gold-light), #bd9143); font-weight: 700; }
.gold-button:hover { filter: brightness(1.12); transform: translateY(-2px); }
.outline-button { color: var(--gold-light); background: transparent; }
.outline-button:hover { background: rgba(214,179,106,.1); }

.hero-art { min-height: 330px; display: grid; place-items: center; position: relative; }
.art-ring {
  width: min(270px, 70vw); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(240,217,154,.7);
  box-shadow: 0 0 0 12px rgba(214,179,106,.035), 0 0 0 35px rgba(214,179,106,.025), inset 0 0 55px rgba(214,179,106,.09);
  position: relative;
}
.art-ring:before, .art-ring:after {
  content: ""; position: absolute; border: 1px solid var(--gold);
  width: 54%; height: 54%; top: 23%; left: 23%; transform: rotate(45deg);
}
.art-ring:after { transform: rotate(0); width: 35%; height: 35%; top: 32.5%; left: 32.5%; }
.art-orbit { position: absolute; width: 320px; max-width: 90%; height: 110px; border: 1px solid rgba(214,179,106,.65); border-radius: 50%; transform: rotate(-35deg); }
.art-caption { position: absolute; text-align: center; font-size: 10px; line-height: 1.8; letter-spacing: 4px; color: var(--gold-light); }

.section { padding: 78px 8%; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 30px; }
.section-heading h2, .contact-section h2 { font-size: clamp(25px, 3vw, 35px); font-weight: 500; margin: 4px 0 0; }
.live-label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 9px; }
.live-label i { width: 7px; height: 7px; border-radius: 50%; background: #c69d4c; display: inline-block; }

.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.market-card, .chart-panel {
  border: 1px solid var(--line); background: linear-gradient(140deg, #17140e, #100e0b);
  padding: 24px; border-radius: var(--radius);
}
.market-card { min-height: 150px; display: flex; flex-direction: column; gap: 10px; }
.market-card > span { color: var(--muted); font-size: 12px; }
.market-card strong { color: var(--gold-light); font-size: 23px; font-weight: 600; }
.market-card strong small, .product-bottom strong small { font-size: 11px; font-weight: 400; }
.muted { color: var(--muted); font-size: 11px; }
.chart-panel { margin-top: 16px; }
.chart-panel h3 { font-size: 16px; font-weight: 500; margin: 0; }
.chart-panel p { color: var(--muted); font-size: 12px; margin: 5px 0 12px; }
#marketChart { display: block; width: 100%; max-height: 240px; }

.products-section { background: rgba(14,12,9,.62); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #14110d; transition: transform .25s, border-color .25s; }
.product-card:hover { transform: translateY(-5px); border-color: rgba(214,179,106,.55); }
.product-image { height: 245px; position: relative; overflow: hidden; background: #201a10; }
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.product-card:hover .product-image img { transform: scale(1.04); }
.image-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; background: radial-gradient(circle, #302514, #13100b 70%); color: var(--gold); }
.image-placeholder span { font-family: Georgia,serif; font-size: 74px; }
.image-placeholder small { font-size: 9px; letter-spacing: 3px; }
.product-category { position: absolute; top: 12px; right: 12px; padding: 3px 10px; font-size: 10px; background: rgba(8,7,5,.8); border: 1px solid var(--line); color: var(--gold-light); }
.product-info { padding: 18px; }
.product-info h3 { font-size: 16px; font-weight: 500; margin: 0; }
.product-info > p { font-size: 12px; color: var(--muted); min-height: 24px; margin: 6px 0 12px; }
.product-bottom { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.product-bottom strong { color: var(--gold-light); font-size: 15px; }
.product-bottom a { font-size: 11px; color: var(--gold); }
.empty-state { text-align: center; padding: 60px 15px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state > span { color: var(--gold); font-size: 30px; }
.empty-state h3 { font-size: 18px; font-weight: 500; }
.empty-state p { color: var(--muted); font-size: 12px; }

.contact-section { text-align: center; padding: 75px 8%; background: radial-gradient(ellipse at center top, rgba(33,25,13,.9), transparent 70%); }
.contact-section h2 { margin: 10px 0; }
.contact-section p { max-width: 650px; margin: 14px auto 25px; color: var(--muted); font-size: 13px; }
.contact-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

footer { text-align: center; border-top: 1px solid var(--line); padding: 28px 15px; }
.footer-brand { color: var(--gold-light); letter-spacing: 5px; font-size: 18px; }
footer p { margin: 5px 0; font-size: 12px; color: var(--muted); }
footer small { color: #71695d; font-size: 9px; letter-spacing: 2px; }

@media (max-width: 760px) {
  .topbar { height: auto; min-height: 72px; padding: 12px 5%; flex-wrap: wrap; }
  nav { width: 100%; justify-content: space-between; gap: 10px; font-size: 11px; padding-bottom: 5px; }
  .hero { grid-template-columns: 1fr; text-align: center; padding: 50px 7% 25px; gap: 0; }
  .hero-copy { margin: auto; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-art { min-height: 280px; }
  .art-ring { width: 210px; }
  .section { padding: 55px 5%; }
  .section-heading { align-items: start; flex-direction: column; }
  .market-grid { grid-template-columns: 1fr; gap: 10px; }
  .market-card { min-height: 120px; padding: 19px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .product-image { height: 175px; }
  .product-info { padding: 12px; }
  .product-info h3 { font-size: 14px; }
  .product-bottom { align-items: start; flex-direction: column; }
}
@media (max-width: 390px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-image { height: 240px; }
}

/* Admin authentication */
.admin-body { min-height: 100vh; display: flex; flex-direction: column; }
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 45px 18px; }
.auth-card { width: 100%; max-width: 440px; padding: 34px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 80px #0005; }
.auth-card h1 { font-size: 26px; font-weight: 500; margin: 14px 0 0; }
.auth-description { color: var(--muted); font-size: 13px; margin: 4px 0 25px; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card label { color: #ded3bd; font-size: 12px; margin-top: 7px; }
.auth-card input, .auth-card textarea, .auth-card select {
  width: 100%; min-height: 46px; padding: 10px 12px; color: var(--text);
  background: #0b0a08; border: 1px solid #393023; border-radius: 9px; outline: none;
}
.auth-card input:focus { border-color: var(--gold); }
.auth-submit { width: 100%; margin-top: 15px; cursor: pointer; }
.auth-footnote { margin: 20px 0 0; font-size: 11px; color: var(--muted); }
.auth-footnote a { color: var(--gold-light); }
.notice { padding: 11px 13px; margin: 16px 0; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.notice.error { color: #ffb5a8; border-color: #793e34; background: #351b18; }
.notice.success { color: #d5efbe; border-color: #476336; background: #1b2815; }

/* Admin dashboard */
.logout-form { margin: 0; }
.logout-form button { cursor: pointer; min-height: 38px; padding: 5px 14px; }
.dashboard { width: min(1200px, 92%); margin: 0 auto; padding: 38px 0 65px; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 28px; }
.dashboard-heading h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 500; margin: 4px 0; }
.dashboard-heading p, .panel-description { color: var(--muted); font-size: 12px; margin: 0; }
.admin-status { white-space: nowrap; color: #d4e8b6; font-size: 11px; }
.admin-status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #9ac56b; margin-left: 5px; }
.admin-panel { margin-top: 22px; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel-heading h2 { font-size: 19px; font-weight: 500; margin: 4px 0 0; }
.count { display: inline-grid; place-items: center; min-width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 50%; font-size: 11px; color: var(--gold); }
.admin-form { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; align-items: end; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field label { font-size: 12px; color: #d8cdb7; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; min-width: 0; min-height: 43px; padding: 9px 11px; color: var(--text);
  background: #0b0a08; border: 1px solid #393023; border-radius: 8px; outline: none;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--gold); }
.form-field input[type=file] { font-size: 11px; padding: 8px; }
.form-field input[type=file]::file-selector-button { background: #302515; color: var(--gold-light); border: 0; border-radius: 5px; padding: 6px; margin-left: 7px; }
.full-field { grid-column: 1 / -1; }
.form-submit { min-height: 43px; cursor: pointer; }
.table-wrap { width: 100%; overflow-x: auto; }
.admin-table { border-collapse: collapse; width: 100%; min-width: 660px; font-size: 12px; }
.admin-table th { color: var(--muted); font-weight: 500; text-align: right; background: #0d0b08; }
.admin-table th, .admin-table td { padding: 13px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.table-product { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.table-product img, .mini-placeholder { width: 43px; height: 43px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.mini-placeholder { display: grid; place-items: center; color: var(--gold); background: #21190d; font-size: 22px; }
.table-product b, .table-product small { display: block; }
.table-product b { font-weight: 500; color: var(--text); }
.table-product small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.inline-edit { display: flex; align-items: center; gap: 6px; min-width: 300px; }
.inline-edit input, .inline-edit select { min-width: 0; width: 125px; padding: 7px; color: var(--text); background: #0b0a08; border: 1px solid #393023; border-radius: 6px; }
.inline-edit select { width: 75px; }
.small-action, .delete-action { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; cursor: pointer; background: #2c2416; color: var(--gold-light); white-space: nowrap; }
.delete-action { color: #ffb5a8; background: #301815; border-color: #59312b; }
.state-on, .state-off { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 10px; white-space: nowrap; }
.state-on { color: #cce6ad; background: #1b2b15; }
.state-off { color: #d2b8ae; background: #33211d; }
.dashboard-note { color: var(--muted); text-align: center; font-size: 11px; margin-top: 25px; }
@media (max-width: 760px) {
  .dashboard { width: 94%; padding-top: 25px; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .admin-panel { padding: 17px 13px; }
  .admin-form { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .full-field { grid-column: 1 / -1; }
  .form-submit { grid-column: 1 / -1; }
  .logout-form { margin-right: auto; }
}
@media (max-width: 420px) {
  .admin-form { grid-template-columns: 1fr; }
  .full-field, .form-submit { grid-column: auto; }
  .auth-card { padding: 25px 19px; }
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #080807;
}

/* ---- صفحه‌های جدا، فیلتر و پنل (نسخه ۳) ---- */
nav a.active { color: var(--gold-light); border-bottom: 1px solid var(--gold); }
.card-link { display: block; }
.product-info h3 a:hover { color: var(--gold-light); }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 15px; border: 1px solid var(--line); border-radius: 30px; font-size: 12px; color: #d3cbbb; background: var(--panel); transition: all .2s; }
.chip span { color: var(--muted); font-size: 10px; margin-right: 3px; }
.chip:hover, .chip.active { border-color: var(--gold); color: var(--gold-light); background: #1d180f; }
.sort-form { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.sort-form select { min-height: 40px; padding: 6px 12px; color: var(--gold-light); background: #0b0a08; border: 1px solid #393023; border-radius: 8px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.detail-image { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); min-height: 300px; }
.detail-image img { width: 100%; display: block; }
.detail-info h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 500; margin: 6px 0; }
.detail-price { font-size: 26px; color: var(--gold-light); margin: 6px 0; }
.detail-price small { font-size: 13px; color: var(--muted); }
.spec-list { list-style: none; padding: 0; margin: 18px 0; border-top: 1px solid var(--line); }
.spec-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.spec-list span { color: var(--muted); }
.admin-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; font-size: 13px; }
.admin-tabs a { padding: 8px 16px; border: 1px solid var(--line); border-radius: 30px; white-space: nowrap; color: #d3cbbb; background: var(--panel); }
.admin-tabs a.active, .admin-tabs a:hover { border-color: var(--gold); color: var(--gold-light); background: #1d180f; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.stat-card span { display: block; font-size: 12px; color: var(--muted); }
.stat-card b { font-size: 28px; font-weight: 500; color: var(--gold-light); }
.stat-card.warn b { color: #ffb5a8; }
.quick-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 10px; background: #2a241b; color: var(--muted); white-space: nowrap; }
.badge.auto { background: #2c2416; color: var(--gold-light); }
.admin-table td.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-table td.actions form { margin: 0; }
.preview-box { margin-bottom: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #17140e; }
.preview-box b { display: block; color: var(--gold-light); }
.preview-box small { color: var(--muted); line-height: 1.8; }
.form-field .check { display: flex; align-items: center; gap: 8px; min-height: 43px; }
.form-field .check input { width: auto; min-height: 0; }
@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; gap: 22px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { align-items: stretch; }
}

/* ---- نسخه نهایی: دسته‌بندی، جستجو، صفحه‌بندی ---- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.category-tile { display: flex; flex-direction: column; gap: 4px; padding: 20px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: all .2s; }
.category-tile b { font-weight: 500; color: var(--gold-light); font-size: 16px; }
.category-tile span { font-size: 12px; color: var(--muted); }
.category-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.search-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search-form input[type=search] { flex: 1; min-width: 180px; min-height: 44px; padding: 8px 14px; color: #f4efe2; background: #0b0a08; border: 1px solid #393023; border-radius: 10px; font: inherit; }
.pager { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 28px; font-size: 13px; }
.pager a { padding: 8px 18px; border: 1px solid var(--line); border-radius: 30px; color: var(--gold-light); }
.pager a:hover { border-color: var(--gold); }
.sold-badge { position: absolute; bottom: 10px; right: 10px; padding: 4px 12px; border-radius: 20px; font-size: 11px; background: rgba(120, 30, 20, .9); color: #ffd9d2; }
.sold-note { padding: 10px 14px; border: 1px solid #5a2a22; border-radius: 10px; background: #2a1511; color: #ffb5a8; font-size: 13px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { min-height: 38px; padding: 4px 10px; color: #f4efe2; background: #0b0a08; border: 1px solid #393023; border-radius: 8px; font: inherit; width: 100%; min-width: 120px; }
.delete-action:disabled { opacity: .35; cursor: not-allowed; }


/* =====================  افکت‌ها و انیمیشن‌ها  ===================== */
main, footer { position: relative; z-index: 1; }

/* پس‌زمینه */
.fx-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fx-blob { position: absolute; border-radius: 50%; will-change: transform; }
.fx-blob.b1 { width: 70vmax; height: 70vmax; top: -25vmax; right: -20vmax;
  background: radial-gradient(circle, rgba(214,179,106,.16), rgba(214,179,106,0) 62%); animation: drift1 26s ease-in-out infinite alternate; }
.fx-blob.b2 { width: 60vmax; height: 60vmax; bottom: -22vmax; left: -18vmax;
  background: radial-gradient(circle, rgba(189,145,67,.14), rgba(189,145,67,0) 62%); animation: drift2 32s ease-in-out infinite alternate; }
.fx-blob.b3 { width: 38vmax; height: 38vmax; top: 35%; left: 30%;
  background: radial-gradient(circle, rgba(240,217,154,.07), rgba(240,217,154,0) 65%); animation: drift3 22s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-12vmax, 14vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(16vmax, -10vmax) scale(1.1); } }
@keyframes drift3 { to { transform: translate(-10vmax, -8vmax) scale(.85); } }

/* خط ریز منو */
nav { position: relative; padding-bottom: 7px; }
.nav-line { position: absolute; bottom: 0; height: 2px; width: 0; left: 0; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--gold-light), var(--gold), transparent);
  box-shadow: 0 0 10px rgba(214,179,106,.75);
  transition: left .5s cubic-bezier(.65,0,.25,1), width .5s cubic-bezier(.65,0,.25,1), opacity .3s; }
nav a.active { color: var(--gold-light); }

/* نوار پیشرفت بالای صفحه و محو شدن هنگام رفتن */
.page-progress { position: fixed; top: 0; right: 0; height: 2px; width: 0; z-index: 100; pointer-events: none;
  background: linear-gradient(270deg, var(--gold-light), var(--gold), transparent); box-shadow: 0 0 8px var(--gold); }
html.leaving .page-progress { width: 85%; transition: width 1.4s cubic-bezier(.2,.7,.2,1); }
html.leaving main, html.leaving footer { opacity: 0; transform: translateY(-8px); transition: opacity .28s ease, transform .28s ease; }
main { animation: pageIn .6s cubic-bezier(.2,.7,.2,1) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ظاهر شدن تدریجی هنگام اسکرول */
.reveal { opacity: 0; transform: translateY(26px) scale(.985); transition: opacity .7s cubic-bezier(.2,.7,.2,1) var(--d,0ms), transform .7s cubic-bezier(.2,.7,.2,1) var(--d,0ms), border-color .25s; }
.reveal.in { opacity: 1; transform: none; }
.product-card.reveal.in:hover { transform: translateY(-5px); transition-delay: 0ms; }
.category-tile.reveal.in:hover { transform: translateY(-3px); transition-delay: 0ms; }

/* ورودی قهرمان (hero) */
.hero-copy > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.hero-copy > :nth-child(1) { animation-delay: .1s; } .hero-copy > :nth-child(2) { animation-delay: .22s; }
.hero-copy > :nth-child(3) { animation-delay: .34s; } .hero-copy > :nth-child(4) { animation-delay: .46s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.hero h1 em { background: linear-gradient(100deg, #bd9143 20%, #fff3c9 45%, #d6b36a 55%, #bd9143 80%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 5s linear infinite; }
@keyframes shine { to { background-position: -250% 0; } }
.art-ring { animation: floaty 6s ease-in-out infinite, ringGlow 4s ease-in-out infinite; }
.art-ring:before { animation: spinSq 24s linear infinite; }
.art-orbit { animation: orbit 18s linear infinite; }
.art-caption { animation: pulseText 4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-12px); } }
@keyframes ringGlow { 50% { box-shadow: 0 0 0 14px rgba(214,179,106,.05), 0 0 0 40px rgba(214,179,106,.03), inset 0 0 70px rgba(214,179,106,.16), 0 0 60px rgba(214,179,106,.12); } }
@keyframes spinSq { to { transform: rotate(405deg); } }
@keyframes orbit { from { transform: rotate(-35deg); } to { transform: rotate(325deg); } }
@keyframes pulseText { 50% { opacity: .55; } }

/* دکمه‌ها: برق عبوری */
.gold-button { position: relative; overflow: hidden; }
.gold-button:after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; right: -60%; transform: skewX(20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: sweep 3.8s ease-in-out infinite 1.2s; }
@keyframes sweep { 0% { right: -60%; } 35%, 100% { right: 130%; } }
.live-label i { animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(214,179,106,.7); } 100% { box-shadow: 0 0 0 9px rgba(214,179,106,0); } }
.brand-logo { transition: transform .5s cubic-bezier(.2,.7,.2,1), filter .4s; }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.08); filter: drop-shadow(0 0 8px rgba(214,179,106,.6)); }

/* درخشش دنبال‌کننده‌ی ماوس */
.product-card, .market-card, .category-tile { position: relative; }
.product-card:before, .market-card:before, .category-tile:before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx,50%) var(--my,50%), rgba(240,217,154,.13), transparent 65%); }
.product-card:hover:before, .market-card:hover:before, .category-tile:hover:before { opacity: 1; }
.market-card { transition: transform .25s, border-color .25s; }
.market-card:hover { transform: translateY(-3px); border-color: rgba(214,179,106,.5); }
.chip:hover { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =====================  نمودار پیشرفته بازار  ===================== */
.chart-panel { position: relative; overflow: hidden; }
.chart-panel:before { content: ""; position: absolute; top: -40%; right: -10%; width: 60%; height: 80%; pointer-events: none;
  background: radial-gradient(circle, rgba(214,179,106,.09), transparent 65%); }
.mc-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.mc-tabs, .mc-ranges { display: flex; gap: 8px; flex-wrap: wrap; }
.mc-toolbar .chip { cursor: pointer; color: #d3cbbb; }
.mc-toolbar .chip.active { color: var(--gold-light); border-color: var(--gold); box-shadow: 0 0 14px rgba(214,179,106,.18); }
.mc-range { padding: 4px 13px; font-size: 11px; }
.mc-range:disabled { opacity: .35; cursor: not-allowed; transform: none !important; }
.mc-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.mc-stat { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(11,10,8,.45); }
.mc-stat span { display: block; font-size: 10px; color: var(--muted); }
.mc-stat b { font-size: 15px; font-weight: 600; color: var(--gold-light); white-space: nowrap; }
.mc-stat b small { font-size: 10px; font-weight: 400; color: var(--muted); }
.mc-stat.up b { color: #9ac56b; } .mc-stat.down b { color: #e58a7b; }
.mc-wrap { position: relative; width: 100%; }
#marketChart { display: block; width: 100%; max-height: none; touch-action: pan-y; cursor: crosshair; }
.mc-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--gold-light);
  pointer-events: none; opacity: 0; transition: opacity .4s; }
.mc-dot.show { opacity: 1; animation: ping 1.8s ease-out infinite; }
.mc-tip { position: absolute; top: 4px; left: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .15s;
  padding: 8px 12px; border: 1px solid rgba(214,179,106,.45); border-radius: 10px; background: rgba(11,10,8,.94);
  box-shadow: 0 8px 24px rgba(0,0,0,.45); white-space: nowrap; text-align: center; backdrop-filter: blur(6px); }
.mc-tip.show { opacity: 1; }
.mc-tip b { display: block; font-size: 14px; color: var(--gold-light); font-weight: 600; }
.mc-tip b small { font-size: 10px; color: var(--muted); font-weight: 400; }
.mc-tip span { font-size: 10px; color: var(--muted); }
@media (max-width: 600px) { .mc-stats { grid-template-columns: repeat(2, minmax(0,1fr)); } .mc-stat b { font-size: 14px; } }

/* =====================  کشوی دسته‌بندی و مرتب‌سازی  ===================== */
.filters { position: relative; z-index: 30; display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-start; align-items: flex-start; }
.drawer { position: relative; }
.drawer > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 18px;
  border: 1px solid var(--line); border-radius: 30px; background: rgba(18,16,13,.85); transition: border-color .25s, box-shadow .25s, background .25s; user-select: none; }
.drawer > summary::-webkit-details-marker { display: none; }
.drawer > summary:hover, .drawer[open] > summary { border-color: var(--gold); background: #1d180f; box-shadow: 0 0 18px rgba(214,179,106,.16); }
.d-label { font-size: 11px; color: var(--muted); }
.drawer > summary b { font-size: 13px; font-weight: 500; color: var(--gold-light); }
.d-count { font-style: normal; font-size: 11px; color: var(--muted); margin-inline-start: auto; }
.d-chev { width: 8px; height: 8px; border: solid var(--gold); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform .3s; margin-inline-start: 4px; }
.drawer[open] > summary .d-chev { transform: rotate(225deg) translateY(-2px); }

.drawer-panel { z-index: 40; transform-origin: top; }
.drawer:not(.wide) .drawer-panel { position: absolute; top: calc(100% + 8px); right: 0; min-width: 100%; width: max-content; max-width: min(320px, 88vw);
  padding: 8px; border: 1px solid rgba(214,179,106,.4); border-radius: 18px; background: rgba(14,12,9,.97);
  box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 0 1px rgba(214,179,106,.05); backdrop-filter: blur(10px); }
.drawer.align-end:not(.wide) .drawer-panel { right: auto; left: 0; }
.drawer[open] .drawer-panel { animation: drawerOpen .32s cubic-bezier(.2,.8,.2,1) both; }
.drawer.closing .drawer-panel { animation: drawerClose .22s ease forwards; }
@keyframes drawerOpen { from { opacity: 0; transform: translateY(-10px) scaleY(.9); } to { opacity: 1; transform: none; } }
@keyframes drawerClose { to { opacity: 0; transform: translateY(-8px) scaleY(.92); } }

.d-item { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 16px; border-radius: 12px;
  font-size: 13px; color: #d3cbbb; transition: background .2s, color .2s, padding .25s; }
.d-item em { font-style: normal; font-size: 10px; color: var(--muted); }
.d-item:before { content: ""; position: absolute; right: 5px; top: 50%; width: 2px; height: 0; border-radius: 2px; transform: translateY(-50%);
  background: linear-gradient(var(--gold-light), var(--gold)); box-shadow: 0 0 8px rgba(214,179,106,.8); transition: height .25s; }
.d-item:hover { background: rgba(214,179,106,.09); color: var(--gold-light); padding-right: 22px; }
.d-item:hover:before, .d-item.active:before { height: 60%; }
.d-item.active { color: var(--gold-light); background: rgba(214,179,106,.07); padding-right: 22px; }
.drawer[open] .d-item { animation: itemIn .4s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms + 70ms); }
@keyframes itemIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* کشوی بزرگ صفحه اصلی */
.drawer.wide > summary { min-height: 62px; border-radius: 18px; padding: 10px 22px; width: 100%; }
.drawer.wide > summary b { font-size: 14px; }
.drawer.wide .drawer-panel { position: static; overflow: hidden; margin-top: 14px; }
.drawer.wide[open] .drawer-panel { animation: wideOpen .55s cubic-bezier(.2,.8,.2,1) both; }
.drawer.wide.closing .drawer-panel { animation: wideClose .22s ease forwards; }
@keyframes wideOpen { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 900px; } }
@keyframes wideClose { from { opacity: 1; max-height: 900px; } to { opacity: 0; max-height: 0; } }
.drawer.wide[open] .category-tile { animation: itemIn .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 55ms + 120ms); }
.category-tile.all { border-color: rgba(214,179,106,.5); background: linear-gradient(140deg, #231b0e, #14110d); }

@media (max-width: 600px) {
  .filters { flex-direction: row; gap: 8px; }
  .filters .drawer { flex: 1 1 0; min-width: 0; }
  .filters .drawer > summary { padding: 8px 12px; gap: 6px; }
  .filters .drawer > summary b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .d-label { display: none; }
  .drawer.wide > summary .d-label { display: inline; }
}
.d-count { white-space: nowrap; }

/* =====================  ارتقای پنل مدیریت  ===================== */
.ico { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.admin-body .topbar { background: rgba(11,10,8,.78); }
.dashboard { position: relative; z-index: 1; }

/* تب‌ها: نوار شیشه‌ای با قرص طلایی متحرک */
.admin-tabs { position: relative; gap: 2px; padding: 6px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 40px;
  background: rgba(18,16,13,.72); backdrop-filter: blur(10px); scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 8px 15px;
  border-radius: 30px; color: #b9b0a0; transition: color .25s; }
.admin-tabs a:hover { color: var(--gold-light); background: transparent; }
.admin-tabs a.active { color: #19130a; background: transparent; font-weight: 600; }
.admin-tabs a.active .ico { color: #19130a; }
.tab-pill { position: absolute; z-index: 0; border-radius: 30px; pointer-events: none; opacity: 0;
  background: linear-gradient(120deg, var(--gold-light), #bd9143); box-shadow: 0 4px 18px rgba(214,179,106,.35);
  transition: left .45s cubic-bezier(.65,0,.25,1), width .45s cubic-bezier(.65,0,.25,1), top .3s, height .3s, opacity .3s; }
@media (min-width: 761px) { .admin-tabs { position: sticky; top: 92px; z-index: 25; } .admin-tabs .tab-pill { position: absolute; } }

/* سربرگ داشبورد */
.dashboard-heading h1 { background: linear-gradient(100deg, #fff6d8, var(--gold-light) 40%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.status-chips { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: 30px; font-size: 11px; white-space: nowrap; border: 1px solid; }
.chip-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: ping 1.8s ease-out infinite; }
.chip-status.ok { color: #cce6ad; background: rgba(60,90,40,.25); border-color: rgba(154,197,107,.35); }
.chip-status.warn { color: #f0d99a; background: rgba(120,90,30,.25); border-color: rgba(214,179,106,.4); }
.chip-status.bad { color: #ffb5a8; background: rgba(120,40,30,.28); border-color: rgba(229,138,123,.4); }
.admin-status { padding: 5px 13px; border-radius: 30px; border: 1px solid rgba(154,197,107,.25); background: rgba(60,90,40,.15); }

/* کارت‌های آمار */
.stat-card { position: relative; overflow: hidden; padding: 18px 18px 20px; background: linear-gradient(145deg, rgba(26,22,15,.92), rgba(16,14,11,.92));
  transition: transform .25s, border-color .25s, box-shadow .25s; }
.stat-card:hover { transform: translateY(-4px); border-color: rgba(214,179,106,.55); box-shadow: 0 14px 36px rgba(0,0,0,.4), 0 0 24px rgba(214,179,106,.1); }
.stat-card:after { content: ""; position: absolute; top: -40%; left: -20%; width: 70%; height: 90%; pointer-events: none;
  background: radial-gradient(circle, rgba(214,179,106,.12), transparent 65%); }
.stat-ico { position: absolute; top: 14px; left: 14px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px;
  color: var(--gold-light); background: rgba(214,179,106,.1); border: 1px solid var(--line); z-index: 1; }
.stat-ico .ico { width: 17px; height: 17px; vertical-align: 0; }
.stat-card.warn .stat-ico { color: #ffb5a8; background: rgba(229,138,123,.1); border-color: rgba(229,138,123,.3); }
.stat-card b { position: relative; z-index: 1; display: block; margin-top: 4px; }
.stat-bar { position: relative; height: 3px; margin-top: 12px; border-radius: 3px; background: rgba(214,179,106,.1); overflow: hidden; }
.stat-bar:before { content: ""; position: absolute; inset: 0 0 0 auto; width: var(--p, 0%); border-radius: 3px;
  background: linear-gradient(270deg, var(--gold-light), var(--gold)); box-shadow: 0 0 8px rgba(214,179,106,.7); animation: barGrow 1.1s cubic-bezier(.2,.8,.2,1) both .3s; transform-origin: right; }
.stat-card.warn .stat-bar:before { background: linear-gradient(270deg, #ffb5a8, #e58a7b); box-shadow: 0 0 8px rgba(229,138,123,.6); }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* پنل روند قیمت */
.pulse-now { text-align: left; }
.pulse-now b { display: block; font-size: 20px; font-weight: 600; color: var(--gold-light); }
.pulse-chg { font-size: 12px; } .pulse-chg.up { color: #9ac56b; } .pulse-chg.down { color: #e58a7b; }
#adminSpark { display: block; width: 100%; height: 110px; margin: 6px 0 4px; }

/* پنل‌ها و جدول‌ها */
.admin-panel { background: linear-gradient(160deg, rgba(22,19,14,.9), rgba(15,13,10,.9)); transition: border-color .3s, box-shadow .3s; }
.admin-panel:hover { border-color: rgba(214,179,106,.34); box-shadow: 0 10px 40px rgba(0,0,0,.28); }
.admin-table tbody tr { transition: background .2s; animation: rowIn .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--r, 0) * 45ms + 150ms); }
.admin-table tbody tr:hover { background: rgba(214,179,106,.055); }
@keyframes rowIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.table-product img { transition: transform .3s; } .admin-table tr:hover .table-product img { transform: scale(1.12) rotate(-2deg); }
.small-action, .delete-action { transition: transform .2s, border-color .2s, box-shadow .2s, background .2s; }
.small-action:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 6px 16px rgba(214,179,106,.18); }
.delete-action:hover { transform: translateY(-2px); border-color: #c0574b; box-shadow: 0 6px 16px rgba(229,138,123,.2); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .auth-card input:focus { box-shadow: 0 0 0 3px rgba(214,179,106,.14), 0 0 18px rgba(214,179,106,.12); }
.form-field input, .form-field select, .form-field textarea, .auth-card input { transition: border-color .2s, box-shadow .25s; }
.quick-links .gold-button, .quick-links .outline-button { gap: 8px; }
.quick-links .ico { width: 16px; height: 16px; vertical-align: -3px; }
.panel-heading h2 { background: linear-gradient(100deg, #fff6d8, var(--gold-light)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* پیام‌ها */
.notice { position: relative; padding-left: 40px; animation: noticeIn .5s cubic-bezier(.2,.8,.2,1) both; transition: opacity .35s, transform .35s, max-height .35s, margin .35s, padding .35s; max-height: 160px; }
.notice.gone { opacity: 0; transform: translateY(-8px); max-height: 0; margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
.notice-x { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); width: 24px; height: 24px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.07); color: inherit; font-size: 16px; line-height: 1; }
.notice-x:hover { background: rgba(255,255,255,.15); }
@keyframes noticeIn { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }

/* پنجره تأیید */
.modal-back { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(5,4,3,.7); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.modal-back.show { opacity: 1; }
.modal-card { width: 100%; max-width: 380px; padding: 28px 26px 22px; text-align: center; border: 1px solid rgba(214,179,106,.4); border-radius: 22px;
  background: linear-gradient(160deg, #1b160e, #100e0a); box-shadow: 0 30px 90px rgba(0,0,0,.7), 0 0 40px rgba(214,179,106,.08);
  transform: translateY(18px) scale(.94); transition: transform .35s cubic-bezier(.2,.9,.3,1.2); }
.modal-back.show .modal-card { transform: none; }
.modal-ico { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; font-size: 26px; font-weight: 700;
  color: #ffb5a8; background: rgba(229,138,123,.12); border: 1px solid rgba(229,138,123,.4); }
.modal-card p { margin: 0 0 22px; font-size: 14px; color: #ded3bd; line-height: 2; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions button { min-height: 42px; padding: 8px 20px; cursor: pointer; border-radius: 10px; }

/* صفحه ورود: کارت با حاشیه‌ی طلایی متحرک */
.auth-card { position: relative; background: rgba(18,16,13,.9); border-color: transparent; }
.auth-card:before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: 21px; padding: 1px; pointer-events: none;
  background: linear-gradient(120deg, rgba(214,179,106,.15), var(--gold-light), rgba(214,179,106,.15), var(--gold), rgba(214,179,106,.15)); background-size: 300% 100%;
  animation: borderFlow 6s linear infinite; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@keyframes borderFlow { to { background-position: -300% 0; } }
.auth-card h1 { background: linear-gradient(100deg, #fff6d8, var(--gold-light), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }

@media (max-width: 760px) {
  .admin-tabs { border-radius: 26px; }
  .admin-tabs a { padding: 8px 12px; font-size: 12px; }
  .stat-ico { width: 30px; height: 30px; }
  .status-chips { width: 100%; }
}
@media (max-width: 760px) {
  .admin-body .topbar { flex-wrap: nowrap; min-height: 68px; }
  .admin-body .topbar nav { display: none; }
  .admin-body .logout-form button { min-height: 36px; padding: 4px 14px; font-size: 12px; }
}
