/**
 * Elstila Dynamic Home Tabs - Frontend Styles
 * Styled matching header__main_menu_links & marked_menu_button
 * Full-width distributed tabs with prominent visible red bottom stripe
 * Modern product cards: Floating wishlist on image, no redundant 'More' button
 */

.elstila_tabs_container {
    margin-top: 15px;
    margin-bottom: 35px;
}

.elstila_tabs_nav_bar {
    margin: 15px 0 35px 0;
    border-bottom: 4px solid #ed1d25; /* Prominent continuous red line underneath all buttons */
    position: relative;
    overflow: visible !important; /* Prevents any mouse wheel scrolling or clipping on desktop */
}

/* Full width flex container */
.elstila_tabs_nav {
    list-style: none;
    padding: 0;
    margin: 0; /* Kept at 0 so buttons sit cleanly above the red line and never cover it */
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

/* Equal width items filling 100% of the bar */
.elstila_tab_item {
    margin: 0;
    padding: 0;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
}

/* Base style matching header__main_menu_links */
.elstila_tab_item a,
.elstila_tab_item a.header__main_menu_links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
    height: 48px;
    line-height: 48px;
    padding: 0 10px;
    font-family: 'Ubuntu', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff !important;
    background: #2d2d2d;
    text-decoration: none;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-bottom: none;
    margin-bottom: 0;
    position: relative;
    float: none;
    text-align: center;
    transition: background 0.25s ease-in-out, color 0.25s ease-in-out;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Clean icon without circular badge */
.elstila_tab_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    color: inherit;
    font-size: 15px;
    line-height: 1;
    margin: 0;
    transition: transform 0.2s ease-in-out;
}

.elstila_tab_badge i {
    font-size: 15px;
    line-height: 1;
}

.elstila_tab_title {
    display: inline-block;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Desktop: Smooth mouse hover (only for devices with a real mouse pointer) */
@media (hover: hover) and (pointer: fine) {
    .elstila_tab_item:hover a,
    .elstila_tab_item a:hover {
        background: #3e3e3e;
        color: #ffffff !important;
    }

    .elstila_tab_item:hover .elstila_tab_badge {
        transform: scale(1.12);
    }
}

/* Mobile & Touch: Instant tactile tap feedback (no sticky hover glitch) */
@media (hover: none), (pointer: coarse) {
    .elstila_tab_item a:active {
        transform: scale(0.96);
        background: #ed1d25;
        transition: transform 0.1s ease;
    }
}

/* Active marked button style matching marked_menu_button */
.elstila_tab_item.active a,
.elstila_tab_item a.marked_menu_button,
.elstila_tab_item a.active {
    background: #ed1d25 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 -2px 8px rgba(237, 29, 37, 0.25);
}

.elstila_tab_item.active .elstila_tab_badge,
.elstila_tab_item a.marked_menu_button .elstila_tab_badge {
    color: #ffffff !important;
}

/* Tab Panes */
.elstila_tabs_content {
    min-height: 400px;
    position: relative;
}

.elstila_tab_pane {
    display: none;
    width: 100%;
}

.elstila_tab_pane.active {
    display: block;
    animation: elstilaFadeIn 0.3s ease-in-out;
}

@keyframes elstilaFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner */
.elstila_tab_loading {
    padding: 80px 20px;
    text-align: center;
    width: 100%;
}

.elstila_spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 16px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ed1d25;
    border-radius: 50%;
    animation: elstilaSpin 0.8s linear infinite;
}

.elstila_loading_text {
    font-family: 'Ubuntu', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #777;
    margin: 0;
    letter-spacing: 0.5px;
}

@keyframes elstilaSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tablet responsiveness */
@media (max-width: 991px) {
    .elstila_tab_item a,
    .elstila_tab_item a.header__main_menu_links {
        padding: 0 6px;
        font-size: 12px;
        gap: 5px;
        letter-spacing: 0.3px;
    }
    .elstila_tab_badge i {
        font-size: 13px;
    }
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .elstila_tabs_nav_bar {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 10px 0 25px 0;
    }

    .elstila_tabs_nav_bar::-webkit-scrollbar {
        display: none;
    }

    .elstila_tabs_nav {
        width: max-content;
        min-width: 100%;
        margin-bottom: 0;
    }

    .elstila_tab_item {
        flex: 0 0 auto;
    }

    .elstila_tab_item a,
    .elstila_tab_item a.header__main_menu_links {
        height: 42px;
        line-height: 42px;
        padding: 0 14px;
        font-size: 12px;
        gap: 6px;
        width: auto;
    }

    .elstila_tab_badge i {
        font-size: 13px;
    }
}

/* ==========================================================================
   Modern Product Cards (Clean, no redundant 'More', Floating Wishlist Heart)
   Applies to:
   - Dynamic Home Tabs (.elstila_tabs_content)
   - Home Categories (.homecategories_content)
   - Home Featured (.homefeatured_content)
   Pixel-perfect alignment: Promo card (544px) = 2 grid rows (270px + 4px + 270px)
   ========================================================================== */

/* Hide the redundant 'Daugiau' button completely across all cards */
.elstila_tabs_content a.product_buttons__more,
.homecategories_content a.product_buttons__more,
.homefeatured_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 {
    display: none !important;
}

/* Flatten the old bottom buttons container so it occupies 0 height, allowing cards to be compact */
.elstila_tabs_content .product_buttons,
.homecategories_content .product_buttons,
.homefeatured_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 {
    display: none !important;
}

/* Modern floating Wishlist heart button on the top-right corner over the product image (all cards) */
.elstila_tabs_content a.product_buttons__dream,
.homecategories_content a.product_buttons__dream,
.homefeatured_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"]) {
    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"] {
    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 {
    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 {
    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-"] {
    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-"] {
    color: #ed1d25 !important;
}

/* Product price top padding */
.elstila_tabs_content .product_list__price,
.homecategories_content .product_list__price,
.homefeatured_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 {
        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 {
        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 {
        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 {
        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 {
        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 {
        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 {
        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 {
        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 {
        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 {
        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 {
        bottom: 4px !important;
    }

    .elstila_tabs_content .product_list__price,
    .homecategories_content .product_list__price,
    .homefeatured_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 {
        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 {
        position: relative !important;
        padding: 20px !important;
    }

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

    .elstila_tabs_content .product_list,
    .homecategories_content .product_list,
    .homefeatured_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 {
        height: 270px !important;
    }
}
