/* ================================================= 
       1. LAYOUT PRINCIPAL MAGASIN (GRID: Stânga filtre, Dreapta produse)
       ================================================= */
    .shop-layout-grid {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 30px;
        align-items: start;
        margin-top: 20px;
    }

    /* Asigură-te că zona din dreapta (conținutul WooCommerce) se comportă ca o coloană flexibilă completă */
    .shop-layout-grid > div:not(.shop-sidebar-filters),
    .woocommerce-shop .content-area, 
    .shop-right-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0; /* Previne revărsarea elementelor (overflow) */
    }


/* ================================================= 
       2. SIDEBAR FILTRE (Stânga) - Curat, Fix & Ordonat
       ================================================= */
    
    /* Containerul principal al filtrului din stânga */
    .shop-sidebar-filters {
        background: #ffffff !important;
        border: 1px solid #edf2f7 !important;
        border-radius: 16px !important;
        padding: 24px !important;
        box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04) !important;
        position: sticky !important;
        top: 90px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Containerul intern direct (dacă există în temă) */
    .shop-sidebar-filters .filters-inner {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    /* Elimină complet titlurile redundante "Filtre" sau "Filtrează produsele" */
    .shop-sidebar-filters .filter-title,
    .shop-sidebar-filters h3.filter-title,
    .shop-sidebar-filters .wc-block-product-filters__heading,
    .shop-sidebar-filters h2.wp-block-heading {
        display: none !important;
    }
    
    /* Stilizarea unificată a titlurilor din sidebar + litera mare (Capitalize) */
    .shop-sidebar-filters .widget-title,
    .shop-sidebar-filters h4,
    .shop-sidebar-filters h3 {
        font-size: 13.5px !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        margin-bottom: 14px !important;
        text-transform: capitalize !important;
        letter-spacing: -0.01em !important;
    }
    
    /* Separator curat între widget-uri */
    .shop-sidebar-filters .widget,
    .shop-sidebar-filters .wp-block-woocommerce-product-filter {
        margin-bottom: 28px !important;
        padding-bottom: 20px !important;
        border-bottom: 1px dashed #f1f5f9 !important;
    }
    
    .shop-sidebar-filters .widget:last-child,
    .shop-sidebar-filters .wp-block-woocommerce-product-filter:last-child {
        border-bottom: none !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* REPOZIȚIONARE FIXĂ: "Promoții & Oferte" primul sus, "Preț" ultimul jos */
    .shop-sidebar-filters #bestm_on_sale_filter-2,
    .shop-sidebar-filters .widget_bestm_on_sale_filter {
        order: -99 !important;
    }

    .shop-sidebar-filters div[data-block-name="woocommerce/product-filter-price"],
    .shop-sidebar-filters .widget_price_filter {
        order: 99 !important;
        border-bottom: none !important;
    }


/* ================================================= 
       3. CHECKBOX-URI ȘI RADIO-URI (Soluția radicală anti-umbre)
       ================================================= */
    .shop-sidebar-filters ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .shop-sidebar-filters li {
        margin-bottom: 10px !important;
        font-size: 13px !important;
        color: #475569 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .shop-sidebar-filters li a {
        color: #475569 !important;
        transition: color 0.2s ease, transform 0.2s ease !important;
        display: inline-block !important;
        font-weight: 500 !important;
    }
    
    .shop-sidebar-filters li a:hover {
        color: #1976d2 !important;
        transform: translateX(3px) !important;
    }
    
    /* Resetare totală agresivă pentru orice checkbox din sidebar */
.shop-sidebar-filters input[type="checkbox"],
    .shop-sidebar-filters input[type="radio"],
    .shop-sidebar-filters .widget_bestm_on_sale_filter input[type="checkbox"],
    .shop-sidebar-filters .wc-block-product-filters input[type="checkbox"],
    .shop-sidebar-filters .wp-block-woocommerce-product-filter input[type="checkbox"],
    .shop-sidebar-filters .wc-block-checkbox__input,
    .shop-sidebar-filters label input[type="checkbox"],
    .shop-sidebar-filters span input[type="checkbox"] {
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        -webkit-box-shadow: none !important;
        box-shadow: none !important;
        -webkit-filter: none !important;
        filter: none !important;
        outline: none !important;
        background-image: none !important;
        background-color: #ffffff !important;
        background: #ffffff !important;
        border: 1.5px solid #cbd5e1 !important;
        border-radius: 6px !important; /* Colțuri ușor rotunjite exact ca în poză */
        width: 16px !important;
        height: 16px !important;
        min-width: 16px !important;
        min-height: 16px !important;
        max-width: 16px !important;
        max-height: 16px !important;
        cursor: pointer !important;
        margin-right: 12px !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    /* Starea când elementul este bifat (Checked) */
    .shop-sidebar-filters input[type="checkbox"]:checked,
    .shop-sidebar-filters input[type="radio"]:checked,
    .shop-sidebar-filters .wc-block-checkbox__input:checked {
        background: #1976d2 !important;
        background-color: #1976d2 !important;
        border-color: #1976d2 !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") !important;
        background-size: 12px 12px !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        box-shadow: none !important;
        -webkit-box-shadow: none !important;
    }

    /* Anulăm orice efect pe stările de hover/focus ale browserului care ar putea genera umbre */
    .shop-sidebar-filters input[type="checkbox"]:hover,
    .shop-sidebar-filters input[type="checkbox"]:focus {
        box-shadow: none !important;
        -webkit-box-shadow: none !important;
        border-color: #94a3b8 !important;
        background-color: #ffffff !important;
        background: #ffffff !important;
    }


    /* ================================================= 
       4. SLIDER DE PREȚ ȘI CÂMPURI TEXT (Sidebar)
       ================================================= */
    .shop-sidebar-filters .price_slider_wrapper .ui-slider {
        background: #e2e8f0 !important;
        height: 5px !important;
        border-radius: 3px !important;
        border: none !important;
        margin: 12px 0 !important;
    }

    .shop-sidebar-filters .price_slider_wrapper .ui-slider .ui-slider-range {
        background: #1976d2 !important;
        border-radius: 3px !important;
    }

    .shop-sidebar-filters .price_slider_wrapper .ui-slider .ui-slider-handle {
        background: #ffffff !important;
        border: 2px solid #1976d2 !important;
        width: 14px !important;
        height: 14px !important;
        top: -4.5px !important;
        border-radius: 50% !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
        cursor: pointer !important;
        outline: none !important;
    }

    .shop-sidebar-filters .price_label,
    .shop-sidebar-filters input[type="text"] {
        font-size: 12px !important;
        font-weight: 600 !important;
        color: #334155 !important;
    }
    
    .shop-sidebar-filters input[type="text"] {
        padding: 6px 10px !important;
        border-radius: 6px !important;
        border: 1px solid #cbd5e1 !important;
        text-align: center !important;
    }


    /* ================================================= 
       5. BARĂ SUPERIOARĂ MAGASIN (Sortare & Filtrare Rapidă)
       ================================================= */
    .shop-top-toolbar {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important; /* Elimină spațiul gol din dreapta prin distribuirea spațiului */
        flex-wrap: wrap !important;
        background-color: #f8fafc !important;
        padding: 10px 16px !important;
        border-radius: 10px !important;
        border: 1px solid #f1f5f9 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 20px !important;
        gap: 15px !important;
    }
    
    .toolbar-left-group {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        flex-wrap: wrap !important;
    }
    
    /* Stilizare unificată pentru select-uri și butoane din bara de sus */
    .shop-top-toolbar select,
    .top-filter-select,
    .onsale-checkbox-label,
    .reset-filters-btn {
        height: 32px !important;
        line-height: 30px !important;
        padding: 0 10px !important;
        border-radius: 6px !important;
        border: 1px solid #cbd5e1 !important;
        background-color: #ffffff !important;
        font-size: 12px !important;
        font-weight: 500 !important;
        color: #334155 !important;
        font-family: 'Outfit', -apple-system, sans-serif !important;
        box-sizing: border-box !important;
        outline: none !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        margin: 0 !important;
    }
    
    .shop-top-toolbar select:hover,
    .top-filter-select:hover,
    .onsale-checkbox-label:hover {
        border-color: #94a3b8 !important;
    }
    
    .shop-top-toolbar select:focus,
    .top-filter-select:focus {
        border-color: #1976d2 !important;
        box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1) !important;
    }
    
    /* Stilizare pentru opțiunea "Doar la ofertă" din bara de sus */
    .onsale-checkbox-label {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    
    .onsale-checkbox-label input[type="checkbox"] {
        width: 14px !important;
        height: 14px !important;
        accent-color: #e53935 !important;
        margin: 0 !important;
    }


    /* ================================================= 
       6. GRILA DE PRODUSE WOOCOMMERCE (4 Coloane)
       ================================================= */
    .woocommerce ul.products::before,
    .woocommerce ul.products::after,
    ul.products::before,
    ul.products::after {
        content: none !important;
        display: none !important;
    }
    
    .woocommerce ul.products li.product.first,
    ul.products li.product.first,
    .woocommerce ul.products li.product:first-child,
    ul.products li.product:first-child {
        clear: none !important;
        margin-left: 0 !important;
        grid-column-start: auto !important;
    }
    
    .woocommerce ul.products,
    ul.products {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 20px 0 !important;
        width: 100% !important;
        clear: both !important;
    }
    
    /* Cardul individual al fiecărui produs */
    .woocommerce ul.products li.product,
    ul.products li.product {
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 10px !important;
        padding: 16px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
        position: relative !important;
        text-align: left !important;
    }
    
    ul.products li.product:hover {
        transform: translateY(-4px) !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
        border-color: #cbd5e0 !important;
    }
    
    ul.products li.product img,
    ul.products li.product a img {
        width: 100% !important;
        height: 180px !important;
        object-fit: contain !important;
        margin: 0 auto 15px auto !important;
        display: block !important;
    }
    
    ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #2d3748 !important;
        line-height: 1.4 !important;
        margin-bottom: 10px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        height: 40px !important;
        font-family: 'Outfit', sans-serif !important;
    }
    
    ul.products li.product .price {
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #e53935 !important;
        margin-bottom: 15px !important;
        display: block !important;
    }
    
    ul.products li.product .price del {
        color: #a0aec0 !important;
        font-size: 13px !important;
        margin-right: 6px !important;
    }
    
    ul.products li.product .button {
        background-color: #1976d2 !important;
        color: #ffffff !important;
        text-align: center !important;
        padding: 10px 15px !important;
        border-radius: 6px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border: none !important;
        width: 100% !important;
        display: block !important;
        margin-top: auto !important;
    }
    
    ul.products li.product .button:hover {
        background-color: #115293 !important;
    }