/* ============================================
   AVTOBAZA - Product Card Modern Styles
   Created: December 7, 2024
   ============================================ */

/* ============================================
   1. PRODUCT CARD CONTAINER
   ============================================ */

.product_card {
    padding: 0;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product_card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 185, 29, 0.03) 0%, rgba(255, 185, 29, 0) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1;
}

.product_card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.product_card:hover::before {
    opacity: 1;
}

/* ============================================
   2. PRODUCT CARD TOP (Image Section)
   ============================================ */

.product_card_top {
    position: relative;
    background: #fafafa;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    height: 250px;
    overflow: hidden;
}

.product_card_top .img_wrapper {
    width: 100%;
    height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 0;
}

.product_card_top .img_wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(1);
}

.product_card:hover .product_card_top .img_wrapper img {
    transform: scale(1.05);
    filter: brightness(1.05);
}

/* Heart Icon (Wishlist) */
.product_card_top .heart-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.product_card_top .heart-icon:hover {
    background: #ffb91d;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(255, 185, 29, 0.4);
}

.product_card_top .heart-icon img {
    width: 20px;
    height: 20px;
    transition: filter 0.3s ease;
}

.product_card_top .heart-icon:hover img {
    filter: brightness(0) invert(1);
}

/* BMW Icon */
.bmw_icon {
    width: 75px;
    top: 2px !important;
    position: absolute;
    z-index: 5;
}

/* ============================================
   3. PRODUCT CARD BOTTOM (Info Section)
   ============================================ */

.product_card_bottom {
    padding: 16px !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    position: relative;
    z-index: 2;
}

/* Guarantee Badge */
.check_guarantee {
    display: inline-flex;
    align-items: center;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border-radius: 8px;
    padding: 6px 12px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.35);
    transition: all 0.3s ease;
    gap: 6px;
}

.product_card:hover .check_guarantee {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.45);
}

.check_guarantee .check-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.check_guarantee .official_guarantee {
    font-size: 11px;
    color: #ffffff;
    padding: 0;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1.2;
    white-space: nowrap;
}

/* Product Name */
.product_card_bottom .product-name {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: 500;
    color: #1a202c;
    text-decoration: none;
    transition: color 0.3s ease;
    margin-top: 8px;
}

.product_card_bottom .product-name:hover {
    color: #ffb91d;
}

.text-avtobaza {
    color: #0f0f4c;
}

/* ============================================
   4. INSTALLMENT SECTION
   ============================================ */

.MPProductInstallment {
    display: flex;
    align-items: center;
    margin-top: 8px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.MPProductInstallment:hover {
    transform: translateX(3px);
}

.MPProductInstallment img {
    margin-right: 6px;
    vertical-align: middle;
    width: 16px;
    height: 16px;
}

.MPProductInstallment span {
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
}

.MPProductInstallment-YellowText {
    background: linear-gradient(135deg, #ffd740 0%, #ffb91d 100%);
    border-radius: 6px;
    color: #1e244d;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.4;
    margin-right: 8px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(255, 215, 64, 0.3);
    transition: all 0.3s ease;
}

.MPProductInstallment:hover .MPProductInstallment-YellowText {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(255, 215, 64, 0.5);
}

/* ============================================
   5. PRICE SECTION
   ============================================ */

.product_card_bottom .price {
    font-size: 14px;
    color: #718096 !important;
    text-decoration: line-through;
    font-weight: 500;
    display: block;
    margin-top: 8px;
}

.product_card_bottom .discount_price {
    font-size: 20px;
    color: #1a202c !important;
    font-weight: bold;
    display: block;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product_card_bottom .discount_price:hover {
    color: #ffb91d !important;
}

/* ============================================
   6. BUTTON SECTION
   ============================================ */

.product_card_bottom .btn_wrapper {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
}

.product_card_bottom .btn_wrapper .primary_btn {
    max-width: 100%!important;
}

.product_card_bottom .primary_btn {
    flex: 1;
    background: linear-gradient(135deg, #ffb91d 0%, #ffa500 100%);
    color: #0f0f4c;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(255, 185, 29, 0.3);
}

.product_card_bottom .primary_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 185, 29, 0.5);
    filter: brightness(1.05);
}

.product_card_bottom .primary_btn:active {
    transform: translateY(0);
}

.product_card_bottom .main_btn {
    width: 44px;
    height: 44px;
    background: rgba(15, 15, 76, 0.7);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.product_card_bottom .main_btn:hover {
    background: #0f0f4c;
    border-color: #0f0f4c;
    transform: scale(1.08);
}

.product_card_bottom .main_btn img {
    width: 20px;
    height: 20px;
    transition: filter 0.3s ease;
    opacity: 0.8;
}

.product_card_bottom .main_btn:hover img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* ============================================
   7. RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1199px) {
    .product_card_top {
        height: 220px;
        padding: 0;
    }

    .product_card_top .img_wrapper {
        height: 100% !important;
        padding: 0;
    }

    .product_card_top .img_wrapper img {
        object-fit: contain;
    }

    .product_card_bottom .product-name {
        font-size: 14px;
    }

    .product_card_bottom .discount_price {
        font-size: 18px;
    }
}

@media (max-width: 991px) {
    .product_card {
        border-radius: 14px;
    }

    .product_card_top {
        height: 200px;
        padding: 0;
    }

    .product_card_top .img_wrapper {
        height: 100% !important;
        padding: 0;
    }

    .product_card_top .img_wrapper img {
        object-fit: contain;
    }

    .product_card_bottom {
        padding: 14px !important;
        gap: 8px;
    }

    .product_card_bottom .primary_btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .product_card_bottom .main_btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .product_card {
        border-radius: 12px;
    }

    .product_card:hover {
        transform: translateY(-4px);
    }

    .product_card_top {
        height: 180px;
        padding: 0;
    }

    .product_card_top .img_wrapper {
        height: 100% !important;
        padding: 0;
    }

    .product_card_top .img_wrapper img {
        object-fit: contain;
    }

    .product_card_top .heart-icon {
        width: 34px;
        height: 34px;
        top: 10px;
        right: 10px;
    }

    .product_card_top .heart-icon img {
        width: 18px;
        height: 18px;
    }

    .product_card_bottom {
        padding: 12px !important;
        gap: 6px;
    }

    .product_card_bottom .product-name {
        font-size: 13px;
        margin-top: 4px;
    }

    .product_card_bottom .price {
        font-size: 12px;
        margin-top: 4px;
    }

    .product_card_bottom .discount_price {
        font-size: 16px;
    }

    .MPProductInstallment {
        margin-top: 4px;
    }

    .MPProductInstallment span {
        font-size: 11px;
    }

    .MPProductInstallment-YellowText {
        font-size: 10px;
        padding: 3px 8px;
    }

    .product_card_bottom .btn_wrapper {
        gap: 6px;
        padding-top: 8px;
    }

    .product_card_bottom .primary_btn {
        padding: 9px 12px;
        font-size: 12px;
        border-radius: 8px;
    }

    .product_card_bottom .main_btn {
        width: 38px;
        height: 38px;
        border-radius: 8px;
    }

    .product_card_bottom .main_btn img {
        width: 18px;
        height: 18px;
    }

    .check_guarantee {
        top: 10px;
        left: 10px;
        padding: 5px 10px;
        border-radius: 6px;
        gap: 5px;
    }

    .check_guarantee .check-icon {
        width: 14px;
        height: 14px;
    }

    .check_guarantee .official_guarantee {
        font-size: 10px;
    }
}

@media (max-width: 576px) {
    .product_card {
        border-radius: 10px;
    }

    .product_card_top {
        height: 160px;
        padding: 0;
    }

    .product_card_top .img_wrapper {
        height: 100% !important;
        padding: 0;
    }

    .product_card_top .img_wrapper img {
        object-fit: contain;
    }

    .product_card_bottom .primary_btn {
        padding: 8px 10px;
    }
}

/* ============================================
   8. SPECIAL STATES & EFFECTS
   ============================================ */

/* Loading State */
.product_card.loading {
    pointer-events: none;
    opacity: 0.7;
}

.product_card.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ffb91d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 100;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Out of Stock */
.product_card.out-of-stock {
    opacity: 0.6;
}

.product_card.out-of-stock::after {
    content: "Stokda yoxdur";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(220, 53, 69, 0.95);
    color: white;
    padding: 12px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* New Product Badge */
.product_card.new-product .product_card_top::before {
    content: "Yeni";
    position: absolute;
    top: 14px;
    left: 14px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 12px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

/* Sale Badge */
.product_card.on-sale .product_card_top::after {
    content: "Endirim";
    position: absolute;
    top: 14px;
    left: 14px;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 12px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
}

/* ============================================
   9. ACCESSIBILITY
   ============================================ */

/* Product Detail Sidebar - Recommended Product */
.detail_page_rightside .recommended-product-wrapper {
    margin-top: 20px;
}

/* Keep same appearance as main product cards, just optimize for sidebar */
.detail_page_rightside .product_card {
    max-width: 100%;
}

.detail_page_rightside .product_card_top {
    height: 220px;
    min-height: 220px;
}

.detail_page_rightside .product_card_top .img_wrapper {
    height: 100% !important;
}

/* Mobile responsive for sidebar product */
@media (max-width: 991px) {
    .detail_page_rightside .recommended-product-wrapper {
        margin-top: 16px;
    }

    .detail_page_rightside .product_card_top {
        height: 200px;
        min-height: 200px;
    }
}

/* ============================================
   9. ACCESSIBILITY (continued)
   ============================================ */

.product_card:focus-within {
    outline: 2px solid #ffb91d;
    outline-offset: 2px;
}

.product_card_bottom .primary_btn:focus,
.product_card_bottom .main_btn:focus {
    outline: 2px solid #ffb91d;
    outline-offset: 2px;
}

/* ============================================
   END OF PRODUCT_CARDS.CSS
   ============================================ */

