/**
 * Modern Product Cards Styling for Elstila Theme
 * Automatically loaded via themes/elstila/css/autoload/
 * Applies to:
 * - Dynamic Home Tabs (.elstila_tabs_content)
 * - Home Categories (.homecategories_content)
 * - Home Featured (.homefeatured_content)
 */

/* Hide the redundant 'Daugiau' button completely */
.elstila_tabs_content a.product_buttons__more,
.homecategories_content a.product_buttons__more,
.homefeatured_content a.product_buttons__more,
.blockbestsellers_content a.product_buttons__more {
    display: none !important;
}

/* Hide extra hover link box */
.elstila_tabs_content .product_list__links_box,
.homecategories_content .product_list__links_box,
.homefeatured_content .product_list__links_box,
.blockbestsellers_content .product_list__links_box {
    display: none !important;
}

/* Flatten the old bottom buttons container so it occupies 0 height */
.elstila_tabs_content .product_buttons,
.homecategories_content .product_buttons,
.homefeatured_content .product_buttons,
.blockbestsellers_content .product_buttons {
    position: static !important;
    height: 0 !important;
    border: none !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.elstila_tabs_content .product_buttons:before,
.homecategories_content .product_buttons:before,
.homefeatured_content .product_buttons:before,
.blockbestsellers_content .product_buttons:before {
    display: none !important;
}

/* Modern floating Wishlist heart button on the top-right corner over the product image */
.elstila_tabs_content a.product_buttons__dream,
.homecategories_content a.product_buttons__dream,
.homefeatured_content a.product_buttons__dream,
.blockbestsellers_content a.product_buttons__dream {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 10 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid #e5e5e5 !important;
    text-align: center !important;
    line-height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
    opacity: 0.92;
    text-decoration: none !important;
}

/* Keep visible or hidden state strictly matching blockwishlist jQuery toggle */
.elstila_tabs_content a.product_buttons__dream:not([style*="display:none"]):not([style*="display: none"]),
.homecategories_content a.product_buttons__dream:not([style*="display:none"]):not([style*="display: none"]),
.homefeatured_content a.product_buttons__dream:not([style*="display:none"]):not([style*="display: none"]),
.blockbestsellers_content a.product_buttons__dream:not([style*="display:none"]):not([style*="display: none"]) {
    display: inline-block !important;
}

.elstila_tabs_content a.product_buttons__dream[style*="display:none"],
.elstila_tabs_content a.product_buttons__dream[style*="display: none"],
.homecategories_content a.product_buttons__dream[style*="display:none"],
.homecategories_content a.product_buttons__dream[style*="display: none"],
.homefeatured_content a.product_buttons__dream[style*="display:none"],
.homefeatured_content a.product_buttons__dream[style*="display: none"],
.blockbestsellers_content a.product_buttons__dream[style*="display:none"],
.blockbestsellers_content a.product_buttons__dream[style*="display: none"] {
    display: none !important;
}

.elstila_tabs_content a.product_buttons__dream:hover,
.homecategories_content a.product_buttons__dream:hover,
.homefeatured_content a.product_buttons__dream:hover,
.blockbestsellers_content a.product_buttons__dream:hover {
    opacity: 1 !important;
    transform: scale(1.12) !important;
    box-shadow: 0 3px 10px rgba(237, 29, 37, 0.25) !important;
    border-color: #ed1d25 !important;
}

/* Hide text labels ('Žymėti', 'Add to wishlist', 'Remove from wishlist') */
.elstila_tabs_content a.product_buttons__dream .in,
.elstila_tabs_content a.product_buttons__dream .out,
.homecategories_content a.product_buttons__dream .in,
.homecategories_content a.product_buttons__dream .out,
.homefeatured_content a.product_buttons__dream .in,
.homefeatured_content a.product_buttons__dream .out,
.blockbestsellers_content a.product_buttons__dream .in,
.blockbestsellers_content a.product_buttons__dream .out {
    display: none !important;
}

/* Heart icon style centered within circle */
.elstila_tabs_content a.product_buttons__dream [class*="icon-"],
.homecategories_content a.product_buttons__dream [class*="icon-"],
.homefeatured_content a.product_buttons__dream [class*="icon-"],
.blockbestsellers_content a.product_buttons__dream [class*="icon-"] {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 30px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    color: #666666 !important;
    transition: color 0.2s ease !important;
}

/* Red heart on hover or active (saved in wishlist) */
.elstila_tabs_content a.product_buttons__dream:hover [class*="icon-"],
.elstila_tabs_content a.product_buttons__dream.active [class*="icon-"],
.homecategories_content a.product_buttons__dream:hover [class*="icon-"],
.homecategories_content a.product_buttons__dream.active [class*="icon-"],
.homefeatured_content a.product_buttons__dream:hover [class*="icon-"],
.homefeatured_content a.product_buttons__dream.active [class*="icon-"],
.blockbestsellers_content a.product_buttons__dream:hover [class*="icon-"],
.blockbestsellers_content a.product_buttons__dream.active [class*="icon-"] {
    color: #ed1d25 !important;
}

/* Product price top padding */
.elstila_tabs_content .product_list__price,
.homecategories_content .product_list__price,
.homefeatured_content .product_list__price,
.blockbestsellers_content .product_list__price {
    display: inline-block !important;
    padding-top: 10px !important;
}

/* Desktop layout: Perfect vertical height alignment between Promo card & 2 grid rows */
@media (min-width: 992px) {
    /* Left featured promo product: 544px matches (270px * 2) + 4px */
    .elstila_tabs_content .product_promo,
    .homecategories_content .product_promo,
    .homefeatured_content .product_promo,
    .blockbestsellers_content .product_promo {
        width: 434px !important;
        height: 544px !important;
        margin: 0 0 35px 0 !important;
        position: relative !important;
        float: left !important;
    }

    .elstila_tabs_content .product_promo__hold,
    .homecategories_content .product_promo__hold,
    .homefeatured_content .product_promo__hold,
    .blockbestsellers_content .product_promo__hold {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding: 24px 24px 18px 24px !important;
        background-position: right 0 bottom 0 !important;
    }

    .elstila_tabs_content .product_promo__image,
    .homecategories_content .product_promo__image,
    .homefeatured_content .product_promo__image,
    .blockbestsellers_content .product_promo__image {
        height: 300px !important;
        margin-bottom: 12px !important;
    }

    .elstila_tabs_content a.product_promo__title,
    .homecategories_content a.product_promo__title,
    .homefeatured_content a.product_promo__title,
    .blockbestsellers_content a.product_promo__title {
        height: 58px !important;
        font-size: 20px !important;
        line-height: 1.25 !important;
        margin-bottom: 8px !important;
    }

    .elstila_tabs_content .product_promo__price,
    .homecategories_content .product_promo__price,
    .homefeatured_content .product_promo__price,
    .blockbestsellers_content .product_promo__price {
        font-size: 26px !important;
    }

    /* Right 8-item grid (4 cols x 2 rows) */
    .elstila_tabs_content .product_list,
    .homecategories_content .product_list,
    .homefeatured_content .product_list,
    .blockbestsellers_content .product_list {
        width: calc(100% - 434px) !important;
        margin: 0 0 35px 0 !important;
        float: left !important;
    }

    /* Compact 270px height removes dead white gap under price */
    .elstila_tabs_content .product_list__items,
    .homecategories_content .product_list__items,
    .homefeatured_content .product_list__items,
    .blockbestsellers_content .product_list__items {
        width: calc(25% - 4px) !important;
        height: 270px !important;
        margin: 0 0 4px 4px !important;
        position: relative !important;
        float: left !important;
    }

    .elstila_tabs_content .product_list__hold,
    .homecategories_content .product_list__hold,
    .homefeatured_content .product_list__hold,
    .blockbestsellers_content .product_list__hold {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding: 16px 14px 14px 14px !important;
        background-position: right 0 bottom 0 !important;
    }

    .elstila_tabs_content .product_list__image,
    .homecategories_content .product_list__image,
    .homefeatured_content .product_list__image,
    .blockbestsellers_content .product_list__image {
        height: 130px !important;
        margin: 0 0 10px 0 !important;
    }

    .elstila_tabs_content a.product_list__title,
    .homecategories_content a.product_list__title,
    .homefeatured_content a.product_list__title,
    .blockbestsellers_content a.product_list__title {
        height: 48px !important;
        margin: 0 0 6px 0 !important;
    }

    .elstila_tabs_content a.product_list__title span,
    .homecategories_content a.product_list__title span,
    .homefeatured_content a.product_list__title span,
    .blockbestsellers_content a.product_list__title span {
        bottom: 4px !important;
    }

    .elstila_tabs_content .product_list__price,
    .homecategories_content .product_list__price,
    .homefeatured_content .product_list__price,
    .blockbestsellers_content .product_list__price {
        font-size: 19px !important;
        padding-top: 10px !important;
        display: inline-block !important;
    }
}

/* Tablet & Mobile responsive adjustments */
@media (max-width: 991px) {
    .elstila_tabs_content .product_promo,
    .homecategories_content .product_promo,
    .homefeatured_content .product_promo,
    .blockbestsellers_content .product_promo {
        width: 100% !important;
        height: auto !important;
        min-height: 420px !important;
        margin: 0 0 15px 0 !important;
        float: none !important;
    }

    .elstila_tabs_content .product_promo__hold,
    .homecategories_content .product_promo__hold,
    .homefeatured_content .product_promo__hold,
    .blockbestsellers_content .product_promo__hold {
        position: relative !important;
        padding: 20px !important;
    }

    .elstila_tabs_content .product_promo__image,
    .homecategories_content .product_promo__image,
    .homefeatured_content .product_promo__image,
    .blockbestsellers_content .product_promo__image {
        height: 240px !important;
    }

    .elstila_tabs_content .product_list,
    .homecategories_content .product_list,
    .homefeatured_content .product_list,
    .blockbestsellers_content .product_list {
        width: 100% !important;
        float: none !important;
        margin-bottom: 20px !important;
    }

    .elstila_tabs_content .product_list__items,
    .homecategories_content .product_list__items,
    .homefeatured_content .product_list__items,
    .blockbestsellers_content .product_list__items {
        height: 270px !important;
    }
}

/* ==========================================================================
   Sidebar Product Slider (Block Bestsellers & Sidebar Sliders)
   ========================================================================== */
.sidebar__product_slider_list_items {
    padding: 18px 15px 18px 105px !important;
    min-height: 100px !important;
    position: relative !important;
}

a.sidebar__product_slider_list_txt {
    padding-right: 38px !important;
}

/* Hide the redundant 'Daugiau' button completely */
.sidebar__product_slider_list_items a.product_buttons__more {
    display: none !important;
}

/* Flatten the old bottom buttons container */
.sidebar__product_slider_list_items .product_buttons {
    position: static !important;
    height: 0 !important;
    border: none !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.sidebar__product_slider_list_items .product_buttons:before {
    display: none !important;
}

/* Modern floating Wishlist heart button in the top-right corner of the sidebar card */
.sidebar__product_slider_list_items a.product_buttons__dream {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 10 !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid #e5e5e5 !important;
    text-align: center !important;
    line-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
    opacity: 0.92;
    text-decoration: none !important;
}

.sidebar__product_slider_list_items a.product_buttons__dream:not([style*="display:none"]):not([style*="display: none"]) {
    display: inline-block !important;
}

.sidebar__product_slider_list_items a.product_buttons__dream[style*="display:none"],
.sidebar__product_slider_list_items a.product_buttons__dream[style*="display: none"] {
    display: none !important;
}

.sidebar__product_slider_list_items a.product_buttons__dream:hover {
    opacity: 1 !important;
    transform: scale(1.12) !important;
    box-shadow: 0 3px 10px rgba(237, 29, 37, 0.25) !important;
    border-color: #ed1d25 !important;
}

/* Hide text labels ('Žymėti', 'Marked', etc.) */
.sidebar__product_slider_list_items a.product_buttons__dream .in,
.sidebar__product_slider_list_items a.product_buttons__dream .out {
    display: none !important;
}

/* Heart icon centered within the circle */
.sidebar__product_slider_list_items a.product_buttons__dream [class*="icon-"] {
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 28px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    color: #666666 !important;
    transition: color 0.2s ease !important;
}

/* Red heart on hover or active */
.sidebar__product_slider_list_items a.product_buttons__dream:hover [class*="icon-"],
.sidebar__product_slider_list_items a.product_buttons__dream.active [class*="icon-"] {
    color: #ed1d25 !important;
}

