/* ===== قطعات ===== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.parts-hero,
.product-hero {
    text-align: center;
}

.parts-section,
.product-section {
    padding: clamp(2rem, 5vw, 3rem) 0 clamp(3rem, 8vw, 4.5rem);
}

.parts-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: start;
}

.parts-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    background: #fff;
    border: 1px solid rgba(46, 39, 32, .08);
    border-radius: 18px;
    padding: 1.1rem;
}

.parts-sidebar-title {
    font-size: .92rem;
    margin-bottom: .85rem;
    color: var(--ink);
}

.parts-categories {
    display: grid;
    gap: .35rem;
}

.parts-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .75rem;
    border-radius: 12px;
    color: var(--muted);
    font-size: .88rem;
    transition: background var(--ease), color var(--ease);
}

.parts-category:hover,
.parts-category.is-active {
    background: rgba(239, 108, 0, .1);
    color: var(--accent);
}

.parts-category-count {
    font-size: .78rem;
    min-width: 1.5rem;
    text-align: center;
    padding: .15rem .45rem;
    border-radius: 999px;
    background: rgba(46, 39, 32, .06);
    color: var(--muted);
}

.parts-category.is-active .parts-category-count {
    background: rgba(239, 108, 0, .15);
    color: var(--accent);
}

.parts-main {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
}

.parts-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.parts-search {
    flex: 1 1 220px;
}

.parts-search input {
    width: 100%;
    padding: .9rem 1.1rem;
    border: 1px solid rgba(46, 39, 32, .12);
    border-radius: 14px;
    background: #fff;
    font: inherit;
    color: var(--ink);
    transition: border-color var(--ease), box-shadow var(--ease);
}

.parts-search input:focus {
    outline: none;
    border-color: rgba(239, 108, 0, .45);
    box-shadow: 0 0 0 3px rgba(239, 108, 0, .12);
}

.parts-search-btn {
    min-width: 96px;
}

.parts-empty {
    text-align: center;
    color: var(--muted);
    padding: 2.5rem 0;
}

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 1.15rem;
}

.parts-card {
    background: #fff;
    border: 1px solid rgba(46, 39, 32, .08);
    border-radius: 18px;
    overflow: hidden;
    transition: transform var(--ease), box-shadow var(--ease);
}

.parts-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(46, 39, 32, .1);
}

.parts-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.parts-card-media {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.15rem;
    background:
        radial-gradient(circle at 50% 35%, rgba(239, 108, 0, .08), transparent 55%),
        linear-gradient(180deg, #faf8f5 0%, #f0ebe3 100%);
}

.parts-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(46, 39, 32, .14));
}

.parts-card-body {
    padding: .95rem 1rem 1.1rem;
    display: grid;
    gap: .35rem;
    flex: 1;
}

.parts-card-category {
    font-size: .75rem;
    color: var(--accent);
    font-weight: 600;
}

.parts-card-title {
    font-size: .93rem;
    line-height: 1.55;
    color: var(--ink);
}

.parts-card-code {
    font-size: .8rem;
    color: var(--muted);
    direction: ltr;
    text-align: right;
}

.parts-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: .5rem;
}

.parts-page-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
}

.parts-page,
.parts-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: .45rem .8rem;
    border-radius: 12px;
    border: 1px solid rgba(46, 39, 32, .1);
    background: #fff;
    color: var(--ink);
    font-size: .9rem;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.parts-page:hover,
.parts-page-btn:hover {
    border-color: rgba(239, 108, 0, .35);
    color: var(--accent);
}

.parts-page.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.parts-page-ellipsis {
    padding: 0 .25rem;
    color: var(--muted);
}

.parts-pagination-meta {
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
}

/* ===== جزئیات محصول ===== */
.product-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: 1rem;
    font-size: .88rem;
    color: rgba(255, 255, 255, .65);
}

.product-breadcrumb a {
    color: #fff;
}

.product-breadcrumb a:hover {
    color: rgba(255, 255, 255, .85);
}

.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}

.product-gallery {
    display: grid;
    gap: 1rem;
}

.product-gallery-main {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 30%, rgba(239, 108, 0, .1), transparent 58%),
        linear-gradient(180deg, #fff 0%, #f3efe8 100%);
    border: 1px solid rgba(46, 39, 32, .08);
}

.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 16px 28px rgba(46, 39, 32, .16));
}

.product-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.product-thumb {
    width: 72px;
    height: 72px;
    padding: .45rem;
    border-radius: 12px;
    border: 2px solid transparent;
    background: #fff;
    cursor: pointer;
    transition: border-color var(--ease), transform var(--ease);
}

.product-thumb:hover,
.product-thumb.is-active {
    border-color: var(--accent);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-details {
    display: grid;
    gap: 1rem;
    align-content: start;
    padding: clamp(.5rem, 2vw, 1rem) 0;
}

.product-category {
    display: inline-flex;
    align-self: start;
    padding: .35rem .8rem;
    border-radius: 999px;
    background: rgba(239, 108, 0, .1);
    color: var(--accent);
    font-size: .8rem;
    font-weight: 600;
}

.product-details-title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    line-height: 1.45;
}

.product-meta {
    display: grid;
    gap: .75rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(46, 39, 32, .08);
}

.product-meta dt {
    font-size: .78rem;
    color: var(--muted);
    margin-bottom: .15rem;
}

.product-meta dd {
    font-size: 1rem;
    direction: ltr;
    text-align: right;
    font-weight: 600;
}

.product-lead {
    color: var(--muted);
    line-height: 1.85;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: .5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: .8rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-h);
}

.btn-ghost {
    border: 1px solid rgba(46, 39, 32, .14);
    background: #fff;
    color: var(--ink);
}

.btn-ghost:hover {
    border-color: rgba(239, 108, 0, .35);
    color: var(--accent);
}

@media (max-width: 768px) {
    .parts-layout,
    .product-layout {
        grid-template-columns: 1fr;
    }

    .parts-sidebar {
        position: static;
    }

    .parts-categories {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: .5rem;
        padding-bottom: .35rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .parts-categories::-webkit-scrollbar {
        display: none;
    }

    .parts-category {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .product-actions {
        flex-direction: column;
    }

    .product-actions .btn,
    .parts-search-form .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .parts-hero h1,
    .product-hero h1 {
        font-size: clamp(1.25rem, 6vw, 1.5rem);
    }
}
