/* ==================================
   KhodroSup Products Page
================================== */

.products-page{
    padding:20px 15px;
}

/* ================================
   Header
================================ */

.products-header{
    margin-bottom:20px;
}

.products-header h1{
    font-size:26px;
    font-weight:800;
}

.products-header p{
    color:#777;
    font-size:14px;
}

/* ================================
   Tools
================================ */

.products-tools{
    display:flex;
    gap:15px;
    margin-bottom:25px;
}

.product-search,
.product-filter{
    height:40px;
    border:1px solid #ddd;
    border-radius:8px;
    padding:0 12px;
    font-size:14px;
}

.product-search{
    flex:1;
}

/* ================================
   Products Grid (8 columns)
================================ */

.products-grid{
    display:grid;
    grid-template-columns: repeat(8, 1fr);
    gap:10px;
}

/* ================================
   Product Card
================================ */

.product-card{
    display:flex;
    flex-direction:column;
    background:#fff;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 3px 12px rgba(0,0,0,.06);
    transition:.3s;
    text-decoration:none;
    color:inherit;
    cursor:pointer;
}

.product-card:hover{
    transform:translateY(-5px);
    box-shadow:0 6px 18px rgba(0,0,0,.12);
}

/* ================================
   Product Image
================================ */

.product-image-box{
    width:100%;
    aspect-ratio:1 / 1;
    height:auto;
    background:#f8f8f8;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.product-image-box img{
    width:100%;
    height:100%;
    object-fit:contain;
    padding:8px;
    display:block;
}

/* ================================
   Product Info
================================ */

.product-info{
    padding:10px 8px;
    display:flex;
    flex-direction:column;
    flex-grow:1;
}

.product-info h2{
    font-size:13px;
    font-weight:700;
    height:38px;
    overflow:hidden;
    line-height:1.4;
    margin-bottom:4px;
    color:#222;
}

.product-code{
    color:#888;
    font-size:11px;
    margin-top:2px;
}

.product-category{
    color:#666;
    margin-top:4px;
    font-size:11px;
}

.product-vehicles{
    color:#555;
    font-size:11px;
    margin-top:4px;
    line-height:1.4;
}

/* ================================
   Price
================================ */

.product-price{
    margin:8px 0;
    font-size:14px;
    font-weight:bold;
    color:#198754;
    margin-top:auto;
}

.old-price{
    display:block;
    color:#999;
    text-decoration:line-through;
    font-size:11px;
}

.discount-price{
    color:#d60000;
}

/* ================================
   Status
================================ */

.available{
    display:inline-block;
    align-self:flex-start;
    background:#198754;
    color:white;
    padding:3px 8px;
    border-radius:12px;
    font-size:10px;
}

.unavailable{
    display:inline-block;
    align-self:flex-start;
    background:#dc3545;
    color:white;
    padding:3px 8px;
    border-radius:12px;
    font-size:10px;
}

/* ================================
   Button
================================ */

.product-btn{
    display:block;
    width:100%;
    text-align:center;
    background:#0d6efd;
    color:white;
    padding:8px 4px;
    border-radius:6px;
    margin-top:8px;
    font-size:12px;
    font-weight:bold;
}

.product-card:hover .product-btn{
    background:#084298;
}

/* ================================
   Pagination
================================ */

.pagination-box{
    display:flex;
    justify-content:center;
    gap:8px;
    margin:30px 0;
}

.pagination-box a{
    width:36px;
    height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:#eee;
    text-decoration:none;
    color:#333;
    font-size:13px;
}

.pagination-box .active{
    background:#0d6efd;
    color:white;
}

/* ================================
   Responsive Breakpoints & Mobile Style
================================ */

@media(max-width: 1600px){
    .products-grid{
        grid-template-columns: repeat(6, 1fr);
    }
}

@media(max-width: 1200px){
    .products-grid{
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ================================
   تنظیمات اختصاصی موبایل (طرح KDS)
================================ */
@media(max-width: 768px){
    .products-page {
        padding: 10px 5px;
    }

    .products-tools{
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }

    /* ۱. گرید ۲ ستونه با خطوط متقاطع جدول مانند */
    .products-grid{
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0 !important;
        border-top: 1px solid #e0e0e0;
        border-right: 1px solid #e0e0e0;
    }

    /* ۲. کارت محصول فشرده بدون سایه و انحنا */
    .product-card{
        border-bottom: 1px solid #e0e0e0 !important;
        border-left: 1px solid #e0e0e0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 8px 6px !important;
        background: #fff;
    }

    .product-card:hover{
        transform: none !important;
        box-shadow: none !important;
    }

    .product-image-box{
        background: transparent !important;
    }

    .product-image-box img{
        padding: 4px !important;
    }

    .product-info{
        padding: 6px 2px 2px 2px !important;
        text-align: center;
    }

    /* ۳. عنوان محصول کوچک و وسط‌چین */
    .product-info h2{
        font-size: 11px !important;
        line-height: 1.4 !important;
        height: 32px !important;
        margin-bottom: 4px !important;
        text-align: center;
    }

    /* ۴. قیمت محصول */
    .product-price{
        font-size: 12px !important;
        text-align: center;
        margin: 4px 0 0 0 !important;
    }

    .old-price{
        font-size: 10px !important;
    }

    /* ۵. مخفی کردن دکمه آبی و اطلاعات اضافی روی موبایل جهت شباهت کامل به نمونه مرجع */
    .product-code,
    .product-category,
    .product-vehicles,
    .available,
    .unavailable,
    .product-btn{
        display: none !important;
    }
}