/* ==========================
      POPULAR PRODUCTS
========================== */

.popular-products{
    padding:55px 0 70px;
    background:#f5f7fb;
}
/* ==========================
        PRODUCTS GRID
========================== */

.products-grid{
    display:grid;
    grid-template-columns:repeat(5, 1fr);
    gap:18px;
    margin-top:30px;
    width:100%;
}

/* ==========================
        PRODUCT CARD
========================== */

.product-card{
    height:340px;
    min-width:0;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:14px;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    transition:.25s;
}


.product-card:hover{
    transform:translateY(-3px);
    box-shadow:0 10px 25px rgba(31,41,55,.10);
}


/* ==========================
        PRODUCT IMAGE
========================== */

.product-image{
   position: relative;
    flex: 0 0 220px;
    min-height: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    overflow: hidden;
    box-sizing: border-box;
 }   
.product-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center;
}



/* ==========================
          BADGE
========================== */

.product-badge{
    position:absolute;
    top:10px;
    left:10px;

    padding:4px 5px;

    background:#E8943A;
    color:#fff;

    border-radius:6px;
    font-size:10px;
    font-weight:600;

    z-index:20;
}
.product-badge.used{
    background:#374151;
}
/* ==========================
        FAVORITE
========================== */

.product-favorite,
.product-card__favorite{
    position:absolute;
    top:10px;
    right:10px;

    width:32px;
    height:32px;

    border:none;
    border-radius:50%;

    background:#f3f4f6;

    font-size:18px;
    line-height:1;

    cursor:pointer;

    z-index:30;
    pointer-events:auto;

    display:flex;
    align-items:center;
    justify-content:center;
}
.product-favorite:hover,
.product-card__favorite:hover{
    color:#F28C28;
    border-color:#F28C28;
}
/* ==========================
        PRODUCT INFO
========================== */

.product-info{
    flex:1;
    min-height:0;
    padding:12px 15px 15px;
    display:grid;
    grid-template-rows:61px 22px 38px 1fr auto;
    gap:0;
}
.product-meta{
    grid-row:2;
    margin:0;
    font-size:12px;
    line-height:22px;
    color:#6b7280;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.product-title{
    margin:0;
    font-size:13px;
    font-weight:700;
    line-height:20px;
    color:#1f2937;
    height:60px;
    max-height:60px;
    overflow:hidden;
    display:block;
}
.product-code{
    margin:0;
    font-size:12px;
    line-height:19px;
    color:#8B95A5;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    line-clamp:2;
    overflow:hidden;
    height:38px;
    grid-row:3;
}
/* ==========================
        PRICE + CART
========================== */

.product-bottom{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    grid-row:5;
}


.product-price{
    font-size:15px;
    color:#1F2937;
}


/* ==========================
        CART
========================== */

.product-card__cart {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #E8943A;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: .2s ease;
}

.product-card__cart:hover {
    background: #E57814;
    transform: translateY(-2px);
}

.product-card__cart img {
    width: 24px;
    height: 24px;

    display: block;
    object-fit: contain;
}
/* =========================================================
   POPULAR PRODUCTS — NEW CARD STYLE
   ========================================================= */

.product-card__image{
    position:relative;
    flex:0 0 40%;
    min-height:0;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#fff;
    overflow:hidden;
    box-sizing:border-box;
}
.product-card__image img{
    width:100%;
    height:100%;
    object-fit:contain;
    object-position:center;
    display:block;
    pointer-events:none;
}
.product-card__condition{
    position:absolute;
    top:10px;
    left:10px;
    z-index:2;
    padding:5px 9px;
    border-radius:7px;
    background:#f3f4f6;
    color:#374151;
    font-size:12px;
    font-weight:600;
    line-height:1;
}

.product-card__favorite{
    position:absolute;
    top:10px;
    right:10px;
    z-index:2;
    width:36px;
    height:36px;
    padding:0;
    border:1px solid #e5e7eb;
    border-radius:50%;
    background:#fff;
    color:#6b7280;
    font-size:22px;
    line-height:1;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}

.product-card__favorite:hover{
    color:#e77b2c;
    border-color:#e77b2c;
}

.product-card__content{
    flex:1;
    min-height:0;
    padding:12px 15px 15px;
    display:grid;
    grid-template-rows:auto auto auto 1fr;
    box-sizing:border-box;
    border-top:1px solid #edf0f4;
}

.product-card__title{
    margin:0;
    font-size:13px;
    font-weight:700;
    line-height:20px;
    color:#1f2937;
    height:60px;
    max-height:60px;
    overflow:hidden;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
    line-clamp:3;
}

.product-card__car{
    margin:0;
    font-size:12px;
    line-height:20px;
    color:#6b7280;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.product-card__oem{
    margin:0;
    font-size:12px;
    line-height:19px;
    color:#8b95a5;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    line-clamp:2;
    overflow:hidden;
}

.product-card__bottom{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:10px;
    margin-top:auto;
}

.product-card__price{
    font-size:13px;
    font-weight:800;
    line-height:44px;
    color:#1f2937;
    white-space:nowrap;
}

.product-card__cart{
    width:44px;
    height:44px;
    min-width:44px;
    padding:0;
    border:none;
    border-radius:50%;
    background:#e77b2c;
    color:#fff;
    font-size:14px;
    font-weight:600;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition:.2s;
}

.product-card__cart:hover{
    background:#d96d20;
    transform:translateY(-2px);
}

.product-card__cart img{
    width:22px;
    height:22px;
    object-fit:contain;
    display:block;
}
/* =================================
   POPULAR PRODUCT CARD — IMAGE
   ================================= */

.product-card__image {
    position: relative;
    flex: 0 0 40%;
    min-height: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: none;
    pointer-events: none;
}

.product-card:hover .product-card__image img {
    transform: scale(1.04);
}
/* =================================
   CONDITION BADGE
   ================================= */

.product-card__condition {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 7px 12px;
    background: #E8943A;
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.product-card__favorite {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
/* Акційні товари на головній */
.sale-products #home-sale-products {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    align-items: stretch;
}

@media (max-width: 1000px) {
    .sale-products #home-sale-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .sale-products #home-sale-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}