/*
Theme Name: YOOtheme Child
Template: yootheme
Version: 1.0.8
*/

/* Fix duplicated swatches in Woo Variant Grid */
.wvg-card .variations_form .wvg-swatch-field~.wvg-swatches-container {
    display: none !important;
}

/* Custom Add to Cart Button Styling - Force Black */
.wvg-card .wvg-form .button,
.wvg-card .wvg-form .button:hover,
.wvg-card .wvg-form .button.alt,
.wvg-card .wvg-form .button.alt:hover,
.wvg-card .wvg-form .wvg-load-variations-btn,
.wvg-card .wvg-form .wvg-load-variations-btn:hover {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
    transition: all 0.3s ease !important;
}

/* Hover Zoom Effect */
.wvg-card .wvg-form .button:hover,
.wvg-card .wvg-form .button.alt:hover,
.wvg-card .wvg-form .wvg-load-variations-btn:hover {
    transform: scale(1.1) !important;
    background-color: #000 !important;
    /* Ensure it stays black */
}

/* Force state for JS fix */
.wvg-card .wvg-form .button.wvg-no-hover {
    transform: scale(1) !important;
    background-color: #000 !important;
    transition: none !important;
}

/* Hide WooCommerce Price History text in Grid (Use tooltip instead) */
.wvg-card .static-price .wc-price-history {
    display: none !important;
}

/* Force Padding on Quick View Details (Right Column) */
.wvg-quickview-details-col {
    padding: 40px !important;
}

/* =========================================
   Filter "Velikost" Styling (Swatches Look)
   ========================================= */

/* Target only our custom shortcode wrapper */
.wvg-styled-filter .woocommerce-widget-layered-nav-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px 12px !important;
    list-style: none !important;
    /* Remove standard bullets */
    padding: 0 !important;
    margin: 0 !important;
}

/* List Item Reset */
.wvg-styled-filter .woocommerce-widget-layered-nav-list li {
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    position: relative !important;
    overflow: visible !important;
    list-style: none !important;
    /* Ensure no bullets */
}

/* Hide Pseudo-elements (Checkboxes/Bullets provided by theme) */
.wvg-styled-filter .woocommerce-widget-layered-nav-list li::before,
.wvg-styled-filter .woocommerce-widget-layered-nav-list li::after,
.wvg-styled-filter .woocommerce-widget-layered-nav-list li a::before,
.wvg-styled-filter .woocommerce-widget-layered-nav-list li a::after {
    display: none !important;
    content: none !important;
}

/* Link Styling (Chip/Swatch - Matching .wvg-opt-btn) */
.wvg-styled-filter .woocommerce-widget-layered-nav-list li a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 10px !important;
    /* Match .wvg-opt-btn padding */
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    /* Soft border */
    border-radius: 8px !important;
    background: #fff;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #333 !important;
    min-width: 36px;
    height: 36px;
    text-align: center;
    line-height: normal !important;
    text-decoration: none !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease !important;
}

/* Link Hover */
.wvg-styled-filter .woocommerce-widget-layered-nav-list li a:hover {
    border-color: #000 !important;
    transform: translateY(-1px);
    color: #333 !important;
    /* Keep text dark on hover unless selected */
}

/* Selected State - Matching .wvg-opt-btn.selected */
.wvg-styled-filter .woocommerce-widget-layered-nav-list li.chosen a {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Count Badge Styling - HIDDEN as requested */
.wvg-styled-filter .woocommerce-widget-layered-nav-list li .count-number,
.wvg-styled-filter .woocommerce-widget-layered-nav-list li .count {
    display: none !important;
}

/* Hide input if present (fallback) */
.wvg-styled-filter input {
    display: none;
}

/* =========================================
   Mobile View Customization (UX for quick purchases)
   ========================================= */

/* Hide mobile-specific buttons and elements on desktop */
.wvg-mobile-quick-add-btn,
.wvg-bottom-sheet-close,
.wvg-bottom-sheet-overlay {
    display: none !important;
}

/* Mobile Breakpoint (Tablet Portrait and smaller - Yootheme usually 959px) */
@media (max-width: 959px) {

    /* Force 2 Columns for Woo Variant Grid or Yootheme element */
    .uk-grid>div.wvg-card,
    .wvg-grid>div.wvg-card,
    div[class*="el-Item"],
    ul.products>* {
        width: 50% !important;
    }

    /* Minimize Product Card styling for cleaner look */
    .wvg-card .product-media {
        margin-bottom: 8px !important;
        border-radius: 8px;
        overflow: hidden;
    }

    .wvg-card .static-title {
        font-size: 12px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 4px;
    }

    .wvg-card .static-price {
        font-size: 14px;
        font-weight: 800;
    }

    /* Floating Action Buttons */
    .wvg-quick-favorite-btn {
        display: inline-flex !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        top: 8px !important;
        right: 8px !important;
        width: 32px !important;
        height: 32px !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    }

    .wvg-mobile-quick-add-btn {
        display: inline-flex !important;
        position: absolute;
        bottom: 8px;
        right: 8px;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: #000;
        color: #fff;
        border: none;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        z-index: 10;
        cursor: pointer;
        padding: 0;
    }

    /* Hide the Lupa on Mobile */
    .wvg-image-zoom-btn {
        display: none !important;
    }

    /* BOTTOM SHEET MODAL (Mobile sizing overrides) */
    .wvg-card .hover-details-panel {
        display: none;
        /* Hide default hover state */
    }

    .hover-details-panel.wvg-active-sheet {
        display: flex !important;
        flex-direction: column;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        height: auto !important;
        max-height: 85vh !important;
        background: #fff !important;
        z-index: 100000 !important;
        transform: translateY(0) !important;
        padding: 24px 20px 30px !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2) !important;
        overflow-y: auto !important;
        transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1) !important;
    }

    .wvg-active-sheet .wvg-bottom-sheet-header {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .wvg-active-sheet .wvg-bottom-sheet-image {
        width: 100%;
        height: auto;
        max-height: 300px;
        object-fit: contain;
        border-radius: 8px;
    }

    .wvg-active-sheet .wvg-bottom-sheet-title {
        font-weight: 700;
        font-size: 18px;
        line-height: 1.2;
        color: #111;
        text-align: center;
        margin-bottom: 5px;
    }

    .wvg-active-sheet .wvg-bottom-sheet-price {
        font-weight: 600;
        font-size: 16px;
        color: #333;
        text-align: center;
        margin-bottom: 5px;
    }

    .wvg-bottom-sheet-close {
        display: block !important;
        position: absolute;
        top: 15px;
        right: 15px;
        background: #f1f1f1;
        border: none;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        font-size: 20px;
        line-height: 1;
        color: #333;
        z-index: 100001;
    }

    .wvg-bottom-sheet-overlay.is-active {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99999;
        backdrop-filter: blur(2px);
    }

    /* Adjust form for Bottom Sheet */
    .wvg-active-sheet .wvg-form {
        margin-top: 5px;
    }

    .wvg-active-sheet .single_add_to_cart_button {
        padding: 15px 0 !important;
        font-size: 14px !important;
        border-radius: 10px !important;
        margin-top: 20px !important;
    }

    .wvg-active-sheet .wc-price-history-lowest-inner {
        font-size: 10px;
        color: #999;
        display: block;
        margin-top: 5px;
    }

    .wvg-active-sheet .wvg-swatches-container {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        justify-content: center !important;
        margin: 15px 0 20px !important;
        /* Proper spacing above and below */
    }
}

.wvg-active-sheet .wvg-opt-btn {
    padding: 12px 18px !important;
    font-size: 14px !important;
}

/* Override UIkit Global Modals to act as Bottom Sheets ON MOBILE ONLY */
@media (max-width: 959px) {

    body #wvg-modal-cart,
    body #wvg-modal-favorites {
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Only force display flex when UIkit has marked the modal as open */
    body #wvg-modal-cart.uk-open,
    body #wvg-modal-favorites.uk-open {
        display: flex !important;
    }

    body #wvg-modal-cart .uk-modal-dialog,
    body #wvg-modal-favorites .uk-modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        padding: 24px 20px 30px !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2) !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        background: #fff !important;
        transform: translateY(100%) !important;
        flex: none !important;
        /* Force a custom transition instead of UIkit's default fade */
        transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s ease !important;
        opacity: 0 !important;
    }

    /* UIkit applies uk-open class when the modal is active */
    body #wvg-modal-cart.uk-open .uk-modal-dialog,
    body #wvg-modal-favorites.uk-open .uk-modal-dialog {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }

    #wvg-modal-cart .uk-modal-close-default,
    #wvg-modal-favorites .uk-modal-close-default {
        top: 15px !important;
        right: 15px !important;
        background: #f1f1f1 !important;
        border: none !important;
        width: 30px !important;
        height: 30px !important;
        border-radius: 50% !important;
        color: #333 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Desktop Styles */
@media (min-width: 960px) {

    /* Hide the mobile image trigger on desktop so it doesn't block Quick View or product links */
    .wvg-mobile-image-trigger {
        display: none !important;
    }

    /* Fix Swatch alignment and padding on Desktop Grid */
    .wvg-swatches-container {
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
        margin-top: 10px !important;
        margin-bottom: 0px !important;
        width: 100% !important;
    }
}

/* Custom Margin Settings for ul.products on Mobile */
@media (max-width: 639px) {
    .woocommerce ul.products {
        margin-left: -8px;
        margin-right: -8px;
    }

    .woocommerce ul.products>article.wvg-card.product-card,
    .woocommerce ul.products>li.product {
        padding-left: 8px;
        padding-right: 8px;
        box-sizing: border-box;
    }
}

/* Backorder / Coming Soon Styling */
.backorder-coming-soon {
    display: block !important;
    padding: 12px 15px;
    background-color: #f1f1f1;
    color: #888;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    cursor: not-allowed;
    width: 100%;
    margin: 15px 0 0 0 !important;
    box-sizing: border-box !important;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1 1 100%;
}

/* Hide Add to Cart if Coming Soon text is displayed */
.single_variation_wrap:has(.backorder-coming-soon) .woocommerce-variation-add-to-cart,
.tm-element-woo-add-to-cart:has(.backorder-coming-soon) .woocommerce-variation-add-to-cart,
.wvg-form:has(.backorder-coming-soon) .woocommerce-variation-add-to-cart,
.wvg-form:has(.backorder-coming-soon) .wvg-load-variations-btn,
.wvg-card:has(.backorder-coming-soon) .wvg-load-variations-btn,
.wvg-card:has(.backorder-coming-soon) .wvg-add-to-cart-placeholder {
    display: none !important;
}

/* Hide entire variations table (size selectors) when product is on backorder */
form.variations_form:has(.backorder-coming-soon) table.variations {
    display: none !important;
}

.tm-element-woo-add-to-cart:has(.backorder-coming-soon) table.variations {
    display: none !important;
}

/* Force show the variation wrapper if it contains Coming Soon text on grid */
.wvg-form .single_variation_wrap:has(.backorder-coming-soon),
.wvg-form .woocommerce-variation:has(.backorder-coming-soon),
.wvg-form .woocommerce-variation-availability:has(.backorder-coming-soon) {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
}

/* Hide the "View Cart" (Prikaži košarico) link after adding to cart */
a.added_to_cart {
    display: none !important;
}

/* Custom Block Cart Checkout Button and Coupon Button */
.wc-block-cart__submit-container .wc-block-components-button.wc-block-cart__submit-button,
.wc-block-components-totals-coupon__button,
.wc-block-components-button.wp-element-button.wc-block-components-totals-coupon__button,
.wc-block-components-checkout-place-order-button,
.wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button {
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 12px 20px !important;
    transition: all 0.3s ease !important;
}

.wc-block-cart__submit-container .wc-block-components-button.wc-block-cart__submit-button:hover,
.wc-block-components-totals-coupon__button:hover,
.wc-block-components-button.wp-element-button.wc-block-components-totals-coupon__button:hover,
.wc-block-components-checkout-place-order-button:hover,
.wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button:hover {
    background-color: #333 !important;
    border-color: #333 !important;
    transform: translateY(-1px);
    color: #fff !important;
}