.unit-button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 6px 12px;
    margin-right: 5px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.unit-button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

.unit-button.active {
    background: #007bff;
    border-color: #007bff;
    color: #ffffff;
}

.unit-button.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.card-product__units {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.card-product__units .unit-button {
    position: relative;
    z-index: 15;
    pointer-events: auto;
    touch-action: manipulation;
}

.listing-sort__units {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.listing-sort__units_type {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    flex: 1;
    justify-content: flex-start;
}

.listing-sort__units_type .unit-button {
    flex: 0 0 auto;
    min-width: 32px;
    text-align: center;
    white-space: nowrap;
    padding: 6px 12px;
    margin: 0;
    border-radius: 4px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.listing-sort__units_type .unit-button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

.listing-sort__units_type .unit-button.active {
    background: #007bff;
    border-color: #007bff;
    color: #ffffff;
}

.listing-sort {
    align-items: center;
    background-color: var(--color-light-1);
    border-radius: 4px;
    display: flex;
    padding: 12px 20px;
    margin-bottom: 20px;
}

.listing-sort__units {
    align-items: center;
    display: flex;
    margin-left: auto;
    margin-right: 0;
}

.listing-sort__title {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.listing-sort__units_type {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

.listing-sort__units_type .unit-button {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    background: var(--color-gray-bg);
    border: 1px solid #dee2e6;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 0 0 auto;
    min-width: 32px;
    text-align: center;
    height: 26px;
    line-height: 18px;
    min-height: 26px;
}

.listing-sort__units_type .unit-button:hover {
    background: #d0d0d0;
    border-color: #adb5bd;
    color: #212529;
}

.listing-sort__units_type .unit-button.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.card-product__price:not(.active) {
    display: none;
}

.card-product__price.active {
    display: flex;
}

.card-product__price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 0;
}

.card-product__price:last-child {
    border-bottom: none;
}

.card-product__price-label {
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

.card-product__price-value {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.card-product__price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.card-product__price:last-child {
    border-bottom: none;
}

.card-product__price-label {
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

.card-product__price-value {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.unit-button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.unit-button:active {
    transform: translateY(1px);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.card-product__units {
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
}

.card-product__units .unit-button {
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

@media (max-width: 768px) {
    .unit-button {
        padding: 4px 8px;
        font-size: 11px;
        margin-right: 3px;
        margin-bottom: 0;
        min-height: 32px;
        min-width: 32px;
    }
    
    .card-product__units {
        margin-bottom: 8px;
    }
    
    .listing-sort__units {
        flex-direction: row;
        align-items: center;
        gap: 5px;
    }
    
    .listing-sort__units_type {
        width: auto;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
    
    .listing-sort__units_type .unit-button {
        flex: 0 0 auto;
        margin-right: 5px;
        margin-bottom: 0;
        padding: 4px 8px;
        font-size: 11px;
        min-height: 32px;
    }
}

@media (max-width: 480px) {
    .listing-sort {
        padding: 8px 12px;
    }
    
    .listing-sort__units_type {
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
    
    .listing-sort__units_type .unit-button {
        flex: 0 0 auto;
        max-width: 60px;
        margin-right: 4px;
        margin-bottom: 0;
        padding: 4px 6px;
        font-size: 10px;
    }
}
