@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --radius: 10px;
    --shadow: 0 2px 10px rgba(0,0,0,.06);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg, #f5f6f8);
    color: var(--text, #222);
    direction: rtl;
    line-height: 1.8;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------------- Header ---------------- */
.top-bar {
    background: var(--primary, #ee6723);
    color: #fff;
    font-size: 13px;
    padding: 6px 0;
}
.top-bar .container { display: flex; justify-content: space-between; }

.main-header {
    background: var(--header-bg, #fff);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.main-header .container {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 12px;
    padding-bottom: 12px;
}
.logo {
    font-weight: 800;
    font-size: 22px;
    color: var(--primary, #ee6723);
    white-space: nowrap;
}
.search-box {
    flex: 1;
    display: flex;
}
.search-box input {
    flex: 1;
    border: 1px solid #e2e2e2;
    border-left: none;
    border-radius: var(--radius) 0 0 var(--radius);
    padding: 10px 14px;
    font-family: inherit;
    outline: none;
}
.search-box button {
    background: var(--primary, #ee6723);
    color: #fff;
    padding: 0 18px;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-actions a { display: flex; flex-direction: column; align-items: center; font-size: 12px; gap: 4px; }
.cart-badge {
    background: var(--accent, #e5312d);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: -10px;
    right: -6px;
}

/* ---------------- Category nav ---------------- */
.cat-nav {
    background: var(--header-bg, #fff);
    border-top: 1px solid #f0f0f0;
    overflow-x: auto;
}
.cat-nav ul { display: flex; gap: 22px; padding: 10px 16px; white-space: nowrap; }
.cat-nav a { font-size: 14px; font-weight: 600; }
.cat-nav a:hover { color: var(--primary, #ee6723); }

/* ---------------- Banner ---------------- */
.hero-banner {
    background: linear-gradient(135deg, var(--primary,#ee6723), var(--accent,#e5312d));
    color: #fff;
    border-radius: var(--radius);
    padding: 40px 30px;
    margin: 20px 0;
    text-align: center;
}
.hero-banner h1 { font-size: 26px; margin-bottom: 10px; }
.hero-banner p { opacity: .9; }

/* ---------------- Section title ---------------- */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 26px 0 14px;
}
.section-title h2 { font-size: 18px; border-right: 4px solid var(--primary, #ee6723); padding-right: 10px; }
.section-title a { font-size: 13px; color: var(--primary, #ee6723); }

/* ---------------- Product grid ---------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}
.product-card {
    background: var(--card-bg, #fff);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
    position: relative;
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.product-card .thumb {
    aspect-ratio: 1/1;
    background: #f2f2f2;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .name { font-size: 13.5px; min-height: 40px; margin-bottom: 8px; }
.badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent, #e5312d);
    color: #fff;
    font-size: 12px;
    border-radius: 6px;
    padding: 3px 6px;
}
.price-row { margin-top: auto; }
.old-price { text-decoration: line-through; color: #999; font-size: 12px; }
.new-price { color: var(--primary, #ee6723); font-weight: 800; font-size: 15px; }
.btn-add-cart {
    width: 100%;
    margin-top: 10px;
    background: var(--primary, #ee6723);
    color: #fff;
    padding: 8px;
    border-radius: 8px;
    font-size: 13px;
}
.btn-add-cart:hover { filter: brightness(.92); }

/* ---------------- Buttons / forms (shared) ---------------- */
.btn {
    display: inline-block;
    background: var(--primary, #ee6723);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
}
.btn-outline { background: transparent; border: 1px solid var(--primary, #ee6723); color: var(--primary, #ee6723); }
.form-box {
    max-width: 420px;
    margin: 40px auto;
    background: var(--card-bg, #fff);
    padding: 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary, #ee6723); }
.alert { padding: 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
.alert-error { background: #fdecea; color: #c0392b; }
.alert-success { background: #e9f9ee; color: #1e8e4d; }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row img { border-radius: 8px; border: 1px solid #eee; }

/* ---------------- Footer ---------------- */
footer {
    background: var(--footer-bg, #222);
    color: #eee;
    margin-top: 40px;
    padding: 30px 0;
    font-size: 13.5px;
}
footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }

/* ---------------- Mobile bottom nav ---------------- */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0; right: 0; left: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,.08);
    z-index: 200;
}
.mobile-nav ul { display: flex; }
.mobile-nav li { flex: 1; text-align: center; padding: 8px 0; font-size: 11px; }
.mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; }

/* ---------------- Pagination ---------------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 30px 0;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 13px;
    background: var(--card-bg, #fff);
    box-shadow: var(--shadow);
}
.pagination a:hover { background: var(--primary, #ee6723); color: #fff; }
.pagination .pg-current { background: var(--primary, #ee6723); color: #fff; font-weight: 700; }
.pagination .pg-dots { box-shadow: none; background: transparent; }

/* ---------------- Category tiles (home page) ---------------- */
.cat-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}
.cat-tile {
    background: var(--card-bg, #fff);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 8px;
    text-align: center;
    font-size: 13px;
}
.cat-tile .cat-tile-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f2f2f2;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 22px;
}
.cat-tile .cat-tile-icon img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile:hover { box-shadow: 0 6px 16px rgba(0,0,0,.1); }

/* ---------------- 404 page ---------------- */
.error-page {
    text-align: center;
    padding: 60px 20px;
}
.error-page h1 { font-size: 70px; color: var(--primary, #ee6723); }
.error-page p { margin: 10px 0 20px; color: #777; }

/* ---------------- Logo image ---------------- */
.logo img { height: 36px; display: inline-block; vertical-align: middle; }

/* ---------------- Responsive ---------------- */
@media (max-width: 768px) {
    .main-header .container { flex-wrap: wrap; }
    .search-box { order: 3; width: 100%; }
    .header-actions span.label { display: none; }
    .mobile-nav { display: block; }
    body { padding-bottom: 56px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
