/* ============================================================
   PRODUCTS — five products as one wireframe board.
   Cells are separated by 1px rules only; site font, gray lines.
   ============================================================ */

.products-section {
    --p-line: var(--line-strong);
    --p-ink: var(--text-muted);
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

.products-section,
.products-section .container,
.products-section .inner {
    overflow: visible !important;
}

/* خطوط و نقطه‌های سکشن، هم‌رنگ بقیه سایت */
.products-section::before,
.products-section::after,
.products-section .inner::before,
.products-section .inner::after {
    background: var(--line-px) !important;
}

.products-section .dot {
    background: var(--dot-empty) !important;
    border-color: var(--p-line) !important;
    box-shadow: none !important;
}

/* ============================================================
   HEADER — کادر خط‌کشی جدا برای تایتل
   ============================================================ */
#products .products-header {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 34px !important;
    padding: 22px 32px !important;
    position: relative !important;
    text-align: center !important;
    overflow: visible !important;
}

#products .products-header::before {
    content: '' !important;
    position: absolute !important;
    left: calc(-1 * var(--line-ext)) !important;
    right: calc(-1 * var(--line-ext)) !important;
    top: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    border: 0 !important;
    border-top: 1px solid var(--p-line) !important;
    border-bottom: 1px solid var(--p-line) !important;
    background: none !important;
    pointer-events: none;
}

#products .products-header::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    border: 0 !important;
    border-left: 1px solid var(--p-line) !important;
    border-right: 1px solid var(--p-line) !important;
    background: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

#products .products-header h2 {
    margin: 0 0 6px !important;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 2rem !important;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.2;
}

#products .products-header p {
    max-width: 560px;
    margin: 0 auto !important;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.82rem !important;
    opacity: 0.45;
}

/* ============================================================
   BOARD
   ============================================================ */
.products-board {
    position: relative;
    border: 1px solid var(--p-line);
    z-index: 2;
}

.products-board::before,
.products-board::after {
    content: '';
    position: absolute;
    top: -1px;
    height: 1px;
    background: var(--p-line);
    pointer-events: none;
    z-index: 3;
}

.products-board::before { left: 100%; right: calc(-1 * var(--line-ext)); }
.products-board::after { right: 100%; left: calc(-1 * var(--line-ext)); }

/* خط پایین برد تا لبه‌های صفحه — یک بار، بدون روی‌هم‌افتادن */
.products-board-edge {
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: -1px;
    height: 1px;
    background: var(--p-line);
    pointer-events: none;
    z-index: 3;
}

.products-board-edge::before,
.products-board-edge::after {
    content: '';
    position: absolute;
    top: 0;
    height: 1px;
    background: var(--p-line);
    pointer-events: none;
}

.products-board-edge::before { left: 100%; right: calc(-1 * var(--line-ext)); }
.products-board-edge::after { right: 100%; left: calc(-1 * var(--line-ext)); }

/* ============================================================
   STRIP — 5 columns
   ============================================================ */
.products-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
}

.product-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    padding: 22px 20px 26px;
    border-right: 1px solid var(--p-line);
    background: transparent;
    transition: background 0.3s ease;
}

.product-cell:last-child {
    border-right: 0;
}

/* هر سلول یک پله از گرادیانت همین سکشن (#hl-1 → #hl-2) */
.product-cell:nth-child(1) { --pc-c: var(--hl-1, var(--accent)); }
.product-cell:nth-child(2) { --pc-c: color-mix(in srgb, var(--hl-1, var(--accent)) 72%, var(--hl-2, var(--accent))); }
.product-cell:nth-child(3) { --pc-c: color-mix(in srgb, var(--hl-1, var(--accent)) 45%, var(--hl-2, var(--accent))); }
.product-cell:nth-child(4) { --pc-c: color-mix(in srgb, var(--hl-1, var(--accent)) 20%, var(--hl-2, var(--accent))); }
.product-cell:nth-child(5) { --pc-c: var(--hl-2, var(--accent)); }

/* هاور: یک درخشش بسیار ملایم از بالا + خط رنگی باریک روی لبه‌ی بالا */
.product-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pc-c), transparent);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.35s ease;
}

.product-cell:hover::before {
    opacity: 1;
}

.product-cell:hover {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--pc-c) 6%, transparent),
        transparent 62%);
}

[data-theme="light"] .product-cell:hover {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--pc-c) 7%, transparent),
        transparent 62%);
}

/* ============================================================
   CELL CONTENT
   ============================================================ */
.pc-num {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    line-height: 1;
    color: var(--p-ink);
    opacity: 0.55;
    font-variant-numeric: tabular-nums;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.product-cell:hover .pc-num {
    opacity: 1;
    color: var(--pc-c);
}

.pc-icon {
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px 0 16px;
    color: var(--p-ink);
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.product-cell:hover .pc-icon {
    opacity: 1;
    color: var(--pc-c);
}

.pc-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.product-name {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    line-height: 1.2;
    color: var(--text);
    margin: 0 0 4px;
    transition: color 0.3s ease;
}

/* اسم محصول در هاور — رنگ ساده‌ی همان پله از گرادیانت */
.product-cell:hover .product-name {
    color: var(--pc-c);
}

.product-tag {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--p-ink);
    opacity: 0.6;
    line-height: 1.4;
    margin-bottom: 16px;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.product-cell:hover .product-tag {
    color: var(--pc-c);
    opacity: 1;
}

.product-feats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.product-feats li {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.product-feats li::before {
    content: '';
    flex: 0 0 auto;
    width: 4px;
    height: 4px;
    border: 1px solid var(--p-ink);
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.6;
}

.pc-arrow {
    position: absolute;
    right: 18px;
    bottom: 18px;
    font-size: 1rem;
    line-height: 1;
    color: var(--p-ink);
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.product-cell:hover .pc-arrow {
    opacity: 1;
    color: var(--pc-c);
    transform: translate(2px, -2px);
}

/* الماس‌های لیست هم در هاور هم‌رنگ همان سلول */
.product-cell:hover .product-feats li::before {
    border-color: var(--pc-c);
    opacity: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .products-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-cell:nth-child(5n) {
        border-right: 1px solid var(--p-line);
    }

    .product-cell:nth-child(3n) {
        border-right: 0;
    }

    .product-cell {
        min-height: 290px;
    }
}

@media (max-width: 768px) {
    #products .products-header {
        padding: 20px 22px !important;
        margin-bottom: 24px !important;
    }

    #products .products-header h2 { font-size: 1.6rem !important; }

    .products-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-cell:nth-child(3n) {
        border-right: 1px solid var(--p-line);
    }

    .product-cell:nth-child(2n) {
        border-right: 0;
    }

    .product-cell { min-height: 260px; }
}

@media (max-width: 520px) {
    .products-section { padding: 40px 0; }

    #products .products-header::before {
        left: -1200px !important;
        right: -1200px !important;
    }

    #products .products-header h2 { font-size: 1.25rem !important; }

    .products-strip {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-cell,
    .product-cell:nth-child(2n),
    .product-cell:nth-child(3n),
    .product-cell:nth-child(5n) {
        border-right: 0;
    }

    .product-cell {
        min-height: auto;
        padding: 20px 18px 24px;
    }
}

/* ============================================================
