@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap');

:root {
    --font-family: inherit, sans-serif;
    --spacing: 1.5rem;
    --primary: #007bff;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --card-bg: #fff;
    --price-color: #d32f2f;
    --discount-color: #e53935;
    --button-bg: #007bff;
    --button-hover: #0056b3;
    --brand-gradient: linear-gradient(268deg,#19b16a,#2b8c51);
    --discount-gradient: linear-gradient(89deg,#ff1313,#ef6b26);
}

.banimode-product-grid {
    direction: rtl;
    display: grid;
    gap: var(--spacing);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: var(--spacing);
}

.banimode-product-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.banimode-product-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.banimode-product-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.banimode-product-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.banimode-product-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.banimode-product-grid[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1024px) {
    .banimode-product-grid[data-columns="5"],
    .banimode-product-grid[data-columns="6"] {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .banimode-product-grid[data-columns="4"],
    .banimode-product-grid[data-columns="5"],
    .banimode-product-grid[data-columns="6"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 576px) {
    .banimode-product-grid[data-columns="3"],
    .banimode-product-grid[data-columns="4"],
    .banimode-product-grid[data-columns="5"],
    .banimode-product-grid[data-columns="6"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .banimode-product-grid[data-columns="2"],
    .banimode-product-grid[data-columns="3"],
    .banimode-product-grid[data-columns="4"],
    .banimode-product-grid[data-columns="5"],
    .banimode-product-grid[data-columns="6"] {
        grid-template-columns: 1fr;
    }
}

/* Common Card Styles */
.product-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    /*box-shadow: var(--shadow);*/
    /*transition: transform 0.3s ease, box-shadow 0.3s ease;*/
    text-align: center;
    font-family: var(--font-family);
    height: 100%;
    display: flex;
    flex-direction: column;
    border:1px solid #f9f9f9;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.product-card a {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.image-wrapper {
    aspect-ratio: 1/1;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    position: relative;
    overflow: hidden;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #757575;
    font-weight: bold;
    font-size: 14px;
}

img {
    width: 100%;
    height: 100%;
    /*object-fit: contain;*/
    max-height: 250px;
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

.info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 0.5rem;
}

.title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5em;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
}

.price {
    margin-top: auto;
    font-weight: 700;
    color: var(--price-color);
    font-size: 1.2rem;
    text-align: center;
}

.price .old {
    color: #aaa;
    text-decoration: line-through;
    margin-left: 0.5rem;
    font-size: 0.9rem;
    font-weight: normal;
}

.price .new {
    color: var(--price-color);
}

.discount {
    color: var(--discount-color);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.availability {
    color: #555;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Brand Discount New Card */
.product-card-brand-discount-new {
    position: relative;
    width: 100%;
    border-radius: .5rem;
    --tw-border-opacity: 1;
    border-color: rgb(240 240 240/var(--tw-border-opacity,1));
    transition-duration: .3s;
    transition-timing-function: cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    /*box-shadow: 0 4px 15px rgba(0,0,0,0.08);*/
}

/*.product-card-brand-discount-new:hover {*/
/*    transform: translateY(-5px);*/
/*    box-shadow: 0 8px 25px rgba(0,0,0,0.12);*/
/*}*/

.product-card-brand-discount-new .image-wrapper {
    position: relative;
    aspect-ratio: 1/1;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    overflow: hidden;
}

.product-card-brand-discount-new .discount-badge-new {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--discount-gradient);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.product-card-brand-discount-new .brand-badge-new {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--brand-gradient);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.product-card-brand-discount-new .info {
    padding: 8px;
    text-align: center;
}

.product-card-brand-discount-new .title {
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card-brand-discount-new .price {
    font-size: 13px;
    margin: 0;
    color: #d32f2f;
    font-weight: 700;
}

.product-card-brand-discount-new .price .old {
    color: #aaa;
    text-decoration: line-through;
    margin-left: 0.1rem;
    font-size: 0.9rem;
    font-weight: normal;
}

.product-card-brand-discount-new .price .new {
    color: #d32f2f;
}