/**
 * WooGarden Customizer Frontend Styles
 * 
 * This file contains all the styles for the frontend customizations
 * including hero sections, product filters, and AJAX search.
 * All classes are prefixed with 'wgc-' to avoid theme conflicts.
 */

/* ---- WGC Hero Section Styles ---- */
.wgc-hero-section.wgc-hero-section {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    left: auto !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
}

/* WGC Full-width hero section - fixed breakout approach */
.wgc-hero-section.wgc-hero-section.wgc-hero-full-width {
    /* Use CSS grid or calc for proper full-width without breaking layout */
    width: calc(100vw - (100vw - 100%));
    max-width: none;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    /* Remove problematic positioning */
    position: relative;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    clip: none !important;
    clip-path: none !important;
}

.wgc-hero-section.wgc-hero-full-width .wgc-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

/* WGC Container-width hero section */
.wgc-hero-section.wgc-hero-section.wgc-hero-container-width {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.wgc-hero-section.wgc-hero-container-width .wgc-hero-content {
    padding: 3rem 2rem;
}

.wgc-hero-content.wgc-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding-top: var(--hero-padding-top, 2rem);
    padding-bottom: var(--hero-padding-bottom, 2rem);
    padding-left: 1rem;
    padding-right: 1rem;
}

/* WGC Hero breadcrumbs styling - fixed positioning */
.wgc-hero-breadcrumbs.wgc-hero-breadcrumbs {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 3;
}

.wgc-hero-section.wgc-hero-full-width .wgc-hero-breadcrumbs.wgc-hero-breadcrumbs {
    left: calc(50% - 580px);
    max-width: calc(100% - 40px);
}

/* Responsive breadcrumb positioning */
@media (max-width: 1200px) {
    .wgc-hero-section.wgc-hero-full-width .wgc-hero-breadcrumbs.wgc-hero-breadcrumbs {
        left: 20px;
    }
}

.wgc-hero-breadcrumbs.wgc-hero-breadcrumbs .woocommerce-breadcrumb {
    margin: 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    font-size: 14px;
    color: white;
    display: block;
    border: none;
}

.wgc-hero-breadcrumbs.wgc-hero-breadcrumbs .woocommerce-breadcrumb a {
    color: white !important;
    opacity: 0.9 !important;
    text-decoration: none !important;
}

.wgc-hero-breadcrumbs.wgc-hero-breadcrumbs .woocommerce-breadcrumb a:hover {
    opacity: 1 !important;
    text-decoration: underline !important;
}

.wgc-hero-breadcrumbs.wgc-hero-breadcrumbs .woocommerce-breadcrumb .separator {
    opacity: 0.7 !important;
    margin: 0 8px !important;
    color: white !important;
}

.wgc-hero-title.wgc-hero-title {
    font-size: 2.5rem !important;
    margin-bottom: 1rem !important;
    color: #333 !important;
    position: relative !important;
    z-index: 2 !important;
}

.wgc-hero-subtitle.wgc-hero-subtitle {
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
    color: #555 !important;
    position: relative !important;
    z-index: 2 !important;
}

.wgc-hero-description.wgc-hero-description {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    color: #666 !important;
    position: relative !important;
    z-index: 2 !important;
}

.wgc-hero-video.wgc-hero-video {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    width: auto !important;
    height: auto !important;
    transform: translateX(-50%) translateY(-50%) !important;
    z-index: 0 !important;
}

.wgc-hero-overlay.wgc-hero-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
}

/* Adjust hero content for dark overlays */
.wgc-hero-overlay[style*="background-color: #000"] ~ .wgc-hero-content .wgc-hero-title,
.wgc-hero-overlay[style*="background-color: #000"] ~ .wgc-hero-content .wgc-hero-subtitle,
.wgc-hero-overlay[style*="background-color: #000"] ~ .wgc-hero-content .wgc-hero-description {
    color: #fff !important;
}

/* ---- Product Filters Styles ---- */
.wgc-product-filters {
    margin-bottom: 0;
    padding: 0;
    background-color: #f8f8f8;
    border-radius: 5px;
}

.wgc-product-filters h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.wgc-filter-widget {
    margin-bottom: 0;
}

.wgc-filter-widget h4 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}

.wgc-filter-options {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.wgc-filter-option {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.wgc-filter-option input[type="checkbox"] {
    margin-right: 0.5rem;
}

.wgc-price-filter .wgc-price-inputs {
    display: flex;
    justify-content: space-between;
}

.wgc-price-filter label {
    display: block;
    width: 48%;
}

.wgc-price-filter input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-top: 0.3rem;
}

.wgc-filter-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 0;
}

.wgc-apply-filters {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.wgc-apply-filters:hover {
    background-color: #45a049;
}

.wgc-reset-filters {
    color: #666;
    text-decoration: none;
    padding: 0.7rem 0;
    display: inline-block;
}

.wgc-reset-filters:hover {
    color: #333;
    text-decoration: underline;
}

/* ---- AJAX Search Styles ---- */
.wgc-ajax-search {
    position: relative;
    margin-bottom: 1.5rem;
}

.wgc-search-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.wgc-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    z-index: 100;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.wgc-search-results.active {
    display: block;
}

.wgc-search-result-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.wgc-search-result-item:last-child {
    border-bottom: none;
}

.wgc-search-result-item:hover {
    background-color: #f9f9f9;
}

.wgc-search-result-thumbnail {
    width: 60px;
    height: 60px;
    margin-right: 1rem;
}

.wgc-search-result-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
}

.wgc-search-result-info {
    flex-grow: 1;
}

.wgc-search-result-title {
    font-weight: bold;
    color: #333;
    text-decoration: none;
    margin-bottom: 0.3rem;
    display: block;
}

.wgc-search-result-price {
    color: #4CAF50;
    font-weight: bold;
}

.wgc-search-no-results {
    padding: 1rem;
    text-align: center;
    color: #666;
}

.wgc-search-loading {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: none;
}

/* ---- Responsive Styles ---- */
@media (max-width: 768px) {
    .wgc-hero-title {
        font-size: 2rem;
    }
    
    .wgc-hero-subtitle {
        font-size: 1.2rem;
    }
    
    .wgc-price-filter .wgc-price-inputs {
        flex-direction: column;
    }
    
    .wgc-price-filter label {
        width: 100%;
        margin-bottom: 0.8rem;
    }
    
    .wgc-filter-actions {
        flex-direction: column;
    }
    
    .wgc-reset-filters {
        margin-top: 0.8rem;
        text-align: center;
    }
}

/* Navigation Buttons */
.wgc-navigation-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.wgc-navigation-buttons .wgc-nav-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    min-width: 120px;
    height: 50px;
    border-radius: 25px;
    background-color: #5e9f58;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.wgc-navigation-buttons .wgc-nav-button:hover {
    background-color: #4e8a48;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wgc-navigation-buttons .wgc-nav-button i {
    font-size: 20px;
    margin-right: 8px;
}

.wgc-navigation-buttons .wgc-nav-label {
    font-size: 14px;
    font-weight: 600;
}

.wgc-navigation-buttons .wgc-cart-count {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: #5e9f58;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .wgc-navigation-buttons {
        bottom: 20px;
        right: 20px;
    }
    
    .wgc-navigation-buttons .wgc-nav-button {
        min-width: 110px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .wgc-navigation-buttons {
        bottom: 15px;
        right: 15px;
    }
    
    .wgc-navigation-buttons .wgc-nav-button {
        min-width: 100px;
        height: 40px;
        padding: 0 12px;
    }
    
    .wgc-navigation-buttons .wgc-nav-button i {
        font-size: 18px;
    }
    
    .wgc-navigation-buttons .wgc-nav-label {
        font-size: 12px;
    }
}

.wgc-navigation-buttons .wgc-nav-label {
    display: none;
}

/* ---- WGC Filter Bar Positioning Styles ---- */

/* WGC Container filter bar */
.wgc-container-filter-bar.wgc-container-filter-bar {
    margin-bottom: 20px !important;
    padding: 15px 0 !important;
    border-bottom: 1px solid #eee !important;
    background: #f9f9f9 !important; /* Fallback - overridden by PHP with custom colors */
}

.wgc-container-filter-bar.wgc-container-filter-bar .wgc-filter-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

.wgc-container-filter-bar .woocommerce-result-count,
.wgc-container-filter-bar .woocommerce-ordering {
    display: block !important;
    color: #333333; /* Fallback - overridden by PHP with custom colors */
}

/* WGC Sidebar filter bar layout */
.wgc-shop-layout.wgc-shop-layout {
    display: flex !important;
    gap: 30px !important;
    margin-top: 20px !important;
}

.wgc-filter-sidebar.wgc-filter-sidebar {
    flex: 0 0 280px !important;
    background: #f9f9f9 !important; /* Fallback - overridden by PHP with custom colors */
    padding: 20px !important;
    border-radius: 6px !important;
    height: fit-content !important;
    position: sticky !important;
    top: 20px !important;
}

.wgc-filter-sidebar.wgc-filter-sidebar h3 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #5e9f58 !important;
    color: #5e9f58 !important;
}

.wgc-products-main.wgc-products-main {
    flex: 1 !important;
    min-width: 0 !important; /* Prevents flex item from overflowing */
}

/* Sidebar filter text colors - fallback, overridden by PHP with custom colors */
.wgc-filter-sidebar .woocommerce-result-count,
.wgc-filter-sidebar .woocommerce-ordering {
    color: #333333 !important;
}

/* Enhanced responsive design */
@media (max-width: 1024px) {
    .wgc-shop-layout {
        gap: 20px;
    }
    
    .wgc-filter-sidebar {
        flex: 0 0 250px;
    }
}

@media (max-width: 768px) {
    .wgc-shop-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .wgc-filter-sidebar {
        flex: none;
        order: 1 !important;
        position: static;
    }
    
    .wgc-products-main {
        order: 2 !important;
    }
    
    .wgc-container-filter-bar .wgc-filter-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wgc-hero-section.wgc-hero-full-width {
        padding: 2rem 1rem;
    }
    
    .wgc-hero-breadcrumbs {
        top: 10px;
        left: 10px;
    }
}

/* Fix for themes that might interfere */
.wgc-hero-section * {
    box-sizing: border-box;
}

.wgc-filter-sidebar .widget {
    margin-bottom: 20px;
}

.wgc-filter-sidebar .widget:last-child {
    margin-bottom: 0;
}

/* ---- WGC Aggressive Overrides to Handle Theme Interference ---- */

/* Comprehensive page title hiding for various themes */
body .woocommerce-products-header__title,
body .page-title,
body .woocommerce-products-header h1,
body .entry-title,
body .archive-title,
body .page-header h1,
body .shop-title,
body .woocommerce-page-title,
body h1.entry-title,
body .woocommerce-products-header .entry-title,
body .page-header .entry-title,
body .archive-header .entry-title,
body .woocommerce-products-header .page-title,
body .hero-title:not(.wgc-hero-title),
body .main-title,
body header.page-header,
body .woocommerce-products-header.page-header,
body .archive-header,
body .category-header,
body .taxonomy-header,
body .term-header,
body .woocommerce-archive-header,
body .page-title-wrapper,
body .entry-header .entry-title,
body .content-header .entry-title,
body .page-banner h1,
body .archive-banner h1,
body .woocommerce-title,
body .shop-header h1,
body .product-category-title,
body .category-title,
body .archive-description .entry-title,
body .woocommerce-products-header .woocommerce-products-header__title {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Force hide original WooCommerce elements when moved to filter bar */
body.woocommerce-shop .woocommerce-result-count:not(.wgc-filter-content .woocommerce-result-count):not(.wgc-shop-elements .woocommerce-result-count),
body.woocommerce-shop p.woocommerce-result-count:not(.wgc-filter-content .woocommerce-result-count):not(.wgc-shop-elements .woocommerce-result-count),
body.tax-product_cat .woocommerce-result-count:not(.wgc-filter-content .woocommerce-result-count):not(.wgc-shop-elements .woocommerce-result-count),
body.tax-product_tag .woocommerce-result-count:not(.wgc-filter-content .woocommerce-result-count):not(.wgc-shop-elements .woocommerce-result-count) {
    display: none !important;
    visibility: hidden !important;
}

body.woocommerce-shop .woocommerce-ordering:not(.wgc-filter-content .woocommerce-ordering):not(.wgc-shop-elements .woocommerce-ordering),
body.woocommerce-shop form.woocommerce-ordering:not(.wgc-filter-content .woocommerce-ordering):not(.wgc-shop-elements .woocommerce-ordering),
body.tax-product_cat .woocommerce-ordering:not(.wgc-filter-content .woocommerce-ordering):not(.wgc-shop-elements .woocommerce-ordering),
body.tax-product_tag .woocommerce-ordering:not(.wgc-filter-content .woocommerce-ordering):not(.wgc-shop-elements .woocommerce-ordering) {
    display: none !important;
    visibility: hidden !important;
}

/* Force container breakout for full-width heroes - alternative method */
@supports (width: 100vw) {
    .wgc-hero-section.wgc-hero-full-width {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        transform: translateX(0) !important;
        position: relative !important;
    }
}

/* Override any theme container constraints */
.wgc-hero-section.wgc-hero-full-width {
    contain: layout !important;
    isolation: isolate !important;
}

/* Ensure breadcrumbs in hero are visible */
.wgc-hero-breadcrumbs.wgc-hero-breadcrumbs .woocommerce-breadcrumb {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force display of moved elements in filter bars */
.wgc-filter-content .woocommerce-result-count,
.wgc-filter-content .woocommerce-ordering,
.wgc-shop-elements .woocommerce-result-count,
.wgc-shop-elements .woocommerce-ordering {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Filter Elements Layout - Updated Structure */
.wgc-filter-elements {
    display: block !important;
    width: 100%;
}

/* Search Row - Full Width at Top */
.wgc-filter-search-row {
    width: 100% !important;
    margin-bottom: 15px;
}

.wgc-filter-search-row .wgc-ajax-search-element {
    width: 100% !important;
    margin-bottom: 0 !important;
}

/* Filter Separator */
.wgc-filter-separator {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.1), transparent);
    margin: 15px 0;
}

/* Filter Options Row */
.wgc-filter-options-row {
    display: flex !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
    margin-bottom: 15px;
}

.wgc-filter-options-row .wgc-filter-element {
    flex: 1 1 auto !important;
    min-width: 150px !important;
    margin-bottom: 0 !important;
}

/* WooCommerce Filters Row */
.wgc-woocommerce-filters-row {
    display: flex !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

.wgc-show-all-element {
    margin-bottom: 0 !important;
}

.wgc-show-all-products {
    display: inline-block !important;
    padding: 8px 16px !important;
    background: #5e9f58 !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: background-color 0.3s ease !important;
}

.wgc-show-all-products:hover {
    background: #4a7a45 !important;
    color: white !important;
}

/* Legacy filter element styling - keep for backward compatibility */
.wgc-filter-element {
    margin-bottom: 15px;
}

.wgc-filter-element label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

/* AJAX Search Element */
.wgc-ajax-search-element {
    position: relative;
}

.wgc-ajax-search-input {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 16px !important;
}

.wgc-ajax-search-results {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-top: none !important;
    border-radius: 0 0 6px 6px !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    z-index: 1000 !important;
    display: none !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

.wgc-ajax-search-results.active {
    display: block !important;
}

/* Categories and Tags Elements */
.wgc-categories-element,
.wgc-tags-element {
    position: relative;
}

.wgc-category-filter,
.wgc-tag-filter {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    background: white !important;
}

/* Price Range Element */
.wgc-price-range-element {
    position: relative;
}

.wgc-price-range-placeholder {
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Container Layout Specific Styles */
.wgc-container-elements .wgc-filter-element label {
    color: #333 !important;
    font-size: 14px !important;
}

/* Sidebar Layout Specific Styles */
.wgc-sidebar-elements {
    display: block !important;
    width: 100% !important;
}

.wgc-sidebar-elements .wgc-filter-search-row,
.wgc-sidebar-elements .wgc-filter-options-row,
.wgc-sidebar-elements .wgc-woocommerce-filters-row {
    display: block !important;
}

.wgc-sidebar-elements .wgc-filter-element {
    width: 100% !important;
    margin-bottom: 15px !important;
}

.wgc-sidebar-elements .wgc-filter-element label {
    color: #5e9f58 !important;
    font-weight: 600 !important;
    border-bottom: 1px solid rgba(94, 159, 88, 0.2) !important;
    padding-bottom: 5px !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wgc-filter-options-row {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .wgc-filter-options-row .wgc-filter-element {
        flex: 1 1 auto !important;
        min-width: 100% !important;
    }
    
    .wgc-woocommerce-filters-row {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

/* Shop Elements Row Styling */
.wgc-shop-elements-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 15px !important;
    margin-top: 15px !important;
    padding-top: 15px !important;
    border-top: 1px solid rgba(0,0,0,0.1) !important;
}

.wgc-shop-elements-row .woocommerce-result-count,
.wgc-shop-elements-row .woocommerce-ordering {
    margin: 0 !important;
    display: block !important;
    visibility: visible !important;
}

/* Sidebar shop elements row */
.wgc-filter-sidebar .wgc-shop-elements-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    border-top-color: rgba(94, 159, 88, 0.2) !important;
}

.wgc-filter-sidebar .wgc-shop-elements-row .woocommerce-result-count,
.wgc-filter-sidebar .wgc-shop-elements-row .woocommerce-ordering {
    width: 100% !important;
    margin-bottom: 10px !important;
}

.wgc-filter-sidebar .wgc-shop-elements-row .woocommerce-ordering select {
    width: 100% !important;
    padding: 8px !important;
}

/* Mobile responsive for shop elements */
@media (max-width: 768px) {
    .wgc-shop-elements-row {
        gap: 8px;
    }
}

/* ---- Twenty Twenty-Five Theme Compatibility ---- */
.wp-site-blocks .wgc-hero-section {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.wp-site-blocks .wgc-hero-section.wgc-hero-full-width {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* ---- Filter Bar Compatibility ===== */

/* Ensure filter bar doesn't interfere with other elements */
.wgc-unified-filter-bar {
    position: relative;
    z-index: 10;
    width: 100%;
    margin-bottom: 2rem;
}

/* Only apply layout wrapper to classic themes */
.wgc-shop-layout-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

.wgc-shop-content {
    min-width: 0;
    max-width: 100%;
}

/* Fix for filter bar elements alignment */
.wgc-filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: flex-start;
}

.wgc-filter-control {
    flex: 0 0 auto;
    min-width: 150px;
}

.wgc-filter-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

/* Mobile responsiveness for filter bar */
@media (max-width: 768px) {
    .wgc-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wgc-filter-control {
        min-width: 100%;
    }
    
    .wgc-filter-actions {
        margin-left: 0;
        margin-top: 1rem;
    }
}

/* ---- Comprehensive Layout Fixes ---- */

/* Reset any problematic positioning */
.wgc-hero-section,
.wgc-unified-filter-bar,
.wgc-filter-main-content {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Ensure proper spacing and flow */
.wgc-hero-section {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.wgc-unified-filter-bar {
    margin: 0 0 2rem 0;
    width: 100%;
    max-width: 100%;
    display: block;
    clear: both;
    position: static !important;
    z-index: 1;
}

/* Fix product grid layout */
.woocommerce .products {
    margin-top: 2rem;
    clear: both;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Ensure proper spacing between filter bar and products */
.wgc-unified-filter-bar + .woocommerce-notices-wrapper,
.wgc-unified-filter-bar + .products,
.wgc-unified-filter-bar + * + .products {
    margin-top: 2rem;
}

/* Fix breadcrumb positioning */
.wgc-hero-breadcrumbs {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    max-width: calc(100% - 40px);
}

/* Hide duplicate elements more aggressively */
body.woocommerce-shop .woocommerce-products-header,
body.woocommerce-shop .page-header,
body.woocommerce-shop .entry-header,
.wp-block-query-title,
.wc-block-product-collection-title {
    display: none !important;
}

/* Hide duplicate breadcrumbs */
.wc-block-breadcrumbs:not(.wgc-hero-breadcrumbs),
.woocommerce-breadcrumb:not(.wgc-hero-breadcrumbs .woocommerce-breadcrumb),
nav.woocommerce-breadcrumb:not(.wgc-hero-breadcrumbs nav.woocommerce-breadcrumb) {
    display: none !important;
}

/* Responsive fixes */
@media (max-width: 768px) {
    .wgc-hero-section.wgc-hero-full-width {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
    
    .wgc-hero-breadcrumbs {
        position: static;
        margin-bottom: 1rem;
    }
    
    .woocommerce .products {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

/* ---- Filter Bar Layout Fixes - SAFE VERSION ===== */

/* Ensure hero, header, footer are NEVER affected by filter layouts */
.wgc-hero-section,
header,
footer,
.wp-block-template-part,
nav,
.wp-block-site-title,
.wp-block-navigation,
main {
    /* Force reset any grid or layout interference */
    display: block !important;
    grid-column: unset !important;
    grid-template-columns: unset !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    position: relative !important;
}

/* Only apply layout changes to classic themes with wrapper */
.wgc-shop-layout-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

.wgc-shop-content {
    min-width: 0;
    max-width: 100%;
}

/* Remove any global interference */
body,
.wp-site-blocks {
    display: block !important;
    grid-template-columns: unset !important;
    grid-gap: unset !important;
    gap: unset !important;
}

/* Responsive fixes for classic theme layout wrapper only */
@media (max-width: 1024px) {
    .wgc-shop-layout-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
} 