﻿/* ==============================
   FILTER BAR
============================== */
.filter-bar {
    background: #fff;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
}

    .filter-bar input,
    .filter-bar select {
        border-radius: 10px;
        font-size: 13px;
    }

/* ==============================
   PRODUCTS GRID
============================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* ==============================
   PRODUCT CARD
============================== */
.product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.07);
    transition: all .3s ease;
    position: relative;
    font-size: 14px;
    display: flex;
    flex-direction: column;
}

    .product-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 16px 40px rgba(0,0,0,.14);
    }

/* ==============================
   IMAGE
============================== */
.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f9fafb;
    overflow: hidden;
}

    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .35s ease;
    }

.product-card:hover .product-image img {
    transform: scale(1.06);
}

/* ==============================
   DISCOUNT BADGE
============================== */
.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 7px;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
}

/* ==============================
   BODY
============================== */
.product-body {
    /*    padding: 12px;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
}*/
    padding: 12px;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
/* ==============================
   TITLE & META
============================== */
.product-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    min-height: 42px;
}

.product-meta {
    font-size: 12px;
    color: #6b7280;
}


/* Description text */
.desc {
    display: -webkit-box; /* Required for line clamping */
    -webkit-box-orient: vertical; /* Vertical stacking */
    -webkit-line-clamp: 2; /* Number of lines to show */
    overflow: hidden; /* Hide extra text */
    text-overflow: ellipsis; /* Add "..." at end */
    width: 100%; /* Important: span or div must have width */
    cursor: help;
    position: relative;
    line-height: 1.4em;
}

    /* Custom tooltip (cleaner than default title) */
    .desc:hover::after {
        content: attr(title);
        position: absolute;
        bottom: 110%;
        left: 0; /* Changed to left for Arabic text */
        background: rgba(0,0,0,0.9);
        color: #fff;
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 12px;
        width: 220px;
        line-height: 1.4;
        z-index: 999;
        white-space: normal;
        box-shadow: 0 8px 20px rgba(0,0,0,.25);
    }

.reset-btn {
    background: linear-gradient(135deg, #4e9af1, #1a73e8);
    color: #fff;
    border: none;
    border-radius: 0 10px 10px 0; /* rounded right side */
    padding: 0 12px;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

#searchName{
    padding:7px;
    border-radius:9px 0px 0px 9px;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #1a73e8, #1a73e8);
    /*transform: translateY(-2px);*/
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.input-group .form-control {
    border-radius: 10px 0 0 10px; /* rounded left side */
}

.product-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.price-now {
    color: #dc2626;
    font-weight: 800;
    font-size: 15px;
}

.price-old {
    text-decoration: line-through;
    font-size: 12px;
    color: #9ca3af;
}

/* ==============================
   ADD TO CART BUTTON
============================== */
.add-cart-btn {
    margin-top: 8px;
    display: block;
    width: 100%;
    background: linear-gradient(135deg,#f59e0b,#f97316);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all .25s ease;
}

    .add-cart-btn:hover {
        background: linear-gradient(135deg,#f97316,#ea580c);
        color: #fff;
        transform: translateY(-1px);
    }

/* ==============================
   MOBILE OPTIMIZATION
============================== */
@media (max-width: 576px) {
    .desc:hover::after {
        width: 180px;
        font-size: 11px;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .product-card {
        font-size: 12px;
        border-radius: 14px;
    }

    .product-title {
        font-size: 12px;
        min-height: 32px;
    }

    .price-now {
        font-size: 13px;
    }

    .price-old {
        font-size: 10px;
    }

    .add-cart-btn {
        font-size: 12px;
        padding: 7px;
    }
}
