/* ═══ core.css — جداشده از main.css (خطوط 320-582 نسخهٔ v1.1.267) بدون هیچ تغییری در محتوا/ترتیب.
   پایهٔ صفحه/سکشن/گرید نسل اول + موبایل پایه
   ترتیب لود (زنجیرهٔ dependency در functions.php) = ترتیب قبلی داخل main.css. ═══ */
/* ═══════════════════════════════════════
   CATEGORIES SECTION
═══════════════════════════════════════ */
.cats-section { padding-bottom: clamp(2rem, 5vw, 5rem); }
.section-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}
.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
}
.section-label::before {
    content: '';
    display: block;
    width: 3px;
    height: 16px;
    background: var(--black);
    border-radius: 2px;
}
.section-link {
    font-size: 12px;
    color: var(--gray-400);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}
.section-link svg { width: 13px; height: 13px; }
.section-link:hover { color: var(--black); }

/* Grid */
.cats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.cat-card { list-style: none; }
.cat-card-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 1.6rem 1rem 1.4rem;
    background: var(--white);
    border: 0.5px solid var(--gray-100);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-align: center;
    height: 100%;
}
.cat-card-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-200);
}
.cat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.cat-icon svg { width: 26px; height: 26px; }
.cat-icon img { width: 28px; height: 28px; object-fit: contain; }
.cat-card-link:hover .cat-icon { transform: scale(1.06); }
.cat-body { display: flex; flex-direction: column; gap: 4px; }
.cat-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--black);
    line-height: 1.4;
}
.cat-count { font-size: 11px; color: var(--gray-400); }
.no-cats { font-size: 14px; color: var(--gray-400); padding: 2rem 0; }

/* ═══════════════════════════════════════
   SEARCH OVERLAY (موبایل)
═══════════════════════════════════════ */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.search-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.search-overlay-inner {
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
}
.search-overlay-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.search-overlay-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 0.5px solid var(--gray-100);
}
.search-overlay-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--black);
    direction: rtl;
    font-family: inherit;
    outline: none;
    -webkit-appearance: none;
}
.search-overlay-input::placeholder { color: var(--gray-400); }
.search-overlay-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.search-overlay-close svg { width: 16px; height: 16px; }
.search-overlay-results { flex: 1; min-height: 0; max-height: 60vh; max-height: 60dvh; overflow-y: auto; }
.search-overlay-results .result-item { padding: 12px 14px; }

/* ═══════════════════════════════════════
   MOBILE BOTTOM NAV
═══════════════════════════════════════ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--border);
    z-index: 200;
}
.mobile-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    padding: 0 4px env(safe-area-inset-bottom, 8px);
}
.mobile-nav-list { display: contents; }
.mnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-200);
    transition: color 0.15s;
    position: relative;
    border: none;
    background: none;
    font-family: inherit;
}
.mnav-item svg { width: 22px; height: 22px; }
.mnav-item.active { color: var(--black); }
.mnav-label { font-size: 10px; font-weight: 600; }
.mnav-dot {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--black);
    position: absolute;
    bottom: 2px;
}
.cart-badge-mobile {
    position: absolute;
    top: 2px;
    right: 10px;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    background: var(--black);
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 900px) {
    .cats-grid { grid-template-columns: repeat(3, 1fr); }
}@media (max-width: 768px){
/* منوی پایین */

    .mobile-nav { display: block; }

    body { padding-bottom: var(--mobile-nav); }
/* grid دسته‌بندی */

    .cats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
/* سرچ */
/* کارت */

    .cat-card-link { padding: 1.3rem 0.8rem 1.1rem; }

    .cat-icon { width: 48px; height: 48px; border-radius: 13px; }

    .cat-icon svg { width: 22px; height: 22px; }

    .cat-name { font-size: 12px; }
}@media (max-width: 420px){

    .cats-grid { gap: 8px; }

    .hero { padding-top: 2rem; }

    .logo-text { font-size: 15px; }
}

/* ── iPhone safe area ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-nav { padding-bottom: env(safe-area-inset-bottom); height: calc(var(--mobile-nav) + env(safe-area-inset-bottom)); }
}
