/**
 * Recomandari cos — category_products.tpl in context cart.
 * Override cart.css "Recommendations Products" (~L3601) + aliniere category-new.css.
 * Scope: #cart_content #similar_products_content #cart-recommendations
 */

/* ---- Layout column_one ---- */
#cart_content .column_one #similar_products_content,
#cart_content #similar_products_content #cart-recommendations {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Spatiu intre titlu "Cele mai vandute" si slider produse */
#cart_content #similar_products_content #cart-recommendations {
    gap: 16px;
}

#cart_content #similar_products_content #cart-recommendations .products_header {
    margin: 0;
    padding: 0;
}

#cart_content #similar_products_content #cart-recommendations .products_body {
    margin: 0;
    padding: 0;
}

#cart_content #similar_products_content .cart-recommendations-heading {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    width: fit-content;
    max-width: 100%;
}

#cart_content #similar_products_content .cart-recommendations-heading .cart-recommendations-swoosh {
    display: block;
    width: 100%;
    height: auto;
}

#cart_content #similar_products_content #cart-recommendations .products_body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Scroll ascuns (ca pe category / mobile cart) */
#cart_content #similar_products_content #cart-recommendations .products_body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Reset cart.css #similar_products_content .products_content (flex + overflow hidden) */
#cart_content #similar_products_content #cart-recommendations .products_body .products_content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    height: auto !important;
}

/* ---- custom_products wrapper ---- */
#cart_content #similar_products_content #cart-recommendations .custom_products.cart-rec-category-products {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 0;
    flex-shrink: 0;
}

#cart_content #similar_products_content #cart-recommendations .custom_products.cart-rec-category-products .custom_products_content {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px !important;
    column-gap: 12px !important;
    row-gap: 12px !important;
    min-width: 100%;
    height: auto;
    overflow: visible;
    grid-template-columns: none !important;
}

/* ---- Card intreg: mobile 150px (override cart.css width:100%) ---- */
#cart_content #similar_products_content #cart-recommendations .products_body .products_content .custom_product_content,
#cart_content #similar_products_content #cart-recommendations .custom_products .custom_product_content.category-product-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    flex: 0 0 150px !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    gap: 2px !important;
    padding: 0 !important;
    height: auto !important;
    box-sizing: border-box !important;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_container,
#cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_title,
#cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_delivery,
#cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_prices {
    width: 150px;
    max-width: 150px;
    min-width: 150px;
    flex-shrink: 0;
    box-sizing: border-box;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 12px;
    background: #F5F5F5;
    position: relative;
    width: 150px;
    max-width: 150px;
    height: auto;
    padding: 0;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    height: auto;
    padding: 10px 10px 0;
    position: absolute;
    top: 0;
    z-index: 1;
}

#cart_content #similar_products_content #cart-recommendations .custom_promo {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 80%;
    height: auto;
    min-height: 22px;
    gap: 2px;
    align-items: flex-start;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_discount {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    height: auto;
    min-width: 38px;
    flex: 0 0 auto;
    position: relative;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_discount label {
    color: #fff;
    text-align: center;
    font-family: VelaSans, sans-serif;
    font-size: 8px;
    font-style: normal;
    font-weight: bold;
    line-height: 1;
    letter-spacing: -0.3px;
    width: 37px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    overflow: hidden;
    left: 0;
    top: 0;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_wishlist {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    flex-direction: column;
    height: auto;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_wishlist span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_wishlist span img {
    display: flex;
    max-height: 100%;
    max-width: 100%;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex-shrink: 0;
    width: 150px;
    max-width: 150px;
    height: 150px;
    max-height: 150px;
    position: relative;
    touch-action: pan-y pinch-zoom;
    -webkit-user-select: none;
    user-select: none;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_image > a {
    display: block;
    flex-shrink: 0;
    width: 150px;
    max-width: 150px;
    height: 150px;
    max-height: 150px;
    min-width: 150px;
    min-height: 150px;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_image_default {
    position: relative;
    display: block;
    width: 150px;
    height: 150px;
    min-width: 150px;
    min-height: 150px;
    max-width: 150px;
    max-height: 150px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    mix-blend-mode: multiply;
    padding: 0;
    transition: transform 0.5s ease-in-out;
    border-radius: 12px;
    overflow: hidden;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_image_default > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    mix-blend-mode: multiply;
    border-radius: 12px;
}

/* Mobile: card intreg 150px — nu se intinde cand sunt putine produse */
@media screen and (max-width: 767px) {
    #cart_content #similar_products_content #cart-recommendations .products_body .products_content .custom_product_content,
    #cart_content #similar_products_content #cart-recommendations .custom_products .custom_product_content.category-product-card {
        flex: 0 0 150px !important;
        flex-grow: 0 !important;
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
    }

    #cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_container,
    #cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_title,
    #cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_delivery,
    #cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_prices,
    #cart_content #similar_products_content #cart-recommendations .custom_product_container,
    #cart_content #similar_products_content #cart-recommendations .custom_product_title,
    #cart_content #similar_products_content #cart-recommendations .custom_product_delivery,
    #cart_content #similar_products_content #cart-recommendations .custom_product_prices,
    #cart_content #similar_products_content #cart-recommendations .custom_product_image,
    #cart_content #similar_products_content #cart-recommendations .custom_product_image > a,
    #cart_content #similar_products_content #cart-recommendations .custom_product_image_default {
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
    }

    #cart_content #similar_products_content #cart-recommendations .custom_product_image,
    #cart_content #similar_products_content #cart-recommendations .custom_product_image > a,
    #cart_content #similar_products_content #cart-recommendations .custom_product_image_default {
        height: 150px !important;
        min-height: 150px !important;
        max-height: 150px !important;
    }
}

#cart_content #similar_products_content #cart-recommendations .custom_product_images_slider {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 30px;
    height: auto;
    flex-shrink: 0;
    gap: 8px;
    position: absolute;
    bottom: 5px;
    z-index: 10;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_images_slider span {
    display: flex;
    width: 28px;
    height: 3px;
    background-repeat: no-repeat;
    background-image: url(/catalog/view/smartv3/svg/slider_line_white.svg);
    cursor: pointer;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_images_slider span.selected {
    background-image: url(/catalog/view/smartv3/svg/slider_line_black.svg);
}

#cart_content #similar_products_content #cart-recommendations .custom_product_images_slider span img {
    display: none !important;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_title {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 150px;
    max-width: 150px;
    min-width: 150px;
    flex-shrink: 0;
    max-height: 52px;
    min-height: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_title h4,
#cart_content #similar_products_content #cart-recommendations .custom_product_title p {
    color: #12100B;
    font-family: VelaSans-Semi, sans-serif;
    font-size: 12.5px !important;
    font-style: normal;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    margin: 0;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_delivery {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 150px;
    max-width: 150px;
    min-width: 150px;
    flex-shrink: 0;
    height: 21px;
    box-sizing: border-box;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_delivery span {
    font-family: VelaSans, sans-serif;
    font-size: 12.5px;
    color: #78BA66;
}

/* Preturi + add to cart — ca category (row, nu column din cart.css) */
#cart_content #similar_products_content #cart-recommendations .custom_product_prices {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    flex-direction: row !important;
    width: 150px;
    max-width: 150px;
    min-width: 150px;
    flex-shrink: 0;
    max-height: 100%;
    min-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 2px !important;
    box-sizing: border-box;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_prices > a {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_price {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    min-height: 36px;
    gap: 2px;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_price span.regular {
    color: #12100B;
    font-family: VelaSans, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_price span.special {
    color: #949494;
    font-family: VelaSans-Medium, sans-serif;
    font-size: 12.5px !important;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: line-through;
    text-decoration-color: #ED2939;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_credit {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    min-height: 0;
    flex-shrink: 0;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_credit span {
    color: #949494;
    font-family: VelaSans-Medium, sans-serif;
    font-size: 12.5px !important;
    font-weight: 400;
    line-height: 1.4;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_tools {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    flex-shrink: 0 !important;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_tools button,
#cart_content #similar_products_content #cart-recommendations .custom_product_tools button.add_to_cart {
    border-radius: 12px;
    color: #37474F;
    background: none !important;
    background-repeat: no-repeat;
    background-image: url(/catalog/view/smartv3/svg/add_cart_desktop.svg) !important;
    text-align: center;
    font-family: VelaSans, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    border: none;
    outline: none;
    padding: 14px;
    width: 51px !important;
    height: 36px;
    cursor: pointer;
    flex-shrink: 0;
}

#cart_content #similar_products_content #cart-recommendations .custom_product_tools button:hover,
#cart_content #similar_products_content #cart-recommendations .custom_product_tools button:focus {
    background: none !important;
    background-image: url(/catalog/view/smartv3/svg/add_cart_desktop.svg) !important;
}

/* Desktop: card intreg max 220px */
@media screen and (min-width: 768px) {
    #cart_content #similar_products_content #cart-recommendations .custom_products.cart-rec-category-products .custom_products_content {
        gap: 16px !important;
        column-gap: 16px !important;
        row-gap: 16px !important;
    }

    #cart_content #similar_products_content #cart-recommendations .products_body .products_content .custom_product_content,
    #cart_content #similar_products_content #cart-recommendations .custom_products .custom_product_content.category-product-card {
        flex: 0 0 220px !important;
        width: 220px !important;
        min-width: 220px !important;
        max-width: 220px !important;
    }

    #cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_container,
    #cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_title,
    #cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_delivery,
    #cart_content #similar_products_content #cart-recommendations .custom_product_content.category-product-card > .custom_product_prices,
    #cart_content #similar_products_content #cart-recommendations .custom_product_container,
    #cart_content #similar_products_content #cart-recommendations .custom_product_title,
    #cart_content #similar_products_content #cart-recommendations .custom_product_delivery,
    #cart_content #similar_products_content #cart-recommendations .custom_product_prices {
        width: 220px;
        min-width: 220px;
        max-width: 220px;
    }

    #cart_content #similar_products_content #cart-recommendations .custom_product_image,
    #cart_content #similar_products_content #cart-recommendations .custom_product_image > a,
    #cart_content #similar_products_content #cart-recommendations .custom_product_image_default {
        width: 220px;
        height: 220px;
        min-width: 220px;
        min-height: 220px;
        max-width: 220px;
        max-height: 220px;
        aspect-ratio: 1 / 1;
    }

    #cart_content #similar_products_content #cart-recommendations .custom_product_image > a {
        flex-shrink: 0;
    }
}

/* Skeleton */
#cart_content #similar_products_content #cart-recommendations.is-skeleton .custom_products_content {
    pointer-events: none;
}

#cart_content #similar_products_content #cart-recommendations .skeleton-box {
    position: relative;
    overflow: hidden;
    background: #ececec;
}

#cart_content #similar_products_content #cart-recommendations .skeleton-box::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: cart-rec-skeleton-shimmer 1.2s infinite;
}

@keyframes cart-rec-skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}
