.product-category-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.category-title {
    font-size: 24px;
    font-weight: 500;
    text-align: center;
    margin: 20px 0 30px;
    color: #111;
    letter-spacing: 0.3px;
}

.category-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.results-count {
    font-size: 14px;
    color: #666;
}

.sorting-options {
    position: relative;
}

.woocommerce-ordering {
    margin: 0;
}

/* Selectorul de sortare optimizat - problema cu săgeata rezolvată */
.woocommerce-ordering select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 0;
    padding: 8px 30px 8px 12px; /* Padding dreapta mărit pentru săgeată */
    cursor: pointer;
    font-size: 13px;
    color: #333;
    outline: none;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333'%3E%3Cpath d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center; /* Poziționare îmbunătățită a săgeții */
    background-size: 8px 8px;
}

/* Eliminăm stilul anterior pentru săgeată */
.woocommerce-ordering::after {
    display: none;
}

/* MODIFICARE: Restructurare completă a grid-layout-ului */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 3fr; /* 1 coloană pentru sidebar, 3 pentru conținut */
    gap: 20px;
}

.sidebar {
    grid-column: 1;
    grid-row: 1 / span 10;
    position: sticky;
    top: 60px;
    overflow-y: auto;
    align-self: start;
    font-size: 13px;
}

/* MODIFICARE: Container nou pentru produse */
.products-container {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 produse pe rând */
    gap: 20px;
}

.filter-header {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.filter-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-section {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.filter-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111;
}

/* Stilizare pentru secțiunile de filtrare personalizate */
.my-filter-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.my-filter-section h4 {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #111;
}

/* Stilizare pentru inputurile de preț pe același rând */
.my-price-filter {
    margin-top: 10px;
}

.my-price-inputs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.my-price-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.my-price-input {
    width: 100%;
    padding: 8px 30px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}

.my-price-input-label {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.my-price-separator {
    font-weight: bold;
    padding: 0 5px;
    color: #666;
}

.my-filter-dropdown {
    width: 100%;
    padding: 6px 26px 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: white;
    font-size: 12px;
    color: #333;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333'%3E%3Cpath d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 8px 8px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.my-filter-dropdown:hover, .my-filter-dropdown:focus {
    border-color: #aaa;
}

.price-filter {
    padding: 6px 0;
}

.price-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.price-value {
    font-weight: normal;
    font-size: 14px;
    color: #333;
}

.price-separator {
    margin: 0 5px;
    color: #666;
}

.range-slider-container {
    display: block;
    width: 100%;
    padding: 10px 0;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    outline: none;
    position: relative;
}

input[type="range"]::before {
    content: '';
    position: absolute;
    height: 4px;
    left: 0;
    top: 0;
    width: var(--range-progress, 0%);
    background: #D90368;
    border-radius: 2px 0 0 2px;
    z-index: 1;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
}

input[type="range"]::-moz-range-progress {
    height: 4px;
    border-radius: 2px 0 0 2px;
    background: #D90368;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #D90368;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #D90368;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

input[type="range"]:hover::-webkit-slider-thumb {
    background: #c10358;
}

input[type="range"]:hover::-moz-range-thumb {
    background: #c10358;
}

.price-min, .price-max {
    flex: 1;
}

.price-min input, .price-max input {
    width: 90%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.filter-dropdown {
    width: 100%;
    padding: 6px 26px 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: white;
    margin-top: 6px;
    font-size: 12px;
    color: #333;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333'%3E%3Cpath d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 8px 8px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.filter-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.my-filter-button {
    width: 100%;
    background-color: #111;
    color: white;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    transition: background-color 0.2s;
    margin-bottom: 10px;
}

.my-filter-button:hover {
    background-color: #D90368;
}

.my-filter-reset-button {
    width: 100%;
    background-color: #707070;
    color: white;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    transition: background-color 0.2s;
    text-align: center;
    text-decoration: none;
    display: block;
}

.my-filter-reset-button:hover {
    background-color: #888888;
}

.filter-button {
    width: 100%;
    background-color: #111;
    color: white;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    transition: background-color 0.2s;
}

.filter-button:hover {
    background-color: #D90368 !important;
}

.filter-reset-button {
    width: 100%;
    background-color: #707070;
    color: white;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    transition: background-color 0.2s;
    text-align: center;
    text-decoration: none;
    display: block;
}

.filter-reset-button:hover {
    background-color: #888888 !important;
}

/* MODIFICARE: Am eliminat toate regulile nth-child pentru grid-column și grid-row */
.newest-product-item {
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
}

.card-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.card-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    outline: none;
}

.newest-product-item a:focus {
    outline: none;
    box-shadow: none;
}

.newest-product-item a {
    -webkit-tap-highlight-color: transparent;
}

.product-image {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
    padding-bottom: 100%;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.placeholder-image {
    width: 100%;
    padding-bottom: 100%;
    background-color: #f0f0f0;
    border-radius: 2px;
}

.product-content {
    display: flex;
    flex-direction: column;
    text-wrap-style: balance;
}

.product-brand {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #000;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-link {
    color: inherit;
    text-decoration: none;
    position: relative;
    z-index: 2;
}

.brand-link:hover {
    text-decoration: underline;
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 5px 0;
    color: #333;
    height: auto;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
}

.title-text {
    cursor: pointer;
}

.product-short-desc {
    font-size: 12px;
    line-height: 1.8;
    color: #666;
    margin-top: -10px;
    margin-bottom: 10px;
    height: auto;
    overflow: visible;
    text-align: center;
    padding: 0 5px;
}

.badges-container {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.best-seller-badge, .promotion-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 3px;
    color: #fff;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.best-seller-badge {
    background-color: #111;
}

.promotion-badge {
    background-color: #d90468;
}

.product-price-wrapper {
    margin-top: auto;
    text-align: center;
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
}

.current-price {
    font-size: 15px;
    font-weight: 600;
    color: #111;
}

.old-price {
    font-size: 13px;
    text-decoration: line-through;
    color: #999;
    margin-right: 8px;
}

.price-per-unit {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.price-saving {
    font-size: 12px;
    color: #28a745;
    padding-top: 8px;
    margin-top: 5px;
    border-top: 1px dotted #ccc;
    font-weight: 500;
}

/* MODIFICARE: Am schimbat grid-column pentru paginație */
.category-pagination {
    grid-column: 2;
    grid-row: 2;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.category-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.category-pagination .page-numbers.current {
    background-color: #111;
    border-color: #111;
    color: #fff;
}

.no-products {
    padding: 30px;
    text-align: center;
    color: #666;
}

/* Responsive pentru tabletă */
@media (max-width: 991px) {
    .grid-layout {
        grid-template-columns: 1fr; /* O singură coloană */
        gap: 20px;
    }
    
    .sidebar {
        grid-column: 1;
        grid-row: 1;
        position: static;
        height: auto;
        max-height: none;
    }
    
    .products-container {
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: repeat(2, 1fr); /* 2 produse pe rând pe tabletă */
        gap: 20px;
    }
    
    .category-pagination {
        grid-column: 1;
        grid-row: 3;
    }
    
    .category-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .sorting-options, .woocommerce-ordering, .woocommerce-ordering select {
        width: 100%;
    }
    
    .product-title {
        font-size: 13px;
    }
    
    .current-price {
        font-size: 14px;
    }
}

/* Responsive pentru mobil - FIX important pentru 2 coloane */
@media (max-width: 480px) {
    .grid-layout {
        display: block !important;
    }
    
    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    
    /* FIX IMPORTANT: Forțează 2 produse pe rând pe mobil */
    .products-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
    }
    
    .newest-product-item {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 15px !important;
        float: none !important;
    }
    
    /* Eliminăm regula nth-child deoarece nu mai folosim float */
    .newest-product-item:nth-child(2n) {
        margin-right: 0 !important;
    }
    
    /* Nu mai avem nevoie de clearfix în grid */
    .products-container:after {
        display: none;
    }
    
    /* Optimizări pentru carduri pe mobil */
    .card-wrapper {
        margin-bottom: 10px;
    }
    
    .product-image {
        margin-bottom: 5px;
        padding-bottom: 90%; /* Puțin mai mic pentru a economisi spațiu */
    }
    
    .product-content {
        padding: 0 5px;
    }
    
    .product-title {
        font-size: 12px;
        margin-bottom: 3px;
        -webkit-line-clamp: 2;
    }
    
    .product-brand {
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    .product-short-desc {
        display: none; /* Ascundem descrierea pe mobil pentru a economisi spațiu */
    }
    
    .badges-container {
        margin-bottom: 3px;
    }
    
    .best-seller-badge, .promotion-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    .current-price {
        font-size: 13px;
    }
    
    .old-price {
        font-size: 11px;
    }
    
    .price-per-unit {
        font-size: 10px;
    }
    
    .price-saving {
        font-size: 10px;
        padding-top: 3px;
    }
    
    .category-pagination {
        display: block !important;
        width: 100% !important;
        clear: both !important;
        float: none !important;
        margin-top: 15px !important;
        padding-top: 15px !important;
    }
    
    .category-pagination .page-numbers {
        padding: 5px 10px;
        font-size: 13px;
        margin: 0 2px;
    }
    
    /* Optimizări pentru filtru pe mobil */
    .my-filter-section h4 {
        font-size: 13px;
    }
    
    .my-price-input {
        padding: 6px 25px 6px 8px;
        font-size: 12px;
    }
    
    .my-filter-button, .my-filter-reset-button, .filter-button, .filter-reset-button {
        padding: 7px;
        font-size: 11px;
    }
    
    /* Reguli comune pentru pagina de shop și pagina de rezultate căutare */
    .product-category-container {
        padding: 0 5px;
    }
    
    .category-title {
        font-size: 18px;
        margin: 15px 0;
    }
    
    .category-meta {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
}