/**
 * WooCommerce Customizations Suite - Comprehensive Frontend CSS
 */

/* ==========================================================================
   1. Account Dropdown
   ========================================================================== */
.account-dropdown { position: relative; display: inline-block; cursor: pointer; }
.account-dropdown .dropdown-content { margin: 0; display: none; position: absolute; background: #fff; box-shadow: 0 8px 16px rgba(0,0,0,0.1); z-index: 99999; min-width: 160px; padding: 8px 0; list-style: none; border-radius: 4px; border: 1px solid #eee; }
.account-dropdown:hover .dropdown-content { display: block; }
.account-dropdown .dropdown-content li { margin: 0; }
.account-dropdown .dropdown-content li a { color: #333; text-decoration: none; display: block; padding: 8px 15px; font-size: 14px; font-weight: 500; }
.account-dropdown .dropdown-content li a:hover { background: #f5f5f5; color: #000; }
@media (max-width: 768px) {
    .account-dropdown { height: 30px !important; }
}

/* ==========================================================================
   2. Cart Dropdown & Badge
   ========================================================================== */
.cart-wrapper { position: relative; display: inline-block; }
.cart-icon-container { position: relative; display: flex; align-items: center; cursor: pointer; }
.cart-contents { display: flex; align-items: center; color: inherit; text-decoration: none; position: relative; }
.cart-count-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #161616;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 6px;
    line-height: 1;
    min-width: 12px;
    text-align: center;
}
.cart-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    width: 320px;
    background-color: #ffffff;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.15);
    padding: 15px;
    border-radius: 4px;
    z-index: 99999;
    border: 1px solid #e2e2e2;
}
.cart-wrapper:hover .cart-dropdown-content { display: block; }
.cart-dropdown-content .widget_shopping_cart_content { margin: 0; padding: 0; }
.cart-dropdown-content ul.cart_list li { padding: 10px 0; border-bottom: 1px solid #eee; }
.cart-dropdown-content .woocommerce-mini-cart__total { font-weight: bold; border-top: 2px solid #eee; margin-top: 10px; padding-top: 10px; }
.cart-dropdown-content .woocommerce-mini-cart__buttons { display: flex; gap: 10px; margin-top: 10px; }
.cart-dropdown-content .woocommerce-mini-cart__buttons a { flex: 1; text-align: center; }

/* ==========================================================================
   3. Info Bar
   ========================================================================== */
.grant-info-bar { width: 100%; padding: 10px 15px; text-align: center; font-size: 14px; font-weight: 500; color: #ffffff; box-sizing: border-box; }
.grant-info-bar .info-bar-content { display: flex; justify-content: center; align-items: center; gap: 15px; flex-wrap: wrap; }
.grant-info-bar .info-btn { background-color: #ffffff; color: #000000; padding: 5px 12px; border-radius: 4px; text-decoration: none; font-size: 12px; font-weight: bold; text-transform: uppercase; transition: opacity 0.2s ease; }
.grant-info-bar .info-btn:hover { opacity: 0.9; }

/* ==========================================================================
   4. Mega Menu & Main Header Navigation (FIX: Desktop Single Horizontal Row)
   ========================================================================== */
body .custom-nav-bar {
    position: relative;
    width: 100%;
    z-index: 9999;
    display: flex !important;
    align-items: center !important;
}

@media (min-width: 992px) {
    /* Hide all mobile-only drawer elements on Desktop */
    body .menu-toggle-btn,
    body .drawer-header,
    body .drawer-title,
    body .close-btn,
    body .mobile-arrow,
    body .menu-overlay {
        display: none !important;
    }

    /* Reset Drawer container to single inline row */
    body .nav-drawer {
        position: static !important;
        background: transparent !important;
        width: auto !important;
        height: auto !important;
        box-shadow: none !important;
        padding: 0 !important;
        left: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        overflow: visible !important;
    }

    /* Force Menu items onto a SINGLE HORIZONTAL ROW */
    body .nav-menu {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 30px !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
    }

    body .nav-item {
        position: relative !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        font-size: 14px !important;
        border-bottom: none !important;
        width: auto !important;
        margin: 0 !important;
    }

    body .nav-item > a,
    body .shop-trigger {
        text-decoration: none !important;
        color: #333 !important;
        font-weight: 600 !important;
        font-size: 14px !important;
        padding: 15px 0 !important;
        display: inline-block !important;
    }

    body .mega-menu-content {
        position: absolute !important;
        top: 100% !important;
        left: 50% !important;
        width: 70vw !important;
        max-width: 1200px !important;
        transform: translateX(-50%) !important;
        background: #ffffff !important;
        box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
        visibility: hidden !important;
        opacity: 0 !important;
        transition: all 0.3s ease !important;
        padding: 35px 0 !important;
        z-index: 10000 !important;
        display: block !important;
    }

    body .has-mega-menu:hover .mega-menu-content {
        visibility: visible !important;
        opacity: 1 !important;
    }
}

.mega-menu-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.mega-parent-title { font-size: 15px; font-weight: 800; text-transform: uppercase; color: #000; display: block; margin-bottom: 12px; text-decoration: none; border-bottom: 2px solid #eee; padding-bottom: 5px; }
.mega-child-list { list-style: none; padding: 0; margin: 0; }
.mega-child-list li a { text-decoration: none; color: #666; font-size: 13px; padding: 4px 0; display: block; font-weight: 400; }
.mega-child-list li a:hover { color: #000; font-weight: 500; }

@media (max-width: 991px) {
    body .menu-toggle-btn { display: flex !important; flex-direction: column !important; gap: 5px !important; cursor: pointer !important; padding: 10px 0 !important; }
    body .menu-toggle-btn span { width: 25px !important; height: 3px !important; background: #333 !important; border-radius: 2px !important; }
    body .nav-drawer {
        position: fixed !important;
        top: 0 !important;
        left: -320px !important;
        width: 300px !important;
        height: 100vh !important;
        background: #161616 !important;
        color: #fff !important;
        z-index: 99999 !important;
        transition: left 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
        padding: 20px !important;
        box-shadow: 5px 0 15px rgba(0,0,0,0.2) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
    }
    body .nav-drawer.active { left: 0 !important; }
    body .drawer-header { display: flex !important; justify-content: space-between !important; align-items: center !important; padding-bottom: 15px !important; margin-bottom: 20px !important; border-bottom: 1px solid #333 !important; }
    body .drawer-title { font-weight: 800 !important; font-size: 18px !important; text-transform: uppercase !important; color: #fff !important; }
    body .close-btn { display: block !important; font-size: 30px !important; cursor: pointer !important; color: #999 !important; line-height: 1 !important; }
    body .nav-menu { flex-direction: column !important; align-items: flex-start !important; gap: 0 !important; width: 100% !important; }
    body .nav-item { border-bottom: 1px solid #222 !important; width: 100% !important; }
    body .nav-item > a, body .shop-trigger { color: #fff !important; padding: 15px 0 !important; width: 100% !important; }
    body .shop-trigger-wrapper { display: flex !important; justify-content: space-between !important; align-items: center !important; width: 100% !important; }
    body .mobile-arrow { display: flex !important; padding: 15px !important; cursor: pointer !important; color: #fff !important; }
    body .mega-menu-content { position: static !important; transform: none !important; width: 100% !important; visibility: visible !important; opacity: 1 !important; display: none; padding: 10px 0 20px 15px !important; box-shadow: none !important; border: none !important; background: transparent !important; }
    body .mega-menu-inner { grid-template-columns: 1fr !important; gap: 15px !important; padding: 0 !important; }
    body .mega-parent-title { color: #fff !important; border-bottom-color: #333 !important; }
    body .mega-child-list li a { color: #ccc !important; }
    body .menu-overlay { display: block !important; position: fixed !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; background: rgba(0,0,0,0.6) !important; visibility: hidden !important; opacity: 0 !important; transition: 0.3s !important; z-index: 99998 !important; }
    body .menu-overlay.active { visibility: visible !important; opacity: 1 !important; }
    body.no-scroll { overflow: hidden !important; }
}

/* ==========================================================================
   5. Product Extras & Banners
   ========================================================================== */
.custom-banner-system { margin: 25px 0; }
.banner-section { margin-bottom: 25px; }
.banner-img { width: 100%; height: auto; display: block; border-radius: 4px; }
.banner-text { margin-top: 10px; font-size: 15px; line-height: 1.6; }
.banners-extra-content { margin-top: 30px; }

/* ==========================================================================
   6. AJAX Shop Filter & Price Slider (FIX: Green Accent Color #B6D088)
   ========================================================================== */
.shop-search-container { position: relative; width: 100%; z-index: 200; }
.ajax-search-form { display: flex; align-items: center; gap: 10px; width: 100%; }
#shop-search-input {
    flex-grow: 1;
    padding: 14px 16px;
    border: 1px solid #eeeeee;
    font-size: 15px;
    background-color: #ffffff;
    border-radius: 8px;
    outline: none;
}
#shop-search-input:focus { border-color: #000000; box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08); }

body .ajax-search-form button {
    padding: 14px 24px !important;
    color: #353534 !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    background-color: #B6D088 !important;
    letter-spacing: 2px !important;
    white-space: nowrap !important;
}

/* Main Shop Layout */
.shop-main-layout-wrapper { display: flex; gap: 40px; align-items: flex-start; width: 100%; margin-top: 20px; }
.shop-sidebar-column { flex: 0 0 280px; max-width: 280px; position: sticky; top: 150px; }
.shop-products-column { flex: 1; min-width: 0; }
.shop-filter-sidebar { background: #ffffff; padding: 25px; border: 1px solid #eeeeee; }

/* Filter Category & Section Titles */
body .filter-title,
body .shop-filter-sidebar .filter-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #B6D088 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #f0f0f0 !important;
    margin-bottom: 15px !important;
}

/* Category List */
.filter-category-list, .child-category-list { list-style: none !important; padding: 0 !important; margin: 0 !important; }
.filter-item { border-bottom: 1px solid #f5f5f5; }
.filter-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.filter-row label { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; font-weight: 500; color: #222; }
.toggle-children { cursor: pointer; color: #999; font-weight: bold; padding: 5px; }

/* GREEN ACCENT PRICE SLIDER & BUTTON FIX */
.price-slider-container { padding: 15px 0 25px; }
.price-range-display { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 700; color: #333; margin-bottom: 18px; }
#price-min-display, #price-max-display { color: #333; font-weight: 700; }

body #price-slider.ui-slider,
body .price-slider,
body .ui-slider-horizontal {
    background: #e5e5e5 !important;
    height: 6px !important;
    border: none !important;
    border-radius: 3px !important;
    margin: 15px 0 20px !important;
    position: relative !important;
}

body #price-slider .ui-slider-range,
body .price-slider .ui-slider-range,
body .ui-slider .ui-slider-range,
body .ui-slider-range-min,
body .ui-slider-range-max {
    background: #B6D088 !important;
    height: 100% !important;
    border-radius: 3px !important;
    position: absolute !important;
}

body #price-slider .ui-slider-handle,
body .price-slider .ui-slider-handle,
body .ui-slider .ui-slider-handle {
    background: #B6D088 !important;
    border: 2px solid #ffffff !important;
    width: 20px !important;
    height: 20px !important;
    top: -7px !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
    cursor: pointer !important;
    outline: none !important;
}

body .apply-filter-btn,
body #apply-price-filter {
    width: 100% !important;
    padding: 12px 15px !important;
    background-color: #B6D088 !important;
    color: #353534 !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    transition: background 0.3s ease !important;
    text-transform: capitalize !important;
    box-shadow: none !important;
}
body .apply-filter-btn:hover,
body #apply-price-filter:hover {
    background-color: #9ec738 !important;
    color: #353534 !important;
}

/* ==========================================================================
   7. Product Cards Equal Height & Grid Layout (FIX: Same Height Cards)
   ========================================================================== */
body ul.products,
body .products.grid-columns-3,
body .woocommerce ul.products {
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
    align-items: stretch !important;
}

body .woocommerce ul.products li.product,
body .woocommerce-page ul.products li.product,
body .custom-product-card {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    background: #fff !important;
    border: 1px solid #ebebeb !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
}

body .custom-product-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
}

body .product-card-inner {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    flex: 1 1 auto !important;
}

body .product-card-image {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    display: block !important;
    padding: 15px !important;
    background: #fafafa !important;
}

/* Equal Height Details Box */
body .product-card-details {
    padding: 20px 18px !important;
    background: #f6f6f6 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

body .product-sku { font-size: 11px !important; color: #888 !important; text-transform: uppercase !important; margin-bottom: 4px !important; }

body .product-card-title {
    margin: 0 0 8px 0 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    color: #161616 !important;
    min-height: 44px !important;
}
body .product-card-title a { color: #161616 !important; text-decoration: none !important; }

body .product-card-excerpt {
    font-size: 13px !important;
    color: #555 !important;
    margin-bottom: 15px !important;
    line-height: 1.45 !important;
    flex: 1 1 auto !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    min-height: 38px !important;
}

body .product-card-price,
body .product-card-price ins,
body .product-card-price .amount {
    font-weight: 700 !important;
    font-size: 18px !important;
    color: #B6D088 !important;
    margin-bottom: 15px !important;
    margin-top: auto !important;
}
body .product-card-price del,
body .product-card-price del .amount {
    color: #999999 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    margin-right: 6px !important;
    text-decoration: line-through !important;
}

body .product-card-actions {
    margin-top: auto !important;
    width: 100% !important;
}

body .product-card-actions .button,
body .product-card-actions a.add_to_cart_button {
    width: 100% !important;
    background: #161616 !important;
    color: #ffffff !important;
    text-align: center !important;
    padding: 12px 10px !important;
    border-radius: 4px !important;
    text-transform: capitalize !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border: none !important;
    display: inline-block !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    box-shadow: none !important;
}
body .product-card-actions .button:hover,
body .product-card-actions a.add_to_cart_button:hover {
    background: #333333 !important;
}

.infinite-scroll-sentinel { grid-column: 1 / -1; height: 80px; display: flex; align-items: center; justify-content: center; }

/* Mobile Filter Toggle Button */
.mobile-filter-toggle { display: none; margin-bottom: 25px; }
.mobile-filter-toggle button {
    width: 100%;
    background: #000;
    color: #fff;
    padding: 15px;
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   8. RESPONSIVE BREAKPOINTS FOR MOBILE GRID (FIX: Mobile Grid Responsiveness)
   ========================================================================== */
@media (max-width: 991px) {
    body .mobile-filter-toggle { display: block !important; }
    body .shop-sidebar-column { display: none !important; width: 100% !important; max-width: 100% !important; }
    body .shop-main-layout-wrapper { flex-direction: column !important; }
    body ul.products,
    body .woocommerce ul.products,
    body .woocommerce-page ul.products,
    body .products.grid-columns-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 768px) {
    body .mobile-search-toggle { display: flex !important; }
    body ul.products,
    body .woocommerce ul.products,
    body .woocommerce-page ul.products,
    body .shop-products-column .products.grid-columns-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        width: 100% !important;
    }
    body .woocommerce ul.products li.product,
    body .woocommerce-page ul.products li.product,
    body .woocommerce ul.products[class*=columns-] li.product,
    body .woocommerce-page ul.products[class*=columns-] li.product,
    body .custom-product-card {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin: 0 !important;
        display: flex !important;
    }
}

@media (max-width: 480px) {
    body ul.products,
    body .woocommerce ul.products,
    body .woocommerce-page ul.products,
    body .products.grid-columns-3 {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* Loading State */
.loading { opacity: 0.6; pointer-events: none; }
