/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/

/* Categories dropdown -> 3 columns grid, desktop only */
@media (min-width: 1025px) {
    .wd-dropdown-cats {
        width: 680px !important;
        max-width: 680px !important;
    }
    .wd-dropdown-cats > ul.menu {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0 8px;
        width: 100%;
        max-height: 280px;
        overflow-y: auto;
        padding: 10px 14px;
        box-sizing: border-box;
    }
    .wd-dropdown-cats > ul.menu > li {
        border: 0 !important;
        margin: 0 !important;
        padding: 4px 0 !important;
    }
    .wd-dropdown-cats > ul.menu > li > a {
        border: 0 !important;
        padding: 4px 0 !important;
    }
    .wd-dropdown-cats > ul.menu > li.wd-more-cat-btn {
        display: none !important;
    }
}

/* Force-show all categories (Woodmart JS hides extras via inline display:none) */
@media (min-width: 1025px) {
    .wd-dropdown-cats > ul.menu > li:not(.wd-more-cat-btn) {
        display: block !important;
    }
}

/* Tighter rows + hover only on text (green), no bg */
@media (min-width: 1025px) {
    .wd-dropdown-cats > ul.menu > li > a {
        min-height: 25px !important;
        line-height: 25px !important;
        padding: 0 !important;
        background: transparent !important;
        transition: color .15s ease;
    }
    .wd-dropdown-cats > ul.menu > li > a:hover,
    .wd-dropdown-cats > ul.menu > li > a:hover .nav-link-text,
    .wd-dropdown-cats > ul.menu > li.current-menu-item > a {
        background: transparent !important;
        color: #2bb673 !important;
    }
}

/* Final tweaks: green color + wrapper padding */
@media (min-width: 1025px) {
    .wd-dropdown-cats > ul.menu {
        padding: 25px !important;
    }
    .wd-dropdown-cats > ul.menu > li > a:hover,
    .wd-dropdown-cats > ul.menu > li > a:hover .nav-link-text,
    .wd-dropdown-cats > ul.menu > li.current-menu-item > a,
    .wd-dropdown-cats > ul.menu > li.current-menu-item > a .nav-link-text {
        color: #0d8c0b !important;
        background: transparent !important;
    }
}

/* Single product: equalize add-to-cart + quantity height (desktop), white qty bg */
@media (min-width: 1025px) {
    .single-product form.cart .single_add_to_cart_button {
        min-height: 56px !important;
    }
    .single-product form.cart .quantity,
    .single-product form.cart .quantity .qty,
    .single-product form.cart .quantity .minus,
    .single-product form.cart .quantity .plus {
        height: 56px !important;
        min-height: 56px !important;
    }
    .single-product form.cart .quantity,
    .single-product form.cart .quantity .qty,
    .single-product form.cart .quantity .minus,
    .single-product form.cart .quantity .plus {
        background-color: #fff !important;
    }
}

/* Single product gallery: fixed heights + object-fit cover */
@media (min-width: 1025px) {
    .wd-single-gallery .wd-gallery-images .wd-carousel-item,
    .wd-single-gallery .wd-gallery-images .wd-carousel-item a,
    .wd-single-gallery .wd-gallery-images .wd-carousel-item img {
        height: 590px !important;
        max-height: 590px !important;
    }
    .wd-single-gallery .wd-gallery-images .wd-carousel-item img {
        width: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    .wd-single-gallery .wd-gallery-thumb .wd-carousel-item,
    .wd-single-gallery .wd-gallery-thumb .wd-carousel-item a,
    .wd-single-gallery .wd-gallery-thumb .wd-carousel-item img {
        height: 116px !important;
        max-height: 116px !important;
    }
    .wd-single-gallery .wd-gallery-thumb .wd-carousel-item img {
        width: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }
}

/* Single product gallery: mobile heights */
@media (max-width: 1024px) {
    .wd-single-gallery .wd-gallery-images .wd-carousel-item,
    .wd-single-gallery .wd-gallery-images .wd-carousel-item a,
    .wd-single-gallery .wd-gallery-images .wd-carousel-item img {
        height: 380px !important;
        max-height: 380px !important;
    }
    .wd-single-gallery .wd-gallery-images .wd-carousel-item img {
        width: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    .wd-single-gallery .wd-gallery-thumb .wd-carousel-item,
    .wd-single-gallery .wd-gallery-thumb .wd-carousel-item a,
    .wd-single-gallery .wd-gallery-thumb .wd-carousel-item img {
        height: 90px !important;
        max-height: 90px !important;
    }
    .wd-single-gallery .wd-gallery-thumb .wd-carousel-item img {
        width: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }
}

/* Quantity buttons hover: green text, white bg */
.single-product form.cart .quantity .minus:hover,
.single-product form.cart .quantity .plus:hover,
.single-product form.cart .quantity .minus:focus,
.single-product form.cart .quantity .plus:focus {
    background-color: #fff !important;
    color: #0d8c0b !important;
    border-color: #0d8c0b !important;
}

/* Categories dropdown: column-first flow + Oferte/Pachete move to end */
@media (min-width: 1025px) {
    .wd-dropdown-cats > ul.menu {
        grid-auto-flow: column !important;
        grid-template-rows: repeat(6, auto) !important;
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .wd-dropdown-cats > ul.menu > li#menu-item-80 { order: 98; } /* Pachete */
    .wd-dropdown-cats > ul.menu > li#menu-item-79 { order: 99; } /* Oferte */
}

/* Mobile/tablet menu: push Oferte + Pachete la inceput */
@media (max-width: 1024px) {
    #menu-meniu-categorii-1.wd-active { display: flex !important; flex-direction: column !important; }
    #menu-meniu-categorii-1:not(.wd-active) { display: none !important; }
    #menu-meniu-categorii-1 > li.menu-item-79 { order: -2 !important; } /* Oferte */
    #menu-meniu-categorii-1 > li.menu-item-80 { order: -1 !important; } /* Pachete */
}
