.product-grid.row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 15px 0 0 !important;
    width: 100%;
}

.product-grid .product-item {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    height: 100%;
}


/* ==========================================================
   PRODUCT CARD
   ========================================================== */

.product-card {
    width: 100%;
    height: 100%;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    text-align: center;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

    .product-card:hover {
        transform: translateY(-4px);
        border-color: #d9dee7;
        box-shadow: 0 10px 28px rgba(0,0,0,.10);
    }


/* ==========================================================
   PRODUCT IMAGE
   ========================================================== */

.product-image-box {
    width: 100%;
    text-align: center;
}

.product-grid .product-image-box {
    width: 100%;
    height: 210px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .product-grid .product-image-box img,
    .product-grid .product-card img {
        width: 100%;
        height: 200px;
        display: block;
        object-fit: contain;
    }


/* ==========================================================
   PRODUCT INFORMATION
   ========================================================== */

.product-info-box {
    width: 100%;
}

.product-grid .product-info-box {
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* ==========================================================
   PRODUCT LINK
   ========================================================== */

.product-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

    .product-link:hover {
        color: inherit;
        text-decoration: none;
    }


/* ==========================================================
   PRODUCT NAME
   Fixed area keeps rows aligned
   ========================================================== */

.product-name {
    color: #222;
    font-size: 15px;
    font-weight: 600;
}

.product-grid .product-name {
    height: 66px;
    min-height: 66px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 15px;
    line-height: 22px;
    text-align: center;
}


/* ==========================================================
   PRODUCT PRICE
   ========================================================== */

.product-grid .product-price {
    min-height: 62px;
    margin: 4px 0 0;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.product-price .mrp {
    color: #9ca3af;
    font-size: 14px;
    text-decoration: line-through;
}

.product-price .special {
    color: #dc2626;
    font-size: 18px;
    font-weight: 800;
}

.product-grid .save-percent {
    flex-basis: 100%;
    margin-top: 3px;
    color: #15803d;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}


/* ==========================================================
   PRODUCT RATING
   ========================================================== */

.product-grid .product-rating {
    height: 32px;
    min-height: 32px;
    margin: 5px 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

    .product-grid .product-rating .star {
        color: #f5b400;
        font-size: 16px;
        line-height: 1;
    }

.search-product-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 8px 0;
    font-size: 14px;
}

.rating-stars .filled {
    color: #f5b400;
}

.rating-stars .empty {
    color: #d1d5db;
}

.rating-value {
    color: #111827;
    font-weight: 600;
}

.rating-count {
    color: #6b7280;
}


/* ==========================================================
   ADD TO CART
   ========================================================== */

.add-cart-btn {
    width: 100%;
    margin-top: auto;
    border: 0;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .22s ease;
}

.product-grid .add-cart-btn {
    width: 100%;
    height: 48px;
    margin-top: auto;
    padding: 0 12px;
    border: 1px solid #2563eb;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .15px;
    box-shadow: 0 2px 5px rgba(37,99,235,.18);
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}

    .product-grid .add-cart-btn:hover {
        background: #1d4ed8;
        border-color: #1d4ed8;
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 5px 12px rgba(37,99,235,.25);
    }

    .product-grid .add-cart-btn:active {
        background: #1e40af;
        border-color: #1e40af;
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(37,99,235,.20);
    }


/* ==========================================================
   WISHLIST
   ========================================================== */

.product-wishlist-form {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    margin: 0;
}

.product-wishlist-button {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}

    .product-wishlist-button .wishlist-heart {
        color: #6b7280;
        font-size: 25px;
        line-height: 1;
    }

    .product-wishlist-button.in-wishlist {
        background: #fff7f7;
        border-color: #f3c2c2;
    }

        .product-wishlist-button.in-wishlist .wishlist-heart {
            color: #e53935;
        }

    .product-wishlist-button:hover {
        transform: scale(1.06);
        box-shadow: 0 4px 12px rgba(0,0,0,.15);
    }

        .product-wishlist-button:hover .wishlist-heart {
            color: #e53935;
        }


/* ==========================================================
   LIST VIEW - DESKTOP
   ========================================================== */

.product-grid.list-view.row {
    display: block !important;
}

.product-grid.list-view .product-item {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 18px !important;
}

.product-grid.list-view .product-card {
    min-height: 280px;
    display: grid !important;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 30px;
    align-items: center;
    padding: 18px 24px;
    text-align: left;
}

.product-grid.list-view .product-image-box {
    width: 236px;
}

    .product-grid.list-view .product-image-box img {
        width: 100% !important;
        height: 240px !important;
        object-fit: contain;
    }

.product-grid.list-view .product-info-box {
    align-items: flex-start;
}

.product-grid.list-view .product-name {
    height: auto;
    min-height: 0;
    display: block;
    text-align: left;
}

.product-grid.list-view .product-price {
    min-height: 0;
    justify-content: flex-start;
    text-align: left;
}

.product-grid.list-view .save-percent {
    text-align: left;
}

.product-grid.list-view .product-rating {
    height: auto;
    min-height: 32px;
    justify-content: flex-start;
}

.product-grid.list-view .add-cart-btn {
    width: 180px;
    margin-top: 10px;
}

.product-grid.list-view .product-wishlist-form {
    top: 14px;
    right: 14px;
}


/* ==========================================================
   HOME PRODUCT SLIDER
   ========================================================== */

.product-slider .product-card {
    flex: 0 0 calc(20% - 18px);
    min-width: 220px;
    max-width: 260px;
}

    .product-slider .product-image-box img,
    .product-slider .product-card img {
        width: 100%;
        height: 220px;
        object-fit: contain;
    }


/* ==========================================================
   TABLET PRODUCT GRID
   ========================================================== */

@media (max-width: 991px) and (min-width: 768px) {

    .product-grid.row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* ==========================================================
   MOBILE PRODUCT GRID / CARD
   ========================================================== */

@media (max-width: 767px) {

    .product-grid.row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 8px !important;
    }

    .product-grid .product-item {
        min-width: 0;
    }

    .product-grid .product-card {
        min-height: 0 !important;
        padding: 9px !important;
        border: 1px solid #e4e7ec !important;
        border-radius: 12px !important;
        background: #fff !important;
        box-shadow: 0 2px 8px rgba(15,23,42,.04);
        transform: none;
    }

        .product-grid .product-card:hover {
            transform: none;
            box-shadow: 0 3px 10px rgba(15,23,42,.07);
        }

    .product-grid .product-image-box {
        width: 100% !important;
        height: 150px !important;
        aspect-ratio: auto !important;
        padding: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

        .product-grid .product-image-box img {
            width: 100% !important;
            height: 142px !important;
            max-width: 100%;
            display: block;
            object-fit: contain !important;
        }

    .product-grid .product-info-box {
        padding-top: 5px;
    }

    .product-grid .product-name {
        height: 57px !important;
        min-height: 57px !important;
        margin: 0 !important;
        color: #1d2939 !important;
        font-size: 13px !important;
        line-height: 19px !important;
        font-weight: 600 !important;
    }

    .product-grid .product-price {
        min-height: 57px !important;
        margin: 5px 0 0 !important;
        gap: 3px !important;
    }

        .product-grid .product-price .mrp {
            font-size: 12px !important;
        }

        .product-grid .product-price .special {
            color: #dc2626 !important;
            font-size: 16px !important;
            font-weight: 800 !important;
        }

    .product-grid .save-percent {
        margin-top: 2px !important;
        color: #15803d !important;
        font-size: 12px !important;
        font-weight: 800 !important;
    }

    .product-grid .product-rating {
        height: 27px !important;
        min-height: 27px !important;
        margin: 2px 0 7px !important;
        gap: 2px !important;
    }

        .product-grid .product-rating .star {
            font-size: 15px !important;
        }

    .product-grid .add-cart-btn {
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 10px !important;
        border-radius: 9px !important;
        font-size: 13px !important;
        box-shadow: 0 3px 8px rgba(37,99,235,.17);
    }

    .product-wishlist-form {
        top: 7px !important;
        right: 7px !important;
    }

    .product-wishlist-button {
        width: 34px !important;
        height: 34px !important;
        border-color: #e4e7ec !important;
        box-shadow: 0 2px 7px rgba(15,23,42,.10) !important;
    }

        .product-wishlist-button .wishlist-heart {
            font-size: 22px !important;
        }


    /* ---------------- MOBILE LIST VIEW ---------------- */

    .product-grid.list-view .product-card {
        min-height: 180px !important;
        display: grid !important;
        grid-template-columns: 130px minmax(0, 1fr) !important;
        gap: 12px !important;
        padding: 10px !important;
        text-align: left !important;
    }

    .product-grid.list-view .product-image-box {
        width: 130px !important;
        height: 150px !important;
    }

        .product-grid.list-view .product-image-box img {
            width: 130px !important;
            height: 145px !important;
        }

    .product-grid.list-view .product-info-box {
        align-items: flex-start;
    }

    .product-grid.list-view .product-name {
        height: auto !important;
        min-height: 0 !important;
        text-align: left !important;
    }

    .product-grid.list-view .product-price {
        min-height: 0 !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }

    .product-grid.list-view .save-percent {
        text-align: left !important;
    }

    .product-grid.list-view .product-rating {
        justify-content: flex-start !important;
    }

    .product-grid.list-view .add-cart-btn {
        width: 150px !important;
        max-width: 100% !important;
        margin-top: 7px !important;
    }
}


/* ==========================================================
   SMALL MOBILE
   ========================================================== */

@media (max-width: 420px) {

    .product-grid.row {
        gap: 8px !important;
    }

    .product-grid .product-card {
        padding: 8px !important;
    }

    .product-grid .product-image-box {
        height: 140px !important;
    }

        .product-grid .product-image-box img {
            height: 132px !important;
        }
}
