/* ===== Compat Aliases to Global Design Tokens ===== */

:root {
    /* Brand */
    --primary: var(--brand-600);
    --primary-700: var(--brand-700);
    --primary-50: var(--brand-50);
    --primary-text: #ffffff;
    /* Surfaces & text (همسو با base.css) */
    --surface: var(--card);
    --surface-alt: var(--elev);
    --bg: var(--bg);
    --text: var(--fg);
    --muted: var(--muted);
    --border: var(--line);
}


/* (Optional) اگر می‌خواهی صفحه اصلی حتماً روشن باشد: */


/*
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #f8fafc;
      --surface: #ffffff;
      --surface-alt: #f7f8fa;
      --text: #0f172a;
      --muted: #475569;
      --border: #e2e8f0;
    }
  }
  */


/* ===== Base ===== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazir', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    direction: rtl;
}


/* ===== Navbar ===== */

.navbar {
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.logo img {
    width: 60px;
    height: auto;
}

.nav-links a {
    margin-left: 1rem;
    text-decoration: none;
}


/* ===== Buttons (links + buttons) ===== */

.btn,
button.btn {
    display: inline-block;
    background: var(--primary);
    color: var(--primary-text);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, box-shadow .2s, transform .02s;
    -webkit-appearance: none;
    appearance: none;
}

.btn:hover,
button.btn:hover {
    background: var(--primary-700);
}

.btn:focus,
button.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .25);
}

.btn:active,
button.btn:active {
    transform: translateY(1px);
}


/* Outline */

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-50);
}


/* Big button (hero) */

.btn-large {
    background: #fff;
    color: var(--primary);
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: background .2s;
}

.btn-large:hover {
    background: #eaeef6;
}


/* Remove underline on all button-like links in all states */

a.btn,
a.btn-outline,
a.btn-large,
a.btn:hover,
a.btn:focus,
a.btn:active,
a.btn-outline:hover,
a.btn-outline:focus,
a.btn-outline:active,
a.btn-large:hover,
a.btn-large:focus,
a.btn-large:active {
    text-decoration: none !important;
}


/* ===== Hero ===== */

.hero {
    text-align: center;
    padding: 5rem 1rem;
    background: linear-gradient(90deg, #007bff, #6610f2);
    color: #fff;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}


/* ===== Layout ===== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}


/* ===== Filters ===== */

.filters {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .04);
}

.filters form {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
    align-items: end;
}

.filters .field {
    grid-column: span 3;
}

.filters .field.small {
    grid-column: span 2;
}

.filters .field.big {
    grid-column: span 6;
}

.filters label {
    display: block;
    font-size: .9rem;
    margin-bottom: 6px;
    color: #444;
}

.filters input,
.filters select {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px;
}

.filters .actions {
    grid-column: span 12;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}


/* ===== Cards Grid ===== */

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.card {
    grid-column: span 3;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .05);
}

.card .thumb {
    height: 160px;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    color: #777;
}

.card .content {
    padding: 12px;
}

.chip {
    display: inline-block;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .8rem;
    margin-inline-end: 6px;
}

.kv {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    margin: 6px 0;
    color: #444;
}

.price {
    font-weight: 700;
}

.muted {
    color: #666;
    font-size: .85rem;
}

.card .actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}


/* ===== Pagination ===== */

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 24px 0;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
}

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}


/* ===== Footer (light & matching header) ===== */

.site-footer {
    background: var(--surface);
    color: var(--muted);
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

.site-footer .container {
    padding: 32px 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.footer-col {
    grid-column: span 3;
}

.footer-col h4 {
    color: var(--text);
    margin: 0 0 10px;
    font-size: 1rem;
}

.footer-col p,
.footer-col li,
.footer-col a {
    color: var(--muted);
    font-size: .95rem;
}

.footer-col a {
    text-decoration: none;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin: 6px 0;
}

.footer-brand {
    font-weight: 700;
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.footer-badge {
    display: inline-block;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: .8rem;
    margin-top: 6px;
}

.newsletter {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.newsletter input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    color: var(--text);
}

.newsletter button {
    border-radius: 10px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    padding: 10px 12px;
}

.newsletter button:hover {
    background: var(--primary-700);
}

.socials {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.socials a:hover {
    border-color: #cbd5e1;
}

.subfooter {
    border-top: 1px solid var(--border);
    padding: 12px 0;
    color: #94a3b8;
    background: var(--surface-alt);
}

.subfooter .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.subfooter a {
    color: #94a3b8;
    text-decoration: none;
}

.subfooter a:hover {
    color: var(--primary);
}


/* ===== Responsive ===== */

@media (max-width: 992px) {
    .card {
        grid-column: span 4;
    }
    .filters .field {
        grid-column: span 6;
    }
    .filters .field.small {
        grid-column: span 6;
    }
    .filters .field.big {
        grid-column: span 12;
    }
    .footer-col {
        grid-column: span 6;
    }
}

@media (max-width: 640px) {
    .card {
        grid-column: span 12;
    }
    .footer-col {
        grid-column: span 12;
    }
    .newsletter {
        flex-direction: column;
    }
}

.site-footer {
    background: #0f172a;
    color: #dbe2ef;
    border-top: 1px solid #1f2937;
}

.footer-col h4,
.footer-brand {
    color: #fff;
}

.footer-col a:hover {
    color: #fff;
}

.newsletter input {
    background: #111827;
    color: #e5e7eb;
    border-color: #334155;
}

.socials a {
    border-color: #334155;
}

.subfooter {
    background: #111827;
    color: #94a3b8;
    border-top: 1px solid #1f2937;
}

.subfooter a:hover {
    color: #fff;
}


/* ناوبری: فاصله کمتر و شکست خط در موبایل */

@media (max-width: 768px) {
    .navbar {
        padding: .75rem 1rem;
    }
    .navbar nav {
        flex-wrap: wrap;
        gap: .75rem;
        justify-content: center;
    }
}


/* هیرو: تیتر و پاراگراف جمع‌وجور */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.6rem;
    }
    .hero p {
        padding: 0 .5rem;
    }
}


/* فیلترها: همه چیز ستونی و تمام‌عرض */

@media (max-width: 768px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: .75rem;
    }
    .filters select,
    .filters input[type="text"],
    .filters button {
        width: 100%;
    }
}